From 77ed62a9e0db52bad066462d12b7a66625d9dd89 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 00:24:43 +0000 Subject: [PATCH 1/2] feat(api): manual updates (#1) --- .github/workflows/ci.yml | 41 + .github/workflows/publish-gem.yml | 30 + .github/workflows/release-doctor.yml | 22 + .gitignore | 9 + .gitkeep | 0 .release-please-manifest.json | 3 + .rubocop.yml | 194 + .stats.yml | 3 +- .yardopts | 1 + Gemfile | 25 +- Gemfile.lock | 124 +- LICENSE | 2 +- README.md | 136 +- Rakefile | 87 +- SECURITY.md | 27 + Steepfile | 15 + lib/orb.rb | 220 + lib/orb/auth.rb | 1 - lib/orb/base_client.rb | 617 +- lib/orb/base_model.rb | 1189 ++ lib/orb/base_page.rb | 44 + lib/orb/base_pagination.rb | 32 - lib/orb/client.rb | 130 + lib/orb/errors.rb | 284 + lib/orb/extern.rb | 15 + lib/orb/model.rb | 211 - lib/orb/models/alert.rb | 280 + .../alert_create_for_customer_params.rb | 101 + ...ert_create_for_external_customer_params.rb | 101 + .../alert_create_for_subscription_params.rb | 99 + lib/orb/models/alert_disable_params.rb | 25 + lib/orb/models/alert_enable_params.rb | 25 + lib/orb/models/alert_list_params.rb | 96 + lib/orb/models/alert_retrieve_params.rb | 18 + lib/orb/models/alert_update_params.rb | 51 + lib/orb/models/amount_discount.rb | 69 + lib/orb/models/backfill_close_response.rb | 26 - lib/orb/models/backfill_create_response.rb | 26 - lib/orb/models/backfill_fetch_response.rb | 26 - lib/orb/models/backfill_list_response.rb | 26 - lib/orb/models/backfill_revert_response.rb | 26 - .../balance_transaction_create_response.rb | 47 - .../balance_transaction_list_response.rb | 47 - lib/orb/models/billable_metric.rb | 96 + lib/orb/models/billing_cycle_relative_date.rb | 28 + .../cost_list_by_external_id_response.rb | 45 - lib/orb/models/cost_list_response.rb | 45 - lib/orb/models/coupon.rb | 115 +- lib/orb/models/coupon_archive_params.rb | 18 + lib/orb/models/coupon_create_params.rb | 130 + lib/orb/models/coupon_fetch_params.rb | 18 + lib/orb/models/coupon_list_params.rb | 52 + .../coupons/subscription_list_params.rb | 39 + .../credit_list_by_external_id_response.rb | 15 - lib/orb/models/credit_list_response.rb | 15 - lib/orb/models/credit_note.rb | 742 +- lib/orb/models/credit_note_create_params.rb | 98 + lib/orb/models/credit_note_fetch_params.rb | 18 + lib/orb/models/credit_note_list_params.rb | 37 + lib/orb/models/customer.rb | 1114 +- lib/orb/models/customer_create_params.rb | 942 + lib/orb/models/customer_delete_params.rb | 18 + .../customer_fetch_by_external_id_params.rb | 18 + lib/orb/models/customer_fetch_params.rb | 18 + lib/orb/models/customer_list_params.rb | 72 + ..._gateway_by_external_customer_id_params.rb | 18 + ...ync_payment_methods_from_gateway_params.rb | 18 + .../customer_update_by_external_id_params.rb | 940 + lib/orb/models/customer_update_params.rb | 937 + .../balance_transaction_create_params.rb | 62 + .../balance_transaction_create_response.rb | 216 + .../balance_transaction_list_params.rb | 74 + .../balance_transaction_list_response.rb | 212 + .../cost_list_by_external_id_params.rb | 83 + .../cost_list_by_external_id_response.rb | 134 + lib/orb/models/customers/cost_list_params.rb | 79 + .../models/customers/cost_list_response.rb | 132 + .../credit_list_by_external_id_params.rb | 58 + .../credit_list_by_external_id_response.rb | 91 + .../models/customers/credit_list_params.rb | 58 + .../models/customers/credit_list_response.rb | 91 + ...dger_create_entry_by_external_id_params.rb | 246 + ...er_create_entry_by_external_id_response.rb | 1590 ++ .../credits/ledger_create_entry_params.rb | 242 + .../credits/ledger_create_entry_response.rb | 1589 ++ .../ledger_list_by_external_id_params.rb | 168 + .../ledger_list_by_external_id_response.rb | 1592 ++ .../customers/credits/ledger_list_params.rb | 168 + .../customers/credits/ledger_list_response.rb | 1588 ++ .../top_up_create_by_external_id_params.rb | 171 + .../top_up_create_by_external_id_response.rb | 183 + .../customers/credits/top_up_create_params.rb | 171 + .../credits/top_up_create_response.rb | 183 + .../top_up_delete_by_external_id_params.rb | 28 + .../customers/credits/top_up_delete_params.rb | 28 + .../top_up_list_by_external_id_params.rb | 41 + .../top_up_list_by_external_id_response.rb | 183 + .../customers/credits/top_up_list_params.rb | 41 + .../customers/credits/top_up_list_response.rb | 183 + lib/orb/models/dimensional_price_group.rb | 73 + .../dimensional_price_group_create_params.rb | 62 + .../dimensional_price_group_list_params.rb | 37 + ...dimensional_price_group_retrieve_params.rb | 18 + lib/orb/models/dimensional_price_groups.rb | 32 + ...ensional_price_group_id_retrieve_params.rb | 20 + lib/orb/models/discount.rb | 91 + lib/orb/models/evaluate_price_group.rb | 63 + lib/orb/models/event_deprecate_params.rb | 18 + lib/orb/models/event_deprecate_response.rb | 23 +- lib/orb/models/event_ingest_params.rb | 109 + lib/orb/models/event_ingest_response.rb | 103 +- lib/orb/models/event_search_params.rb | 44 + lib/orb/models/event_search_response.rb | 108 +- lib/orb/models/event_update_params.rb | 57 + lib/orb/models/event_update_response.rb | 23 +- .../models/events/backfill_close_params.rb | 20 + .../models/events/backfill_close_response.rb | 144 + .../models/events/backfill_create_params.rb | 92 + .../models/events/backfill_create_response.rb | 144 + .../models/events/backfill_fetch_params.rb | 20 + .../models/events/backfill_fetch_response.rb | 144 + lib/orb/models/events/backfill_list_params.rb | 39 + .../models/events/backfill_list_response.rb | 144 + .../models/events/backfill_revert_params.rb | 20 + .../models/events/backfill_revert_response.rb | 144 + lib/orb/models/events/event_volumes.rb | 67 + lib/orb/models/events/volume_list_params.rb | 63 + lib/orb/models/invoice.rb | 2902 ++- lib/orb/models/invoice_create_params.rb | 222 + lib/orb/models/invoice_fetch_params.rb | 18 + .../models/invoice_fetch_upcoming_params.rb | 24 + .../models/invoice_fetch_upcoming_response.rb | 2922 ++- lib/orb/models/invoice_issue_params.rb | 33 + lib/orb/models/invoice_level_discount.rb | 40 + .../models/invoice_line_item_create_params.rb | 61 + .../invoice_line_item_create_response.rb | 1136 +- lib/orb/models/invoice_list_params.rb | 222 + lib/orb/models/invoice_mark_paid_params.rb | 39 + lib/orb/models/invoice_pay_params.rb | 18 + lib/orb/models/invoice_update_params.rb | 27 + lib/orb/models/invoice_void_params.rb | 18 + lib/orb/models/item.rb | 130 +- lib/orb/models/item_create_params.rb | 25 + lib/orb/models/item_fetch_params.rb | 18 + lib/orb/models/item_list_params.rb | 37 + lib/orb/models/item_update_params.rb | 96 + lib/orb/models/metric_create_params.rb | 55 + lib/orb/models/metric_create_response.rb | 20 - lib/orb/models/metric_fetch_params.rb | 18 + lib/orb/models/metric_fetch_response.rb | 20 - lib/orb/models/metric_list_params.rb | 72 + lib/orb/models/metric_list_response.rb | 20 - lib/orb/models/metric_update_params.rb | 27 + lib/orb/models/pagination_metadata.rb | 32 + lib/orb/models/percentage_discount.rb | 70 + lib/orb/models/plan.rb | 1160 +- lib/orb/models/plan_create_params.rb | 8275 +++++++++ lib/orb/models/plan_fetch_params.rb | 18 + lib/orb/models/plan_list_params.rb | 112 + lib/orb/models/plan_update_params.rb | 36 + .../plans/external_plan_id_fetch_params.rb | 20 + .../plans/external_plan_id_update_params.rb | 38 + lib/orb/models/price.rb | 14908 ++++++++++++++++ lib/orb/models/price_create_params.rb | 972 + lib/orb/models/price_evaluate_params.rb | 79 + lib/orb/models/price_evaluate_response.rb | 25 + lib/orb/models/price_fetch_params.rb | 18 + lib/orb/models/price_list_params.rb | 37 + lib/orb/models/price_update_params.rb | 27 + .../prices/external_price_id_fetch_params.rb | 20 + .../prices/external_price_id_update_params.rb | 29 + lib/orb/models/subscription.rb | 1538 +- lib/orb/models/subscription_cancel_params.rb | 61 + .../models/subscription_cancel_response.rb | 1441 ++ lib/orb/models/subscription_create_params.rb | 14317 +++++++++++++++ .../models/subscription_create_response.rb | 1441 ++ .../models/subscription_fetch_costs_params.rb | 77 + .../subscription_fetch_costs_response.rb | 157 +- lib/orb/models/subscription_fetch_params.rb | 18 + .../subscription_fetch_schedule_params.rb | 72 + .../subscription_fetch_schedule_response.rb | 92 +- .../models/subscription_fetch_usage_params.rb | 154 + lib/orb/models/subscription_list_params.rb | 119 + .../subscription_price_intervals_params.rb | 10323 +++++++++++ .../subscription_price_intervals_response.rb | 1436 ++ ...ubscription_schedule_plan_change_params.rb | 14303 +++++++++++++++ ...scription_schedule_plan_change_response.rb | 1442 ++ .../subscription_trigger_phase_params.rb | 26 + .../subscription_trigger_phase_response.rb | 1436 ++ ...cription_unschedule_cancellation_params.rb | 18 + ...iption_unschedule_cancellation_response.rb | 1444 ++ ...edule_fixed_fee_quantity_updates_params.rb | 25 + ...ule_fixed_fee_quantity_updates_response.rb | 1456 ++ ..._unschedule_pending_plan_changes_params.rb | 18 + ...nschedule_pending_plan_changes_response.rb | 1450 ++ ...iption_update_fixed_fee_quantity_params.rb | 86 + ...tion_update_fixed_fee_quantity_response.rb | 1444 ++ lib/orb/models/subscription_update_params.rb | 73 + .../subscription_update_trial_params.rb | 78 + .../subscription_update_trial_response.rb | 1438 ++ lib/orb/models/subscription_usage.rb | 352 + lib/orb/models/subscriptions.rb | 40 +- lib/orb/models/top_level_ping_params.rb | 18 + lib/orb/models/top_level_ping_response.rb | 22 +- lib/orb/models/trial_discount.rb | 86 + .../usage_update_by_external_id_response.rb | 11 - lib/orb/models/usage_update_response.rb | 11 - lib/orb/orb.rb | 264 - lib/orb/page.rb | 124 + lib/orb/pagination.rb | 34 - lib/orb/pooled_net_requester.rb | 122 +- lib/orb/request_options.rb | 115 + lib/orb/requester.rb | 13 - lib/orb/resources/alerts.rb | 259 + lib/orb/resources/coupons.rb | 124 + lib/orb/resources/coupons/coupons.rb | 73 - lib/orb/resources/coupons/subscriptions.rb | 60 +- lib/orb/resources/credit_notes.rb | 102 +- lib/orb/resources/customers.rb | 726 + .../customers/balance_transactions.rb | 146 +- lib/orb/resources/customers/costs.rb | 346 +- lib/orb/resources/customers/credits.rb | 99 + .../resources/customers/credits/credits.rb | 63 - lib/orb/resources/customers/credits/ledger.rb | 906 +- .../resources/customers/credits/top_ups.rb | 213 + lib/orb/resources/customers/customers.rb | 205 - lib/orb/resources/customers/usage.rb | 58 - lib/orb/resources/dimensional_price_groups.rb | 99 + .../external_dimensional_price_group_id.rb | 37 + lib/orb/resources/events.rb | 432 + lib/orb/resources/events/backfills.rb | 240 +- lib/orb/resources/events/events.rb | 81 - lib/orb/resources/events/volume.rb | 61 + lib/orb/resources/invoice_line_items.rb | 67 +- lib/orb/resources/invoices.rb | 414 +- lib/orb/resources/items.rb | 124 +- lib/orb/resources/metrics.rb | 171 +- lib/orb/resources/plans.rb | 165 + lib/orb/resources/plans/external_plan_id.rb | 99 +- lib/orb/resources/plans/plans.rb | 93 - lib/orb/resources/prices.rb | 263 + lib/orb/resources/prices/external_price_id.rb | 64 +- lib/orb/resources/prices/prices.rb | 445 - lib/orb/resources/subscriptions.rb | 1715 +- lib/orb/resources/top_level.rb | 35 +- lib/orb/util.rb | 462 +- lib/orb/version.rb | 5 + manifest.yaml | 12 + orb.gemspec | 19 + rbi/base_client.rbi | 6 - rbi/lib/orb/base_client.rbi | 146 + rbi/lib/orb/base_model.rbi | 436 + rbi/lib/orb/base_page.rbi | 33 + rbi/lib/orb/client.rbi | 82 + rbi/lib/orb/errors.rbi | 202 + rbi/lib/orb/extern.rbi | 10 + rbi/lib/orb/models/alert.rbi | 187 + .../alert_create_for_customer_params.rbi | 69 + ...rt_create_for_external_customer_params.rbi | 69 + .../alert_create_for_subscription_params.rbi | 69 + rbi/lib/orb/models/alert_disable_params.rbi | 21 + rbi/lib/orb/models/alert_enable_params.rbi | 21 + rbi/lib/orb/models/alert_list_params.rbi | 87 + rbi/lib/orb/models/alert_retrieve_params.rbi | 18 + rbi/lib/orb/models/alert_update_params.rbi | 44 + rbi/lib/orb/models/amount_discount.rbi | 50 + rbi/lib/orb/models/billable_metric.rbi | 62 + .../models/billing_cycle_relative_date.rbi | 15 + rbi/lib/orb/models/coupon.rbi | 76 + rbi/lib/orb/models/coupon_archive_params.rbi | 18 + rbi/lib/orb/models/coupon_create_params.rbi | 108 + rbi/lib/orb/models/coupon_fetch_params.rbi | 18 + rbi/lib/orb/models/coupon_list_params.rbi | 52 + .../coupons/subscription_list_params.rbi | 31 + rbi/lib/orb/models/credit_note.rbi | 451 + .../orb/models/credit_note_create_params.rbi | 71 + .../orb/models/credit_note_fetch_params.rbi | 18 + .../orb/models/credit_note_list_params.rbi | 29 + rbi/lib/orb/models/customer.rbi | 502 + rbi/lib/orb/models/customer_create_params.rbi | 541 + rbi/lib/orb/models/customer_delete_params.rbi | 18 + .../customer_fetch_by_external_id_params.rbi | 18 + rbi/lib/orb/models/customer_fetch_params.rbi | 18 + rbi/lib/orb/models/customer_list_params.rbi | 69 + ...gateway_by_external_customer_id_params.rbi | 18 + ...nc_payment_methods_from_gateway_params.rbi | 18 + .../customer_update_by_external_id_params.rbi | 546 + rbi/lib/orb/models/customer_update_params.rbi | 535 + .../balance_transaction_create_params.rbi | 48 + .../balance_transaction_create_response.rbi | 136 + .../balance_transaction_list_params.rbi | 71 + .../balance_transaction_list_response.rbi | 136 + .../cost_list_by_external_id_params.rbi | 67 + .../cost_list_by_external_id_response.rbi | 97 + .../orb/models/customers/cost_list_params.rbi | 67 + .../models/customers/cost_list_response.rbi | 97 + .../credit_list_by_external_id_params.rbi | 57 + .../credit_list_by_external_id_response.rbi | 77 + .../models/customers/credit_list_params.rbi | 57 + .../models/customers/credit_list_response.rbi | 77 + ...ger_create_entry_by_external_id_params.rbi | 167 + ...r_create_entry_by_external_id_response.rbi | 1193 ++ .../credits/ledger_create_entry_params.rbi | 165 + .../credits/ledger_create_entry_response.rbi | 1184 ++ .../ledger_list_by_external_id_params.rbi | 122 + .../ledger_list_by_external_id_response.rbi | 1190 ++ .../customers/credits/ledger_list_params.rbi | 122 + .../credits/ledger_list_response.rbi | 1160 ++ .../top_up_create_by_external_id_params.rbi | 127 + .../top_up_create_by_external_id_response.rbi | 125 + .../credits/top_up_create_params.rbi | 125 + .../credits/top_up_create_response.rbi | 123 + .../top_up_delete_by_external_id_params.rbi | 25 + .../credits/top_up_delete_params.rbi | 25 + .../top_up_list_by_external_id_params.rbi | 33 + .../top_up_list_by_external_id_response.rbi | 125 + .../customers/credits/top_up_list_params.rbi | 33 + .../credits/top_up_list_response.rbi | 123 + .../orb/models/dimensional_price_group.rbi | 59 + .../dimensional_price_group_create_params.rbi | 60 + .../dimensional_price_group_list_params.rbi | 29 + ...imensional_price_group_retrieve_params.rbi | 18 + .../orb/models/dimensional_price_groups.rbi | 31 + ...nsional_price_group_id_retrieve_params.rbi | 22 + rbi/lib/orb/models/discount.rbi | 66 + rbi/lib/orb/models/evaluate_price_group.rbi | 45 + rbi/lib/orb/models/event_deprecate_params.rbi | 18 + .../orb/models/event_deprecate_response.rbi | 18 + rbi/lib/orb/models/event_ingest_params.rbi | 100 + rbi/lib/orb/models/event_ingest_response.rbi | 63 + rbi/lib/orb/models/event_search_params.rbi | 39 + rbi/lib/orb/models/event_search_response.rbi | 78 + rbi/lib/orb/models/event_update_params.rbi | 61 + rbi/lib/orb/models/event_update_response.rbi | 18 + .../models/events/backfill_close_params.rbi | 20 + .../models/events/backfill_close_response.rbi | 96 + .../models/events/backfill_create_params.rbi | 77 + .../events/backfill_create_response.rbi | 96 + .../models/events/backfill_fetch_params.rbi | 20 + .../models/events/backfill_fetch_response.rbi | 96 + .../models/events/backfill_list_params.rbi | 31 + .../models/events/backfill_list_response.rbi | 96 + .../models/events/backfill_revert_params.rbi | 20 + .../events/backfill_revert_response.rbi | 96 + rbi/lib/orb/models/events/event_volumes.rbi | 41 + .../orb/models/events/volume_list_params.rbi | 52 + rbi/lib/orb/models/invoice.rbi | 1662 ++ rbi/lib/orb/models/invoice_create_params.rbi | 166 + rbi/lib/orb/models/invoice_fetch_params.rbi | 18 + .../models/invoice_fetch_upcoming_params.rbi | 21 + .../invoice_fetch_upcoming_response.rbi | 1712 ++ rbi/lib/orb/models/invoice_issue_params.rbi | 24 + rbi/lib/orb/models/invoice_level_discount.rbi | 24 + .../invoice_line_item_create_params.rbi | 58 + .../invoice_line_item_create_response.rbi | 790 + rbi/lib/orb/models/invoice_list_params.rbi | 170 + .../orb/models/invoice_mark_paid_params.rbi | 39 + rbi/lib/orb/models/invoice_pay_params.rbi | 18 + rbi/lib/orb/models/invoice_update_params.rbi | 28 + rbi/lib/orb/models/invoice_void_params.rbi | 18 + rbi/lib/orb/models/item.rbi | 72 + rbi/lib/orb/models/item_create_params.rbi | 21 + rbi/lib/orb/models/item_fetch_params.rbi | 18 + rbi/lib/orb/models/item_list_params.rbi | 29 + rbi/lib/orb/models/item_update_params.rbi | 69 + rbi/lib/orb/models/metric_create_params.rbi | 53 + rbi/lib/orb/models/metric_fetch_params.rbi | 18 + rbi/lib/orb/models/metric_list_params.rbi | 69 + rbi/lib/orb/models/metric_update_params.rbi | 28 + rbi/lib/orb/models/pagination_metadata.rbi | 21 + rbi/lib/orb/models/percentage_discount.rbi | 50 + rbi/lib/orb/models/plan.rbi | 732 + rbi/lib/orb/models/plan_create_params.rbi | 4784 +++++ rbi/lib/orb/models/plan_fetch_params.rbi | 18 + rbi/lib/orb/models/plan_list_params.rbi | 89 + rbi/lib/orb/models/plan_update_params.rbi | 35 + .../plans/external_plan_id_fetch_params.rbi | 20 + .../plans/external_plan_id_update_params.rbi | 37 + rbi/lib/orb/models/price.rbi | 9356 ++++++++++ rbi/lib/orb/models/price_create_params.rbi | 641 + rbi/lib/orb/models/price_evaluate_params.rbi | 69 + .../orb/models/price_evaluate_response.rbi | 18 + rbi/lib/orb/models/price_fetch_params.rbi | 18 + rbi/lib/orb/models/price_list_params.rbi | 29 + rbi/lib/orb/models/price_update_params.rbi | 28 + .../prices/external_price_id_fetch_params.rbi | 20 + .../external_price_id_update_params.rbi | 30 + rbi/lib/orb/models/subscription.rbi | 1007 ++ .../orb/models/subscription_cancel_params.rbi | 43 + .../models/subscription_cancel_response.rbi | 1027 ++ .../orb/models/subscription_create_params.rbi | 8756 +++++++++ .../models/subscription_create_response.rbi | 1027 ++ .../subscription_fetch_costs_params.rbi | 65 + .../subscription_fetch_costs_response.rbi | 90 + .../orb/models/subscription_fetch_params.rbi | 18 + .../subscription_fetch_schedule_params.rbi | 69 + .../subscription_fetch_schedule_response.rbi | 64 + .../subscription_fetch_usage_params.rbi | 109 + .../orb/models/subscription_list_params.rbi | 98 + .../subscription_price_intervals_params.rbi | 6248 +++++++ .../subscription_price_intervals_response.rbi | 1033 ++ ...bscription_schedule_plan_change_params.rbi | 8798 +++++++++ ...cription_schedule_plan_change_response.rbi | 1035 ++ .../subscription_trigger_phase_params.rbi | 21 + .../subscription_trigger_phase_response.rbi | 1028 ++ ...ription_unschedule_cancellation_params.rbi | 18 + ...ption_unschedule_cancellation_response.rbi | 1041 ++ ...dule_fixed_fee_quantity_updates_params.rbi | 21 + ...le_fixed_fee_quantity_updates_response.rbi | 1059 ++ ...unschedule_pending_plan_changes_params.rbi | 18 + ...schedule_pending_plan_changes_response.rbi | 1049 ++ ...ption_update_fixed_fee_quantity_params.rbi | 57 + ...ion_update_fixed_fee_quantity_response.rbi | 1041 ++ .../orb/models/subscription_update_params.rbi | 60 + .../subscription_update_trial_params.rbi | 59 + .../subscription_update_trial_response.rbi | 1028 ++ rbi/lib/orb/models/subscription_usage.rbi | 246 + rbi/lib/orb/models/subscriptions.rbi | 28 + rbi/lib/orb/models/top_level_ping_params.rbi | 18 + .../orb/models/top_level_ping_response.rbi | 18 + rbi/lib/orb/models/trial_discount.rbi | 61 + rbi/lib/orb/page.rbi | 41 + rbi/lib/orb/request_options.rbi | 55 + rbi/lib/orb/resources/alerts.rbi | 107 + rbi/lib/orb/resources/coupons.rbi | 41 + .../orb/resources/coupons/subscriptions.rbi | 22 + rbi/lib/orb/resources/credit_notes.rbi | 34 + rbi/lib/orb/resources/customers.rbi | 187 + .../customers/balance_transactions.rbi | 46 + rbi/lib/orb/resources/customers/costs.rbi | 45 + rbi/lib/orb/resources/customers/credits.rbi | 50 + .../resources/customers/credits/ledger.rbi | 146 + .../resources/customers/credits/top_ups.rbi | 92 + .../resources/dimensional_price_groups.rbi | 49 + .../external_dimensional_price_group_id.rbi | 20 + rbi/lib/orb/resources/events.rbi | 66 + rbi/lib/orb/resources/events/backfills.rbi | 68 + rbi/lib/orb/resources/events/volume.rbi | 23 + rbi/lib/orb/resources/invoice_line_items.rbi | 23 + rbi/lib/orb/resources/invoices.rbi | 132 + rbi/lib/orb/resources/items.rbi | 35 + rbi/lib/orb/resources/metrics.rbi | 58 + rbi/lib/orb/resources/plans.rbi | 74 + .../orb/resources/plans/external_plan_id.rbi | 25 + rbi/lib/orb/resources/prices.rbi | 150 + .../resources/prices/external_price_id.rbi | 29 + rbi/lib/orb/resources/subscriptions.rbi | 361 + rbi/lib/orb/resources/top_level.rbi | 13 + rbi/lib/orb/util.rbi | 103 + rbi/lib/orb/version.rbi | 5 + release-please-config.json | 64 + scripts/bootstrap | 16 + scripts/format | 8 + scripts/lint | 7 + scripts/mock | 41 + scripts/test | 56 + sig/orb/base_client.rbs | 100 + sig/orb/base_model.rbs | 241 + sig/orb/base_page.rbs | 20 + sig/orb/client.rbs | 53 + sig/orb/errors.rbs | 170 + sig/orb/extern.rbs | 5 + sig/orb/models/alert.rbs | 152 + .../alert_create_for_customer_params.rbs | 67 + ...rt_create_for_external_customer_params.rbs | 68 + .../alert_create_for_subscription_params.rbs | 68 + sig/orb/models/alert_disable_params.rbs | 19 + sig/orb/models/alert_enable_params.rbs | 19 + sig/orb/models/alert_list_params.rbs | 59 + sig/orb/models/alert_retrieve_params.rbs | 16 + sig/orb/models/alert_update_params.rbs | 37 + sig/orb/models/amount_discount.rbs | 40 + sig/orb/models/billable_metric.rbs | 50 + .../models/billing_cycle_relative_date.rbs | 12 + sig/orb/models/coupon.rbs | 51 + sig/orb/models/coupon_archive_params.rbs | 16 + sig/orb/models/coupon_create_params.rbs | 81 + sig/orb/models/coupon_fetch_params.rbs | 16 + sig/orb/models/coupon_list_params.rbs | 39 + .../coupons/subscription_list_params.rbs | 32 + sig/orb/models/credit_note.rbs | 361 + sig/orb/models/credit_note_create_params.rbs | 64 + sig/orb/models/credit_note_fetch_params.rbs | 16 + sig/orb/models/credit_note_list_params.rbs | 27 + sig/orb/models/customer.rbs | 600 + sig/orb/models/customer_create_params.rbs | 632 + sig/orb/models/customer_delete_params.rbs | 16 + .../customer_fetch_by_external_id_params.rbs | 19 + sig/orb/models/customer_fetch_params.rbs | 16 + sig/orb/models/customer_list_params.rbs | 47 + ...gateway_by_external_customer_id_params.rbs | 20 + ...nc_payment_methods_from_gateway_params.rbs | 20 + .../customer_update_by_external_id_params.rbs | 632 + sig/orb/models/customer_update_params.rbs | 628 + .../balance_transaction_create_params.rbs | 47 + .../balance_transaction_create_response.rbs | 123 + .../balance_transaction_list_params.rbs | 52 + .../balance_transaction_list_response.rbs | 123 + .../cost_list_by_external_id_params.rbs | 51 + .../cost_list_by_external_id_response.rbs | 93 + sig/orb/models/customers/cost_list_params.rbs | 50 + .../models/customers/cost_list_response.rbs | 88 + .../credit_list_by_external_id_params.rbs | 46 + .../credit_list_by_external_id_response.rbs | 58 + .../models/customers/credit_list_params.rbs | 45 + .../models/customers/credit_list_response.rbs | 57 + ...ger_create_entry_by_external_id_params.rbs | 126 + ...r_create_entry_by_external_id_response.rbs | 882 + .../credits/ledger_create_entry_params.rbs | 126 + .../credits/ledger_create_entry_response.rbs | 882 + .../ledger_list_by_external_id_params.rbs | 100 + .../ledger_list_by_external_id_response.rbs | 882 + .../customers/credits/ledger_list_params.rbs | 100 + .../credits/ledger_list_response.rbs | 882 + .../top_up_create_by_external_id_params.rbs | 99 + .../top_up_create_by_external_id_response.rbs | 98 + .../credits/top_up_create_params.rbs | 99 + .../credits/top_up_create_response.rbs | 98 + .../top_up_delete_by_external_id_params.rbs | 29 + .../credits/top_up_delete_params.rbs | 26 + .../top_up_list_by_external_id_params.rbs | 34 + .../top_up_list_by_external_id_response.rbs | 98 + .../customers/credits/top_up_list_params.rbs | 34 + .../credits/top_up_list_response.rbs | 98 + sig/orb/models/dimensional_price_group.rbs | 40 + .../dimensional_price_group_create_params.rbs | 44 + .../dimensional_price_group_list_params.rbs | 30 + ...imensional_price_group_retrieve_params.rbs | 20 + sig/orb/models/dimensional_price_groups.rbs | 26 + ...nsional_price_group_id_retrieve_params.rbs | 22 + sig/orb/models/discount.rbs | 44 + sig/orb/models/evaluate_price_group.rbs | 34 + sig/orb/models/event_deprecate_params.rbs | 16 + sig/orb/models/event_deprecate_response.rbs | 15 + sig/orb/models/event_ingest_params.rbs | 74 + sig/orb/models/event_ingest_response.rbs | 58 + sig/orb/models/event_search_params.rbs | 29 + sig/orb/models/event_search_response.rbs | 59 + sig/orb/models/event_update_params.rbs | 41 + sig/orb/models/event_update_response.rbs | 15 + .../models/events/backfill_close_params.rbs | 20 + .../models/events/backfill_close_response.rbs | 71 + .../models/events/backfill_create_params.rbs | 55 + .../events/backfill_create_response.rbs | 71 + .../models/events/backfill_fetch_params.rbs | 20 + .../models/events/backfill_fetch_response.rbs | 71 + .../models/events/backfill_list_params.rbs | 31 + .../models/events/backfill_list_response.rbs | 71 + .../models/events/backfill_revert_params.rbs | 20 + .../events/backfill_revert_response.rbs | 71 + sig/orb/models/events/event_volumes.rbs | 40 + sig/orb/models/events/volume_list_params.rbs | 45 + sig/orb/models/invoice.rbs | 1522 ++ sig/orb/models/invoice_create_params.rbs | 129 + sig/orb/models/invoice_fetch_params.rbs | 16 + .../models/invoice_fetch_upcoming_params.rbs | 21 + .../invoice_fetch_upcoming_response.rbs | 1550 ++ sig/orb/models/invoice_issue_params.rbs | 20 + sig/orb/models/invoice_level_discount.rbs | 12 + .../invoice_line_item_create_params.rbs | 47 + .../invoice_line_item_create_response.rbs | 612 + sig/orb/models/invoice_list_params.rbs | 120 + sig/orb/models/invoice_mark_paid_params.rbs | 29 + sig/orb/models/invoice_pay_params.rbs | 16 + sig/orb/models/invoice_update_params.rbs | 22 + sig/orb/models/invoice_void_params.rbs | 16 + sig/orb/models/item.rbs | 76 + sig/orb/models/item_create_params.rbs | 18 + sig/orb/models/item_fetch_params.rbs | 16 + sig/orb/models/item_list_params.rbs | 27 + sig/orb/models/item_update_params.rbs | 74 + sig/orb/models/metric_create_params.rbs | 41 + sig/orb/models/metric_fetch_params.rbs | 16 + sig/orb/models/metric_list_params.rbs | 47 + sig/orb/models/metric_update_params.rbs | 22 + sig/orb/models/pagination_metadata.rbs | 17 + sig/orb/models/percentage_discount.rbs | 40 + sig/orb/models/plan.rbs | 558 + sig/orb/models/plan_create_params.rbs | 4111 +++++ sig/orb/models/plan_fetch_params.rbs | 16 + sig/orb/models/plan_list_params.rbs | 63 + sig/orb/models/plan_update_params.rbs | 26 + .../plans/external_plan_id_fetch_params.rbs | 21 + .../plans/external_plan_id_update_params.rbs | 31 + sig/orb/models/price.rbs | 8830 +++++++++ sig/orb/models/price_create_params.rbs | 578 + sig/orb/models/price_evaluate_params.rbs | 47 + sig/orb/models/price_evaluate_response.rbs | 16 + sig/orb/models/price_fetch_params.rbs | 16 + sig/orb/models/price_list_params.rbs | 27 + sig/orb/models/price_update_params.rbs | 22 + .../prices/external_price_id_fetch_params.rbs | 21 + .../external_price_id_update_params.rbs | 27 + sig/orb/models/subscription.rbs | 743 + sig/orb/models/subscription_cancel_params.rbs | 42 + .../models/subscription_cancel_response.rbs | 750 + sig/orb/models/subscription_create_params.rbs | 7365 ++++++++ .../models/subscription_create_response.rbs | 750 + .../subscription_fetch_costs_params.rbs | 48 + .../subscription_fetch_costs_response.rbs | 86 + sig/orb/models/subscription_fetch_params.rbs | 18 + .../subscription_fetch_schedule_params.rbs | 49 + .../subscription_fetch_schedule_response.rbs | 54 + .../subscription_fetch_usage_params.rbs | 80 + sig/orb/models/subscription_list_params.rbs | 69 + .../subscription_price_intervals_params.rbs | 5303 ++++++ .../subscription_price_intervals_response.rbs | 751 + ...bscription_schedule_plan_change_params.rbs | 7356 ++++++++ ...cription_schedule_plan_change_response.rbs | 751 + .../subscription_trigger_phase_params.rbs | 21 + .../subscription_trigger_phase_response.rbs | 751 + ...ription_unschedule_cancellation_params.rbs | 20 + ...ption_unschedule_cancellation_response.rbs | 751 + ...dule_fixed_fee_quantity_updates_params.rbs | 22 + ...le_fixed_fee_quantity_updates_response.rbs | 751 + ...unschedule_pending_plan_changes_params.rbs | 20 + ...schedule_pending_plan_changes_response.rbs | 751 + ...ption_update_fixed_fee_quantity_params.rbs | 54 + ...ion_update_fixed_fee_quantity_response.rbs | 751 + sig/orb/models/subscription_update_params.rbs | 43 + .../subscription_update_trial_params.rbs | 49 + .../subscription_update_trial_response.rbs | 750 + sig/orb/models/subscription_usage.rbs | 232 + sig/orb/models/subscriptions.rbs | 24 + sig/orb/models/top_level_ping_params.rbs | 16 + sig/orb/models/top_level_ping_response.rbs | 15 + sig/orb/models/trial_discount.rbs | 44 + sig/orb/page.rbs | 29 + sig/orb/request_options.rbs | 40 + sig/orb/resources/alerts.rbs | 108 + sig/orb/resources/coupons.rbs | 53 + sig/orb/resources/coupons/subscriptions.rbs | 22 + sig/orb/resources/credit_notes.rbs | 38 + sig/orb/resources/customers.rbs | 152 + .../customers/balance_transactions.rbs | 40 + sig/orb/resources/customers/costs.rbs | 38 + sig/orb/resources/customers/credits.rbs | 42 + .../resources/customers/credits/ledger.rbs | 99 + .../resources/customers/credits/top_ups.rbs | 97 + .../resources/dimensional_price_groups.rbs | 45 + .../external_dimensional_price_group_id.rbs | 20 + sig/orb/resources/events.rbs | 58 + sig/orb/resources/events/backfills.rbs | 65 + sig/orb/resources/events/volume.rbs | 21 + sig/orb/resources/invoice_line_items.rbs | 21 + sig/orb/resources/invoices.rbs | 126 + sig/orb/resources/items.rbs | 48 + sig/orb/resources/metrics.rbs | 55 + sig/orb/resources/plans.rbs | 62 + sig/orb/resources/plans/external_plan_id.rbs | 33 + sig/orb/resources/prices.rbs | 105 + .../resources/prices/external_price_id.rbs | 32 + sig/orb/resources/subscriptions.rbs | 274 + sig/orb/resources/top_level.rbs | 15 + sig/orb/util.rbs | 81 + sig/orb/version.rbs | 3 + test/orb/base_model_test.rb | 341 + test/orb/client_test.rb | 340 + test/orb/coupons_test.rb | 28 - test/orb/credit_notes_test.rb | 20 - test/orb/customers_test.rb | 40 - test/orb/events_test.rb | 31 - test/orb/invoice_line_items_test.rb | 16 - test/orb/invoices_test.rb | 41 - test/orb/items_test.rb | 24 - test/orb/metrics_test.rb | 25 - test/orb/plans_test.rb | 28 - test/orb/prices_test.rb | 23 - test/orb/resources/alerts_test.rb | 91 + .../resources/coupons/subscriptions_test.rb | 25 + test/orb/resources/coupons_test.rb | 52 + test/orb/resources/credit_notes_test.rb | 48 + .../customers/balance_transactions_test.rb | 33 + test/orb/resources/customers/costs_test.rb | 28 + .../customers/credits/ledger_test.rb | 64 + .../customers/credits/top_ups_test.rb | 87 + test/orb/resources/customers/credits_test.rb | 38 + test/orb/resources/customers_test.rb | 89 + ...xternal_dimensional_price_group_id_test.rb | 22 + .../dimensional_price_groups_test.rb | 45 + test/orb/resources/events/backfills_test.rb | 60 + test/orb/resources/events/volume_test.rb | 20 + test/orb/resources/events_test.rb | 58 + test/orb/resources/invoice_line_items_test.rb | 27 + test/orb/resources/invoices_test.rb | 104 + test/orb/resources/items_test.rb | 49 + test/orb/resources/metrics_test.rb | 54 + .../resources/plans/external_plan_id_test.rb | 28 + test/orb/resources/plans_test.rb | 61 + .../prices/external_price_id_test.rb | 28 + test/orb/resources/prices_test.rb | 68 + test/orb/resources/shared_test.rb | 12 + test/orb/resources/subscriptions_test.rb | 161 + test/orb/resources/top_level_test.rb | 20 + test/orb/subscriptions_test.rb | 61 - test/orb/test_helper.rb | 43 + test/orb/test_namespaces.rb | 30 + test/orb/top_level_test.rb | 16 - test/orb/util_test.rb | 211 + 699 files changed, 253363 insertions(+), 5283 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish-gem.yml create mode 100644 .github/workflows/release-doctor.yml create mode 100644 .gitignore delete mode 100644 .gitkeep create mode 100644 .release-please-manifest.json create mode 100644 .rubocop.yml create mode 100644 .yardopts create mode 100644 SECURITY.md create mode 100644 Steepfile create mode 100644 lib/orb.rb delete mode 100644 lib/orb/auth.rb create mode 100644 lib/orb/base_model.rb create mode 100644 lib/orb/base_page.rb delete mode 100644 lib/orb/base_pagination.rb create mode 100644 lib/orb/client.rb create mode 100644 lib/orb/errors.rb create mode 100644 lib/orb/extern.rb delete mode 100644 lib/orb/model.rb create mode 100644 lib/orb/models/alert.rb create mode 100644 lib/orb/models/alert_create_for_customer_params.rb create mode 100644 lib/orb/models/alert_create_for_external_customer_params.rb create mode 100644 lib/orb/models/alert_create_for_subscription_params.rb create mode 100644 lib/orb/models/alert_disable_params.rb create mode 100644 lib/orb/models/alert_enable_params.rb create mode 100644 lib/orb/models/alert_list_params.rb create mode 100644 lib/orb/models/alert_retrieve_params.rb create mode 100644 lib/orb/models/alert_update_params.rb create mode 100644 lib/orb/models/amount_discount.rb delete mode 100644 lib/orb/models/backfill_close_response.rb delete mode 100644 lib/orb/models/backfill_create_response.rb delete mode 100644 lib/orb/models/backfill_fetch_response.rb delete mode 100644 lib/orb/models/backfill_list_response.rb delete mode 100644 lib/orb/models/backfill_revert_response.rb delete mode 100644 lib/orb/models/balance_transaction_create_response.rb delete mode 100644 lib/orb/models/balance_transaction_list_response.rb create mode 100644 lib/orb/models/billable_metric.rb create mode 100644 lib/orb/models/billing_cycle_relative_date.rb delete mode 100644 lib/orb/models/cost_list_by_external_id_response.rb delete mode 100644 lib/orb/models/cost_list_response.rb create mode 100644 lib/orb/models/coupon_archive_params.rb create mode 100644 lib/orb/models/coupon_create_params.rb create mode 100644 lib/orb/models/coupon_fetch_params.rb create mode 100644 lib/orb/models/coupon_list_params.rb create mode 100644 lib/orb/models/coupons/subscription_list_params.rb delete mode 100644 lib/orb/models/credit_list_by_external_id_response.rb delete mode 100644 lib/orb/models/credit_list_response.rb create mode 100644 lib/orb/models/credit_note_create_params.rb create mode 100644 lib/orb/models/credit_note_fetch_params.rb create mode 100644 lib/orb/models/credit_note_list_params.rb create mode 100644 lib/orb/models/customer_create_params.rb create mode 100644 lib/orb/models/customer_delete_params.rb create mode 100644 lib/orb/models/customer_fetch_by_external_id_params.rb create mode 100644 lib/orb/models/customer_fetch_params.rb create mode 100644 lib/orb/models/customer_list_params.rb create mode 100644 lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rb create mode 100644 lib/orb/models/customer_sync_payment_methods_from_gateway_params.rb create mode 100644 lib/orb/models/customer_update_by_external_id_params.rb create mode 100644 lib/orb/models/customer_update_params.rb create mode 100644 lib/orb/models/customers/balance_transaction_create_params.rb create mode 100644 lib/orb/models/customers/balance_transaction_create_response.rb create mode 100644 lib/orb/models/customers/balance_transaction_list_params.rb create mode 100644 lib/orb/models/customers/balance_transaction_list_response.rb create mode 100644 lib/orb/models/customers/cost_list_by_external_id_params.rb create mode 100644 lib/orb/models/customers/cost_list_by_external_id_response.rb create mode 100644 lib/orb/models/customers/cost_list_params.rb create mode 100644 lib/orb/models/customers/cost_list_response.rb create mode 100644 lib/orb/models/customers/credit_list_by_external_id_params.rb create mode 100644 lib/orb/models/customers/credit_list_by_external_id_response.rb create mode 100644 lib/orb/models/customers/credit_list_params.rb create mode 100644 lib/orb/models/customers/credit_list_response.rb create mode 100644 lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb create mode 100644 lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rb create mode 100644 lib/orb/models/customers/credits/ledger_create_entry_params.rb create mode 100644 lib/orb/models/customers/credits/ledger_create_entry_response.rb create mode 100644 lib/orb/models/customers/credits/ledger_list_by_external_id_params.rb create mode 100644 lib/orb/models/customers/credits/ledger_list_by_external_id_response.rb create mode 100644 lib/orb/models/customers/credits/ledger_list_params.rb create mode 100644 lib/orb/models/customers/credits/ledger_list_response.rb create mode 100644 lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb create mode 100644 lib/orb/models/customers/credits/top_up_create_by_external_id_response.rb create mode 100644 lib/orb/models/customers/credits/top_up_create_params.rb create mode 100644 lib/orb/models/customers/credits/top_up_create_response.rb create mode 100644 lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rb create mode 100644 lib/orb/models/customers/credits/top_up_delete_params.rb create mode 100644 lib/orb/models/customers/credits/top_up_list_by_external_id_params.rb create mode 100644 lib/orb/models/customers/credits/top_up_list_by_external_id_response.rb create mode 100644 lib/orb/models/customers/credits/top_up_list_params.rb create mode 100644 lib/orb/models/customers/credits/top_up_list_response.rb create mode 100644 lib/orb/models/dimensional_price_group.rb create mode 100644 lib/orb/models/dimensional_price_group_create_params.rb create mode 100644 lib/orb/models/dimensional_price_group_list_params.rb create mode 100644 lib/orb/models/dimensional_price_group_retrieve_params.rb create mode 100644 lib/orb/models/dimensional_price_groups.rb create mode 100644 lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rb create mode 100644 lib/orb/models/discount.rb create mode 100644 lib/orb/models/evaluate_price_group.rb create mode 100644 lib/orb/models/event_deprecate_params.rb create mode 100644 lib/orb/models/event_ingest_params.rb create mode 100644 lib/orb/models/event_search_params.rb create mode 100644 lib/orb/models/event_update_params.rb create mode 100644 lib/orb/models/events/backfill_close_params.rb create mode 100644 lib/orb/models/events/backfill_close_response.rb create mode 100644 lib/orb/models/events/backfill_create_params.rb create mode 100644 lib/orb/models/events/backfill_create_response.rb create mode 100644 lib/orb/models/events/backfill_fetch_params.rb create mode 100644 lib/orb/models/events/backfill_fetch_response.rb create mode 100644 lib/orb/models/events/backfill_list_params.rb create mode 100644 lib/orb/models/events/backfill_list_response.rb create mode 100644 lib/orb/models/events/backfill_revert_params.rb create mode 100644 lib/orb/models/events/backfill_revert_response.rb create mode 100644 lib/orb/models/events/event_volumes.rb create mode 100644 lib/orb/models/events/volume_list_params.rb create mode 100644 lib/orb/models/invoice_create_params.rb create mode 100644 lib/orb/models/invoice_fetch_params.rb create mode 100644 lib/orb/models/invoice_fetch_upcoming_params.rb create mode 100644 lib/orb/models/invoice_issue_params.rb create mode 100644 lib/orb/models/invoice_level_discount.rb create mode 100644 lib/orb/models/invoice_line_item_create_params.rb create mode 100644 lib/orb/models/invoice_list_params.rb create mode 100644 lib/orb/models/invoice_mark_paid_params.rb create mode 100644 lib/orb/models/invoice_pay_params.rb create mode 100644 lib/orb/models/invoice_update_params.rb create mode 100644 lib/orb/models/invoice_void_params.rb create mode 100644 lib/orb/models/item_create_params.rb create mode 100644 lib/orb/models/item_fetch_params.rb create mode 100644 lib/orb/models/item_list_params.rb create mode 100644 lib/orb/models/item_update_params.rb create mode 100644 lib/orb/models/metric_create_params.rb delete mode 100644 lib/orb/models/metric_create_response.rb create mode 100644 lib/orb/models/metric_fetch_params.rb delete mode 100644 lib/orb/models/metric_fetch_response.rb create mode 100644 lib/orb/models/metric_list_params.rb delete mode 100644 lib/orb/models/metric_list_response.rb create mode 100644 lib/orb/models/metric_update_params.rb create mode 100644 lib/orb/models/pagination_metadata.rb create mode 100644 lib/orb/models/percentage_discount.rb create mode 100644 lib/orb/models/plan_create_params.rb create mode 100644 lib/orb/models/plan_fetch_params.rb create mode 100644 lib/orb/models/plan_list_params.rb create mode 100644 lib/orb/models/plan_update_params.rb create mode 100644 lib/orb/models/plans/external_plan_id_fetch_params.rb create mode 100644 lib/orb/models/plans/external_plan_id_update_params.rb create mode 100644 lib/orb/models/price.rb create mode 100644 lib/orb/models/price_create_params.rb create mode 100644 lib/orb/models/price_evaluate_params.rb create mode 100644 lib/orb/models/price_evaluate_response.rb create mode 100644 lib/orb/models/price_fetch_params.rb create mode 100644 lib/orb/models/price_list_params.rb create mode 100644 lib/orb/models/price_update_params.rb create mode 100644 lib/orb/models/prices/external_price_id_fetch_params.rb create mode 100644 lib/orb/models/prices/external_price_id_update_params.rb create mode 100644 lib/orb/models/subscription_cancel_params.rb create mode 100644 lib/orb/models/subscription_cancel_response.rb create mode 100644 lib/orb/models/subscription_create_params.rb create mode 100644 lib/orb/models/subscription_create_response.rb create mode 100644 lib/orb/models/subscription_fetch_costs_params.rb create mode 100644 lib/orb/models/subscription_fetch_params.rb create mode 100644 lib/orb/models/subscription_fetch_schedule_params.rb create mode 100644 lib/orb/models/subscription_fetch_usage_params.rb create mode 100644 lib/orb/models/subscription_list_params.rb create mode 100644 lib/orb/models/subscription_price_intervals_params.rb create mode 100644 lib/orb/models/subscription_price_intervals_response.rb create mode 100644 lib/orb/models/subscription_schedule_plan_change_params.rb create mode 100644 lib/orb/models/subscription_schedule_plan_change_response.rb create mode 100644 lib/orb/models/subscription_trigger_phase_params.rb create mode 100644 lib/orb/models/subscription_trigger_phase_response.rb create mode 100644 lib/orb/models/subscription_unschedule_cancellation_params.rb create mode 100644 lib/orb/models/subscription_unschedule_cancellation_response.rb create mode 100644 lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rb create mode 100644 lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rb create mode 100644 lib/orb/models/subscription_unschedule_pending_plan_changes_params.rb create mode 100644 lib/orb/models/subscription_unschedule_pending_plan_changes_response.rb create mode 100644 lib/orb/models/subscription_update_fixed_fee_quantity_params.rb create mode 100644 lib/orb/models/subscription_update_fixed_fee_quantity_response.rb create mode 100644 lib/orb/models/subscription_update_params.rb create mode 100644 lib/orb/models/subscription_update_trial_params.rb create mode 100644 lib/orb/models/subscription_update_trial_response.rb create mode 100644 lib/orb/models/subscription_usage.rb create mode 100644 lib/orb/models/top_level_ping_params.rb create mode 100644 lib/orb/models/trial_discount.rb delete mode 100644 lib/orb/models/usage_update_by_external_id_response.rb delete mode 100644 lib/orb/models/usage_update_response.rb delete mode 100644 lib/orb/orb.rb create mode 100644 lib/orb/page.rb delete mode 100644 lib/orb/pagination.rb create mode 100644 lib/orb/request_options.rb delete mode 100644 lib/orb/requester.rb create mode 100644 lib/orb/resources/alerts.rb create mode 100644 lib/orb/resources/coupons.rb delete mode 100644 lib/orb/resources/coupons/coupons.rb create mode 100644 lib/orb/resources/customers.rb create mode 100644 lib/orb/resources/customers/credits.rb delete mode 100644 lib/orb/resources/customers/credits/credits.rb create mode 100644 lib/orb/resources/customers/credits/top_ups.rb delete mode 100644 lib/orb/resources/customers/customers.rb delete mode 100644 lib/orb/resources/customers/usage.rb create mode 100644 lib/orb/resources/dimensional_price_groups.rb create mode 100644 lib/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rb create mode 100644 lib/orb/resources/events.rb delete mode 100644 lib/orb/resources/events/events.rb create mode 100644 lib/orb/resources/events/volume.rb create mode 100644 lib/orb/resources/plans.rb delete mode 100644 lib/orb/resources/plans/plans.rb create mode 100644 lib/orb/resources/prices.rb delete mode 100644 lib/orb/resources/prices/prices.rb create mode 100644 lib/orb/version.rb create mode 100644 manifest.yaml create mode 100644 orb.gemspec delete mode 100644 rbi/base_client.rbi create mode 100644 rbi/lib/orb/base_client.rbi create mode 100644 rbi/lib/orb/base_model.rbi create mode 100644 rbi/lib/orb/base_page.rbi create mode 100644 rbi/lib/orb/client.rbi create mode 100644 rbi/lib/orb/errors.rbi create mode 100644 rbi/lib/orb/extern.rbi create mode 100644 rbi/lib/orb/models/alert.rbi create mode 100644 rbi/lib/orb/models/alert_create_for_customer_params.rbi create mode 100644 rbi/lib/orb/models/alert_create_for_external_customer_params.rbi create mode 100644 rbi/lib/orb/models/alert_create_for_subscription_params.rbi create mode 100644 rbi/lib/orb/models/alert_disable_params.rbi create mode 100644 rbi/lib/orb/models/alert_enable_params.rbi create mode 100644 rbi/lib/orb/models/alert_list_params.rbi create mode 100644 rbi/lib/orb/models/alert_retrieve_params.rbi create mode 100644 rbi/lib/orb/models/alert_update_params.rbi create mode 100644 rbi/lib/orb/models/amount_discount.rbi create mode 100644 rbi/lib/orb/models/billable_metric.rbi create mode 100644 rbi/lib/orb/models/billing_cycle_relative_date.rbi create mode 100644 rbi/lib/orb/models/coupon.rbi create mode 100644 rbi/lib/orb/models/coupon_archive_params.rbi create mode 100644 rbi/lib/orb/models/coupon_create_params.rbi create mode 100644 rbi/lib/orb/models/coupon_fetch_params.rbi create mode 100644 rbi/lib/orb/models/coupon_list_params.rbi create mode 100644 rbi/lib/orb/models/coupons/subscription_list_params.rbi create mode 100644 rbi/lib/orb/models/credit_note.rbi create mode 100644 rbi/lib/orb/models/credit_note_create_params.rbi create mode 100644 rbi/lib/orb/models/credit_note_fetch_params.rbi create mode 100644 rbi/lib/orb/models/credit_note_list_params.rbi create mode 100644 rbi/lib/orb/models/customer.rbi create mode 100644 rbi/lib/orb/models/customer_create_params.rbi create mode 100644 rbi/lib/orb/models/customer_delete_params.rbi create mode 100644 rbi/lib/orb/models/customer_fetch_by_external_id_params.rbi create mode 100644 rbi/lib/orb/models/customer_fetch_params.rbi create mode 100644 rbi/lib/orb/models/customer_list_params.rbi create mode 100644 rbi/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbi create mode 100644 rbi/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rbi create mode 100644 rbi/lib/orb/models/customer_update_by_external_id_params.rbi create mode 100644 rbi/lib/orb/models/customer_update_params.rbi create mode 100644 rbi/lib/orb/models/customers/balance_transaction_create_params.rbi create mode 100644 rbi/lib/orb/models/customers/balance_transaction_create_response.rbi create mode 100644 rbi/lib/orb/models/customers/balance_transaction_list_params.rbi create mode 100644 rbi/lib/orb/models/customers/balance_transaction_list_response.rbi create mode 100644 rbi/lib/orb/models/customers/cost_list_by_external_id_params.rbi create mode 100644 rbi/lib/orb/models/customers/cost_list_by_external_id_response.rbi create mode 100644 rbi/lib/orb/models/customers/cost_list_params.rbi create mode 100644 rbi/lib/orb/models/customers/cost_list_response.rbi create mode 100644 rbi/lib/orb/models/customers/credit_list_by_external_id_params.rbi create mode 100644 rbi/lib/orb/models/customers/credit_list_by_external_id_response.rbi create mode 100644 rbi/lib/orb/models/customers/credit_list_params.rbi create mode 100644 rbi/lib/orb/models/customers/credit_list_response.rbi create mode 100644 rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi create mode 100644 rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbi create mode 100644 rbi/lib/orb/models/customers/credits/ledger_create_entry_params.rbi create mode 100644 rbi/lib/orb/models/customers/credits/ledger_create_entry_response.rbi create mode 100644 rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rbi create mode 100644 rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rbi create mode 100644 rbi/lib/orb/models/customers/credits/ledger_list_params.rbi create mode 100644 rbi/lib/orb/models/customers/credits/ledger_list_response.rbi create mode 100644 rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rbi create mode 100644 rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rbi create mode 100644 rbi/lib/orb/models/customers/credits/top_up_create_params.rbi create mode 100644 rbi/lib/orb/models/customers/credits/top_up_create_response.rbi create mode 100644 rbi/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rbi create mode 100644 rbi/lib/orb/models/customers/credits/top_up_delete_params.rbi create mode 100644 rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rbi create mode 100644 rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rbi create mode 100644 rbi/lib/orb/models/customers/credits/top_up_list_params.rbi create mode 100644 rbi/lib/orb/models/customers/credits/top_up_list_response.rbi create mode 100644 rbi/lib/orb/models/dimensional_price_group.rbi create mode 100644 rbi/lib/orb/models/dimensional_price_group_create_params.rbi create mode 100644 rbi/lib/orb/models/dimensional_price_group_list_params.rbi create mode 100644 rbi/lib/orb/models/dimensional_price_group_retrieve_params.rbi create mode 100644 rbi/lib/orb/models/dimensional_price_groups.rbi create mode 100644 rbi/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbi create mode 100644 rbi/lib/orb/models/discount.rbi create mode 100644 rbi/lib/orb/models/evaluate_price_group.rbi create mode 100644 rbi/lib/orb/models/event_deprecate_params.rbi create mode 100644 rbi/lib/orb/models/event_deprecate_response.rbi create mode 100644 rbi/lib/orb/models/event_ingest_params.rbi create mode 100644 rbi/lib/orb/models/event_ingest_response.rbi create mode 100644 rbi/lib/orb/models/event_search_params.rbi create mode 100644 rbi/lib/orb/models/event_search_response.rbi create mode 100644 rbi/lib/orb/models/event_update_params.rbi create mode 100644 rbi/lib/orb/models/event_update_response.rbi create mode 100644 rbi/lib/orb/models/events/backfill_close_params.rbi create mode 100644 rbi/lib/orb/models/events/backfill_close_response.rbi create mode 100644 rbi/lib/orb/models/events/backfill_create_params.rbi create mode 100644 rbi/lib/orb/models/events/backfill_create_response.rbi create mode 100644 rbi/lib/orb/models/events/backfill_fetch_params.rbi create mode 100644 rbi/lib/orb/models/events/backfill_fetch_response.rbi create mode 100644 rbi/lib/orb/models/events/backfill_list_params.rbi create mode 100644 rbi/lib/orb/models/events/backfill_list_response.rbi create mode 100644 rbi/lib/orb/models/events/backfill_revert_params.rbi create mode 100644 rbi/lib/orb/models/events/backfill_revert_response.rbi create mode 100644 rbi/lib/orb/models/events/event_volumes.rbi create mode 100644 rbi/lib/orb/models/events/volume_list_params.rbi create mode 100644 rbi/lib/orb/models/invoice.rbi create mode 100644 rbi/lib/orb/models/invoice_create_params.rbi create mode 100644 rbi/lib/orb/models/invoice_fetch_params.rbi create mode 100644 rbi/lib/orb/models/invoice_fetch_upcoming_params.rbi create mode 100644 rbi/lib/orb/models/invoice_fetch_upcoming_response.rbi create mode 100644 rbi/lib/orb/models/invoice_issue_params.rbi create mode 100644 rbi/lib/orb/models/invoice_level_discount.rbi create mode 100644 rbi/lib/orb/models/invoice_line_item_create_params.rbi create mode 100644 rbi/lib/orb/models/invoice_line_item_create_response.rbi create mode 100644 rbi/lib/orb/models/invoice_list_params.rbi create mode 100644 rbi/lib/orb/models/invoice_mark_paid_params.rbi create mode 100644 rbi/lib/orb/models/invoice_pay_params.rbi create mode 100644 rbi/lib/orb/models/invoice_update_params.rbi create mode 100644 rbi/lib/orb/models/invoice_void_params.rbi create mode 100644 rbi/lib/orb/models/item.rbi create mode 100644 rbi/lib/orb/models/item_create_params.rbi create mode 100644 rbi/lib/orb/models/item_fetch_params.rbi create mode 100644 rbi/lib/orb/models/item_list_params.rbi create mode 100644 rbi/lib/orb/models/item_update_params.rbi create mode 100644 rbi/lib/orb/models/metric_create_params.rbi create mode 100644 rbi/lib/orb/models/metric_fetch_params.rbi create mode 100644 rbi/lib/orb/models/metric_list_params.rbi create mode 100644 rbi/lib/orb/models/metric_update_params.rbi create mode 100644 rbi/lib/orb/models/pagination_metadata.rbi create mode 100644 rbi/lib/orb/models/percentage_discount.rbi create mode 100644 rbi/lib/orb/models/plan.rbi create mode 100644 rbi/lib/orb/models/plan_create_params.rbi create mode 100644 rbi/lib/orb/models/plan_fetch_params.rbi create mode 100644 rbi/lib/orb/models/plan_list_params.rbi create mode 100644 rbi/lib/orb/models/plan_update_params.rbi create mode 100644 rbi/lib/orb/models/plans/external_plan_id_fetch_params.rbi create mode 100644 rbi/lib/orb/models/plans/external_plan_id_update_params.rbi create mode 100644 rbi/lib/orb/models/price.rbi create mode 100644 rbi/lib/orb/models/price_create_params.rbi create mode 100644 rbi/lib/orb/models/price_evaluate_params.rbi create mode 100644 rbi/lib/orb/models/price_evaluate_response.rbi create mode 100644 rbi/lib/orb/models/price_fetch_params.rbi create mode 100644 rbi/lib/orb/models/price_list_params.rbi create mode 100644 rbi/lib/orb/models/price_update_params.rbi create mode 100644 rbi/lib/orb/models/prices/external_price_id_fetch_params.rbi create mode 100644 rbi/lib/orb/models/prices/external_price_id_update_params.rbi create mode 100644 rbi/lib/orb/models/subscription.rbi create mode 100644 rbi/lib/orb/models/subscription_cancel_params.rbi create mode 100644 rbi/lib/orb/models/subscription_cancel_response.rbi create mode 100644 rbi/lib/orb/models/subscription_create_params.rbi create mode 100644 rbi/lib/orb/models/subscription_create_response.rbi create mode 100644 rbi/lib/orb/models/subscription_fetch_costs_params.rbi create mode 100644 rbi/lib/orb/models/subscription_fetch_costs_response.rbi create mode 100644 rbi/lib/orb/models/subscription_fetch_params.rbi create mode 100644 rbi/lib/orb/models/subscription_fetch_schedule_params.rbi create mode 100644 rbi/lib/orb/models/subscription_fetch_schedule_response.rbi create mode 100644 rbi/lib/orb/models/subscription_fetch_usage_params.rbi create mode 100644 rbi/lib/orb/models/subscription_list_params.rbi create mode 100644 rbi/lib/orb/models/subscription_price_intervals_params.rbi create mode 100644 rbi/lib/orb/models/subscription_price_intervals_response.rbi create mode 100644 rbi/lib/orb/models/subscription_schedule_plan_change_params.rbi create mode 100644 rbi/lib/orb/models/subscription_schedule_plan_change_response.rbi create mode 100644 rbi/lib/orb/models/subscription_trigger_phase_params.rbi create mode 100644 rbi/lib/orb/models/subscription_trigger_phase_response.rbi create mode 100644 rbi/lib/orb/models/subscription_unschedule_cancellation_params.rbi create mode 100644 rbi/lib/orb/models/subscription_unschedule_cancellation_response.rbi create mode 100644 rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbi create mode 100644 rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbi create mode 100644 rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rbi create mode 100644 rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rbi create mode 100644 rbi/lib/orb/models/subscription_update_fixed_fee_quantity_params.rbi create mode 100644 rbi/lib/orb/models/subscription_update_fixed_fee_quantity_response.rbi create mode 100644 rbi/lib/orb/models/subscription_update_params.rbi create mode 100644 rbi/lib/orb/models/subscription_update_trial_params.rbi create mode 100644 rbi/lib/orb/models/subscription_update_trial_response.rbi create mode 100644 rbi/lib/orb/models/subscription_usage.rbi create mode 100644 rbi/lib/orb/models/subscriptions.rbi create mode 100644 rbi/lib/orb/models/top_level_ping_params.rbi create mode 100644 rbi/lib/orb/models/top_level_ping_response.rbi create mode 100644 rbi/lib/orb/models/trial_discount.rbi create mode 100644 rbi/lib/orb/page.rbi create mode 100644 rbi/lib/orb/request_options.rbi create mode 100644 rbi/lib/orb/resources/alerts.rbi create mode 100644 rbi/lib/orb/resources/coupons.rbi create mode 100644 rbi/lib/orb/resources/coupons/subscriptions.rbi create mode 100644 rbi/lib/orb/resources/credit_notes.rbi create mode 100644 rbi/lib/orb/resources/customers.rbi create mode 100644 rbi/lib/orb/resources/customers/balance_transactions.rbi create mode 100644 rbi/lib/orb/resources/customers/costs.rbi create mode 100644 rbi/lib/orb/resources/customers/credits.rbi create mode 100644 rbi/lib/orb/resources/customers/credits/ledger.rbi create mode 100644 rbi/lib/orb/resources/customers/credits/top_ups.rbi create mode 100644 rbi/lib/orb/resources/dimensional_price_groups.rbi create mode 100644 rbi/lib/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rbi create mode 100644 rbi/lib/orb/resources/events.rbi create mode 100644 rbi/lib/orb/resources/events/backfills.rbi create mode 100644 rbi/lib/orb/resources/events/volume.rbi create mode 100644 rbi/lib/orb/resources/invoice_line_items.rbi create mode 100644 rbi/lib/orb/resources/invoices.rbi create mode 100644 rbi/lib/orb/resources/items.rbi create mode 100644 rbi/lib/orb/resources/metrics.rbi create mode 100644 rbi/lib/orb/resources/plans.rbi create mode 100644 rbi/lib/orb/resources/plans/external_plan_id.rbi create mode 100644 rbi/lib/orb/resources/prices.rbi create mode 100644 rbi/lib/orb/resources/prices/external_price_id.rbi create mode 100644 rbi/lib/orb/resources/subscriptions.rbi create mode 100644 rbi/lib/orb/resources/top_level.rbi create mode 100644 rbi/lib/orb/util.rbi create mode 100644 rbi/lib/orb/version.rbi create mode 100644 release-please-config.json create mode 100755 scripts/bootstrap create mode 100755 scripts/format create mode 100755 scripts/lint create mode 100755 scripts/mock create mode 100755 scripts/test create mode 100644 sig/orb/base_client.rbs create mode 100644 sig/orb/base_model.rbs create mode 100644 sig/orb/base_page.rbs create mode 100644 sig/orb/client.rbs create mode 100644 sig/orb/errors.rbs create mode 100644 sig/orb/extern.rbs create mode 100644 sig/orb/models/alert.rbs create mode 100644 sig/orb/models/alert_create_for_customer_params.rbs create mode 100644 sig/orb/models/alert_create_for_external_customer_params.rbs create mode 100644 sig/orb/models/alert_create_for_subscription_params.rbs create mode 100644 sig/orb/models/alert_disable_params.rbs create mode 100644 sig/orb/models/alert_enable_params.rbs create mode 100644 sig/orb/models/alert_list_params.rbs create mode 100644 sig/orb/models/alert_retrieve_params.rbs create mode 100644 sig/orb/models/alert_update_params.rbs create mode 100644 sig/orb/models/amount_discount.rbs create mode 100644 sig/orb/models/billable_metric.rbs create mode 100644 sig/orb/models/billing_cycle_relative_date.rbs create mode 100644 sig/orb/models/coupon.rbs create mode 100644 sig/orb/models/coupon_archive_params.rbs create mode 100644 sig/orb/models/coupon_create_params.rbs create mode 100644 sig/orb/models/coupon_fetch_params.rbs create mode 100644 sig/orb/models/coupon_list_params.rbs create mode 100644 sig/orb/models/coupons/subscription_list_params.rbs create mode 100644 sig/orb/models/credit_note.rbs create mode 100644 sig/orb/models/credit_note_create_params.rbs create mode 100644 sig/orb/models/credit_note_fetch_params.rbs create mode 100644 sig/orb/models/credit_note_list_params.rbs create mode 100644 sig/orb/models/customer.rbs create mode 100644 sig/orb/models/customer_create_params.rbs create mode 100644 sig/orb/models/customer_delete_params.rbs create mode 100644 sig/orb/models/customer_fetch_by_external_id_params.rbs create mode 100644 sig/orb/models/customer_fetch_params.rbs create mode 100644 sig/orb/models/customer_list_params.rbs create mode 100644 sig/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbs create mode 100644 sig/orb/models/customer_sync_payment_methods_from_gateway_params.rbs create mode 100644 sig/orb/models/customer_update_by_external_id_params.rbs create mode 100644 sig/orb/models/customer_update_params.rbs create mode 100644 sig/orb/models/customers/balance_transaction_create_params.rbs create mode 100644 sig/orb/models/customers/balance_transaction_create_response.rbs create mode 100644 sig/orb/models/customers/balance_transaction_list_params.rbs create mode 100644 sig/orb/models/customers/balance_transaction_list_response.rbs create mode 100644 sig/orb/models/customers/cost_list_by_external_id_params.rbs create mode 100644 sig/orb/models/customers/cost_list_by_external_id_response.rbs create mode 100644 sig/orb/models/customers/cost_list_params.rbs create mode 100644 sig/orb/models/customers/cost_list_response.rbs create mode 100644 sig/orb/models/customers/credit_list_by_external_id_params.rbs create mode 100644 sig/orb/models/customers/credit_list_by_external_id_response.rbs create mode 100644 sig/orb/models/customers/credit_list_params.rbs create mode 100644 sig/orb/models/customers/credit_list_response.rbs create mode 100644 sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs create mode 100644 sig/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbs create mode 100644 sig/orb/models/customers/credits/ledger_create_entry_params.rbs create mode 100644 sig/orb/models/customers/credits/ledger_create_entry_response.rbs create mode 100644 sig/orb/models/customers/credits/ledger_list_by_external_id_params.rbs create mode 100644 sig/orb/models/customers/credits/ledger_list_by_external_id_response.rbs create mode 100644 sig/orb/models/customers/credits/ledger_list_params.rbs create mode 100644 sig/orb/models/customers/credits/ledger_list_response.rbs create mode 100644 sig/orb/models/customers/credits/top_up_create_by_external_id_params.rbs create mode 100644 sig/orb/models/customers/credits/top_up_create_by_external_id_response.rbs create mode 100644 sig/orb/models/customers/credits/top_up_create_params.rbs create mode 100644 sig/orb/models/customers/credits/top_up_create_response.rbs create mode 100644 sig/orb/models/customers/credits/top_up_delete_by_external_id_params.rbs create mode 100644 sig/orb/models/customers/credits/top_up_delete_params.rbs create mode 100644 sig/orb/models/customers/credits/top_up_list_by_external_id_params.rbs create mode 100644 sig/orb/models/customers/credits/top_up_list_by_external_id_response.rbs create mode 100644 sig/orb/models/customers/credits/top_up_list_params.rbs create mode 100644 sig/orb/models/customers/credits/top_up_list_response.rbs create mode 100644 sig/orb/models/dimensional_price_group.rbs create mode 100644 sig/orb/models/dimensional_price_group_create_params.rbs create mode 100644 sig/orb/models/dimensional_price_group_list_params.rbs create mode 100644 sig/orb/models/dimensional_price_group_retrieve_params.rbs create mode 100644 sig/orb/models/dimensional_price_groups.rbs create mode 100644 sig/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbs create mode 100644 sig/orb/models/discount.rbs create mode 100644 sig/orb/models/evaluate_price_group.rbs create mode 100644 sig/orb/models/event_deprecate_params.rbs create mode 100644 sig/orb/models/event_deprecate_response.rbs create mode 100644 sig/orb/models/event_ingest_params.rbs create mode 100644 sig/orb/models/event_ingest_response.rbs create mode 100644 sig/orb/models/event_search_params.rbs create mode 100644 sig/orb/models/event_search_response.rbs create mode 100644 sig/orb/models/event_update_params.rbs create mode 100644 sig/orb/models/event_update_response.rbs create mode 100644 sig/orb/models/events/backfill_close_params.rbs create mode 100644 sig/orb/models/events/backfill_close_response.rbs create mode 100644 sig/orb/models/events/backfill_create_params.rbs create mode 100644 sig/orb/models/events/backfill_create_response.rbs create mode 100644 sig/orb/models/events/backfill_fetch_params.rbs create mode 100644 sig/orb/models/events/backfill_fetch_response.rbs create mode 100644 sig/orb/models/events/backfill_list_params.rbs create mode 100644 sig/orb/models/events/backfill_list_response.rbs create mode 100644 sig/orb/models/events/backfill_revert_params.rbs create mode 100644 sig/orb/models/events/backfill_revert_response.rbs create mode 100644 sig/orb/models/events/event_volumes.rbs create mode 100644 sig/orb/models/events/volume_list_params.rbs create mode 100644 sig/orb/models/invoice.rbs create mode 100644 sig/orb/models/invoice_create_params.rbs create mode 100644 sig/orb/models/invoice_fetch_params.rbs create mode 100644 sig/orb/models/invoice_fetch_upcoming_params.rbs create mode 100644 sig/orb/models/invoice_fetch_upcoming_response.rbs create mode 100644 sig/orb/models/invoice_issue_params.rbs create mode 100644 sig/orb/models/invoice_level_discount.rbs create mode 100644 sig/orb/models/invoice_line_item_create_params.rbs create mode 100644 sig/orb/models/invoice_line_item_create_response.rbs create mode 100644 sig/orb/models/invoice_list_params.rbs create mode 100644 sig/orb/models/invoice_mark_paid_params.rbs create mode 100644 sig/orb/models/invoice_pay_params.rbs create mode 100644 sig/orb/models/invoice_update_params.rbs create mode 100644 sig/orb/models/invoice_void_params.rbs create mode 100644 sig/orb/models/item.rbs create mode 100644 sig/orb/models/item_create_params.rbs create mode 100644 sig/orb/models/item_fetch_params.rbs create mode 100644 sig/orb/models/item_list_params.rbs create mode 100644 sig/orb/models/item_update_params.rbs create mode 100644 sig/orb/models/metric_create_params.rbs create mode 100644 sig/orb/models/metric_fetch_params.rbs create mode 100644 sig/orb/models/metric_list_params.rbs create mode 100644 sig/orb/models/metric_update_params.rbs create mode 100644 sig/orb/models/pagination_metadata.rbs create mode 100644 sig/orb/models/percentage_discount.rbs create mode 100644 sig/orb/models/plan.rbs create mode 100644 sig/orb/models/plan_create_params.rbs create mode 100644 sig/orb/models/plan_fetch_params.rbs create mode 100644 sig/orb/models/plan_list_params.rbs create mode 100644 sig/orb/models/plan_update_params.rbs create mode 100644 sig/orb/models/plans/external_plan_id_fetch_params.rbs create mode 100644 sig/orb/models/plans/external_plan_id_update_params.rbs create mode 100644 sig/orb/models/price.rbs create mode 100644 sig/orb/models/price_create_params.rbs create mode 100644 sig/orb/models/price_evaluate_params.rbs create mode 100644 sig/orb/models/price_evaluate_response.rbs create mode 100644 sig/orb/models/price_fetch_params.rbs create mode 100644 sig/orb/models/price_list_params.rbs create mode 100644 sig/orb/models/price_update_params.rbs create mode 100644 sig/orb/models/prices/external_price_id_fetch_params.rbs create mode 100644 sig/orb/models/prices/external_price_id_update_params.rbs create mode 100644 sig/orb/models/subscription.rbs create mode 100644 sig/orb/models/subscription_cancel_params.rbs create mode 100644 sig/orb/models/subscription_cancel_response.rbs create mode 100644 sig/orb/models/subscription_create_params.rbs create mode 100644 sig/orb/models/subscription_create_response.rbs create mode 100644 sig/orb/models/subscription_fetch_costs_params.rbs create mode 100644 sig/orb/models/subscription_fetch_costs_response.rbs create mode 100644 sig/orb/models/subscription_fetch_params.rbs create mode 100644 sig/orb/models/subscription_fetch_schedule_params.rbs create mode 100644 sig/orb/models/subscription_fetch_schedule_response.rbs create mode 100644 sig/orb/models/subscription_fetch_usage_params.rbs create mode 100644 sig/orb/models/subscription_list_params.rbs create mode 100644 sig/orb/models/subscription_price_intervals_params.rbs create mode 100644 sig/orb/models/subscription_price_intervals_response.rbs create mode 100644 sig/orb/models/subscription_schedule_plan_change_params.rbs create mode 100644 sig/orb/models/subscription_schedule_plan_change_response.rbs create mode 100644 sig/orb/models/subscription_trigger_phase_params.rbs create mode 100644 sig/orb/models/subscription_trigger_phase_response.rbs create mode 100644 sig/orb/models/subscription_unschedule_cancellation_params.rbs create mode 100644 sig/orb/models/subscription_unschedule_cancellation_response.rbs create mode 100644 sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbs create mode 100644 sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbs create mode 100644 sig/orb/models/subscription_unschedule_pending_plan_changes_params.rbs create mode 100644 sig/orb/models/subscription_unschedule_pending_plan_changes_response.rbs create mode 100644 sig/orb/models/subscription_update_fixed_fee_quantity_params.rbs create mode 100644 sig/orb/models/subscription_update_fixed_fee_quantity_response.rbs create mode 100644 sig/orb/models/subscription_update_params.rbs create mode 100644 sig/orb/models/subscription_update_trial_params.rbs create mode 100644 sig/orb/models/subscription_update_trial_response.rbs create mode 100644 sig/orb/models/subscription_usage.rbs create mode 100644 sig/orb/models/subscriptions.rbs create mode 100644 sig/orb/models/top_level_ping_params.rbs create mode 100644 sig/orb/models/top_level_ping_response.rbs create mode 100644 sig/orb/models/trial_discount.rbs create mode 100644 sig/orb/page.rbs create mode 100644 sig/orb/request_options.rbs create mode 100644 sig/orb/resources/alerts.rbs create mode 100644 sig/orb/resources/coupons.rbs create mode 100644 sig/orb/resources/coupons/subscriptions.rbs create mode 100644 sig/orb/resources/credit_notes.rbs create mode 100644 sig/orb/resources/customers.rbs create mode 100644 sig/orb/resources/customers/balance_transactions.rbs create mode 100644 sig/orb/resources/customers/costs.rbs create mode 100644 sig/orb/resources/customers/credits.rbs create mode 100644 sig/orb/resources/customers/credits/ledger.rbs create mode 100644 sig/orb/resources/customers/credits/top_ups.rbs create mode 100644 sig/orb/resources/dimensional_price_groups.rbs create mode 100644 sig/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rbs create mode 100644 sig/orb/resources/events.rbs create mode 100644 sig/orb/resources/events/backfills.rbs create mode 100644 sig/orb/resources/events/volume.rbs create mode 100644 sig/orb/resources/invoice_line_items.rbs create mode 100644 sig/orb/resources/invoices.rbs create mode 100644 sig/orb/resources/items.rbs create mode 100644 sig/orb/resources/metrics.rbs create mode 100644 sig/orb/resources/plans.rbs create mode 100644 sig/orb/resources/plans/external_plan_id.rbs create mode 100644 sig/orb/resources/prices.rbs create mode 100644 sig/orb/resources/prices/external_price_id.rbs create mode 100644 sig/orb/resources/subscriptions.rbs create mode 100644 sig/orb/resources/top_level.rbs create mode 100644 sig/orb/util.rbs create mode 100644 sig/orb/version.rbs create mode 100644 test/orb/base_model_test.rb create mode 100644 test/orb/client_test.rb delete mode 100644 test/orb/coupons_test.rb delete mode 100644 test/orb/credit_notes_test.rb delete mode 100644 test/orb/customers_test.rb delete mode 100644 test/orb/events_test.rb delete mode 100644 test/orb/invoice_line_items_test.rb delete mode 100644 test/orb/invoices_test.rb delete mode 100644 test/orb/items_test.rb delete mode 100644 test/orb/metrics_test.rb delete mode 100644 test/orb/plans_test.rb delete mode 100644 test/orb/prices_test.rb create mode 100644 test/orb/resources/alerts_test.rb create mode 100644 test/orb/resources/coupons/subscriptions_test.rb create mode 100644 test/orb/resources/coupons_test.rb create mode 100644 test/orb/resources/credit_notes_test.rb create mode 100644 test/orb/resources/customers/balance_transactions_test.rb create mode 100644 test/orb/resources/customers/costs_test.rb create mode 100644 test/orb/resources/customers/credits/ledger_test.rb create mode 100644 test/orb/resources/customers/credits/top_ups_test.rb create mode 100644 test/orb/resources/customers/credits_test.rb create mode 100644 test/orb/resources/customers_test.rb create mode 100644 test/orb/resources/dimensional_price_groups/external_dimensional_price_group_id_test.rb create mode 100644 test/orb/resources/dimensional_price_groups_test.rb create mode 100644 test/orb/resources/events/backfills_test.rb create mode 100644 test/orb/resources/events/volume_test.rb create mode 100644 test/orb/resources/events_test.rb create mode 100644 test/orb/resources/invoice_line_items_test.rb create mode 100644 test/orb/resources/invoices_test.rb create mode 100644 test/orb/resources/items_test.rb create mode 100644 test/orb/resources/metrics_test.rb create mode 100644 test/orb/resources/plans/external_plan_id_test.rb create mode 100644 test/orb/resources/plans_test.rb create mode 100644 test/orb/resources/prices/external_price_id_test.rb create mode 100644 test/orb/resources/prices_test.rb create mode 100644 test/orb/resources/shared_test.rb create mode 100644 test/orb/resources/subscriptions_test.rb create mode 100644 test/orb/resources/top_level_test.rb delete mode 100644 test/orb/subscriptions_test.rb create mode 100644 test/orb/test_helper.rb create mode 100644 test/orb/test_namespaces.rb delete mode 100644 test/orb/top_level_test.rb create mode 100644 test/orb/util_test.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..04343e0e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: CI +on: + push: + branches: + - main + pull_request: + branches: + - main + - next + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + + + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: '3.1' + + - name: Run lints + run: ./scripts/lint + test: + name: test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: '3.1' + + - name: Run tests + run: ./scripts/test + diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml new file mode 100644 index 00000000..abfe2826 --- /dev/null +++ b/.github/workflows/publish-gem.yml @@ -0,0 +1,30 @@ +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to rubygems.org in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/orbcorp/orb-python/actions/workflows/publish-gem.yml +name: Publish Gem +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: false + ruby-version: '3.1' + + - name: Publish to RubyGems.org + run: | + bash ./bin/publish-gem + env: + # `RUBYGEMS_HOST` is only required for private gem repositories, not https://rubygems.org + RUBYGEMS_HOST: ${{ secrets.ORB_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }} + GEM_HOST_API_KEY: ${{ secrets.ORB_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 00000000..8f994fee --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,22 @@ +name: Release Doctor +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'orbcorp/orb-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v4 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + RUBYGEMS_HOST: ${{ secrets.ORB_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }} + GEM_HOST_API_KEY: ${{ secrets.ORB_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..9d9b65f8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +.prism.log +.idea/ +.ruby-lsp/ +.yardoc/ +doc/ +sorbet/ +bin/ +Brewfile.lock.json +*.gem diff --git a/.gitkeep b/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..c4762802 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1-alpha.0" +} \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 00000000..46692507 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,194 @@ +# Just to be safe, ensure nobody is mutating our internal strings. +Style/FrozenStringLiteralComment: + EnforcedStyle: always + Exclude: + - '**/*.rbi' + +# And/or have confusing precedence, avoid them. +Style/AndOr: + EnforcedStyle: always + +# Prefer double quotes so that interpolation can be easily added. +Style/StringLiterals: + EnforcedStyle: double_quotes + +# Most common style in Ruby. +Style/RegexpLiteral: + EnforcedStyle: slashes + +# Prefer explicit symbols for clarity; you can search for `:the_symbol`. +Style/SymbolArray: + EnforcedStyle: brackets + +# Prefer consistency in method calling syntax +Style/MethodCallWithArgsParentheses: + Enabled: true + Exclude: + - '**/*.gemspec' + AllowedMethods: + - raise + +# Nothing wrong with inline private methods +Style/AccessModifierDeclarations: + Enabled: false + +# Nothing wrong with clear if statements. +Style/IfUnlessModifier: + Enabled: false + +# Unless is not necessarily clearer. +Style/NegatedIf: + Enabled: false + +# We use these sparingly, where we anticipate future branches for the +# inner conditional. +Style/SoleNestedConditional: + Enabled: false + +# Allow explicit empty elses, for clarity. +Style/EmptyElse: + Enabled: false + +# Allow explicit ifs, especially for imperative use. +Style/SafeNavigation: + Enabled: false + +# We commonly use ENV['KEY'], it's OK. +Style/FetchEnvVar: + Enabled: false + +# Behaviour of alias_method is more predictable. +Style/Alias: + EnforcedStyle: prefer_alias_method + +# We prefer nested modules in lib/, but are currently using compact style for tests. +Style/ClassAndModuleChildren: + Exclude: + - test/**/* + +# Perfectly fine +Style/MultipleComparison: + Enabled: false + +# Rubocop is pretty bad about mangling single line lambdas +Style/Lambda: + Enabled: false + +# Not all parameters should be named +Style/NumberedParameters: + Enabled: false + +# Fairly useful in tests for pattern matching +Style/CaseEquality: + Exclude: + - test/**/* + +# Reasonable to use brackets for errors with long messages. +Style/RaiseArgs: + Enabled: false + +# Reasonable for a library to define dynamic type-aliases depending on sorbet-runtime availability +Lint/ConstantDefinitionInBlock: + Exclude: + - 'lib/**/*' + +# Sorbet files should be excluded from some style considerations +Style/AccessorGrouping: + Exclude: + - '**/*.rbi' +Style/EmptyMethod: + Exclude: + - '**/*.rbi' +Style/RedundantInitialize: + Exclude: + - '**/*.rbi' +Lint/MissingSuper: + Exclude: + - '**/*.rbi' +Style/BisectedAttrAccessor: + Exclude: + - '**/*.rbi' +Naming/MethodParameterName: + Exclude: + - '**/*.rbi' +Style/MutableConstant: + Exclude: + - '**/*.rbi' + +# Literally nothing wrong with `symbol_1` +Naming/VariableNumber: + Enabled: false + +# Set a reasonable line length; rely on other cops to correct long lines. +Layout/LineLength: + Max: 110 + AllowedPatterns: + - '^(\s*#)' # Comments for YARD docs: @param and similar. + - '= Orb::Resources::\S+\.new\(client: (self|client)\)$' # Instantiating resources. + - '^\s*(-> { )?Orb::Models::[a-zA-Z0-9:]+( })?$' # Line is entirely a reference to a fully-qualified Model. + +# Start the assignment on the same line variable is mentioned. +Layout/MultilineAssignmentLayout: + EnforcedStyle: same_line + +# Don't leave complex assignment values hanging off to the right. +Layout/EndAlignment: + EnforcedStyleAlignWith: variable + +# Don't require this extra line break, it can be excessive. +Layout/EmptyLineAfterGuardClause: + Enabled: false + +# For arrays, hashes, method arguments, and method params, if they are broken onto multiple lines: +# * Should have one element per line. +# * Should have a line break before the first element. +Layout/MultilineArrayLineBreaks: + Enabled: true +Layout/FirstArrayElementLineBreak: + Enabled: true +Layout/MultilineHashKeyLineBreaks: + Enabled: true +Layout/FirstHashElementLineBreak: + Enabled: true +Layout/MultilineMethodArgumentLineBreaks: + Enabled: true +Layout/FirstMethodArgumentLineBreak: + Enabled: true +Layout/MultilineMethodParameterLineBreaks: + Enabled: true +Layout/FirstMethodParameterLineBreak: + Enabled: true + +# Prefer compact hash literals. +Layout/SpaceInsideHashLiteralBraces: + EnforcedStyle: no_space + +# These cops are not as applicable to generated code. +Metrics/ParameterLists: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ClassLength: + Enabled: false + +# These cops are too aggressive for us or now, but we may want to address them +# later. +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Metrics/AbcSize: + Enabled: false + +# We should go back and add these docs, but ignore for now. +Style/Documentation: + Enabled: false + +# Explicitly disable pending cops for now. This is the default behaviour but +# this avoids a large warning every time we run it. +# Stop RuboCop nagging about rubocop-rake. +# Ensure that RuboCop validates according to the lowest version of Ruby that we support. +AllCops: + NewCops: enable + SuggestExtensions: false + TargetRubyVersion: 3.0.0 diff --git a/.stats.yml b/.stats.yml index 1151d16c..ae59be0a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1,2 @@ -configured_endpoints: 74 +configured_endpoints: 103 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0dbb8ba730f755468357ebda41332664e8396faf29a6a6a64ad37cf35cf70d0c.yml diff --git a/.yardopts b/.yardopts new file mode 100644 index 00000000..29c933bc --- /dev/null +++ b/.yardopts @@ -0,0 +1 @@ +--markup markdown diff --git a/Gemfile b/Gemfile index a8ee8918..cc510e1f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,21 @@ -source 'https://rubygems.org' +# frozen_string_literal: true -gem 'connection_pool' -gem 'rake', :group => :development -gem 'syntax_tree', :group => :development -gem 'test-unit', :group => :development +source "https://rubygems.org" + +gemspec + +group :development do + gem "minitest" + gem "minitest-focus" + gem "minitest-hooks" + gem "rake" + gem "rbs" + gem "rubocop" + gem "sorbet" + gem "steep" + gem "syntax_tree" + # TODO: using a fork for now, the prettier below has a bug + gem "syntax_tree-rbs", github: "stainless-api/syntax_tree-rbs", branch: "main" + gem "webrick" + gem "yard" +end diff --git a/Gemfile.lock b/Gemfile.lock index 13811009..02158768 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,23 +1,133 @@ +GIT + remote: https://github.com/stainless-api/syntax_tree-rbs.git + revision: 140eb3ba2ff4b959b345ac2a7927cd758a9f1284 + branch: main + specs: + syntax_tree-rbs (1.0.0) + prettier_print + rbs + syntax_tree (>= 2.0.1) + +PATH + remote: . + specs: + orb (0.0.1.pre.alpha.0) + connection_pool + GEM remote: https://rubygems.org/ specs: - connection_pool (2.4.1) - power_assert (2.0.3) + activesupport (7.2.2.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + ast (2.4.2) + base64 (0.2.0) + benchmark (0.4.0) + bigdecimal (3.1.9) + concurrent-ruby (1.3.5) + connection_pool (2.5.0) + csv (3.3.2) + drb (2.2.1) + ffi (1.17.1) + fileutils (1.7.3) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + json (2.7.2) + language_server-protocol (3.17.0.3) + listen (3.9.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + logger (1.6.5) + minitest (5.25.4) + minitest-focus (1.4.0) + minitest (>= 4, < 6) + minitest-hooks (1.5.2) + minitest (> 5.3) + parallel (1.26.3) + parser (3.3.5.0) + ast (~> 2.4.1) + racc prettier_print (1.2.1) + racc (1.8.1) + rainbow (3.1.1) rake (13.1.0) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + rbs (3.8.1) + logger + regexp_parser (2.9.2) + rubocop (1.66.1) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.4, < 3.0) + rubocop-ast (>= 1.32.2, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.32.2) + parser (>= 3.3.1.0) + ruby-progressbar (1.13.0) + securerandom (0.4.1) + sorbet (0.5.11802) + sorbet-static (= 0.5.11802) + sorbet-static (0.5.11802-x86_64-linux) + steep (1.9.4) + activesupport (>= 5.1) + concurrent-ruby (>= 1.1.10) + csv (>= 3.0.9) + fileutils (>= 1.1.0) + json (>= 2.1.0) + language_server-protocol (>= 3.15, < 4.0) + listen (~> 3.0) + logger (>= 1.3.0) + parser (>= 3.1) + rainbow (>= 2.2.2, < 4.0) + rbs (~> 3.8) + securerandom (>= 0.1) + strscan (>= 1.0.0) + terminal-table (>= 2, < 4) + uri (>= 0.12.0) + strscan (3.1.2) syntax_tree (6.2.0) prettier_print (>= 1.2.0) - test-unit (3.6.1) - power_assert + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) + uri (1.0.2) + webrick (1.9.1) + yard (0.9.37) PLATFORMS x86_64-linux DEPENDENCIES - connection_pool + minitest + minitest-focus + minitest-hooks + orb! rake + rbs + rubocop + sorbet + steep syntax_tree - test-unit + syntax_tree-rbs! + webrick + yard BUNDLED WITH - 2.4.10 + 2.2.3 diff --git a/LICENSE b/LICENSE index 0576d5b8..00b1f9c8 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2023 Orb + Copyright 2025 Orb Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 3e2b971c..08a8e08f 100644 --- a/README.md +++ b/README.md @@ -1,108 +1,124 @@ # Orb Ruby API library -The Orb Ruby library provides convenient access to the Orb REST API from any Ruby 2.7+ -application. The library includes model classes for all request params and response fields. +The Orb Ruby library provides convenient access to the Orb REST API from any Ruby 3.0+ +application. ## Documentation -The API documentation can be found [here](https://www.withorb.com/https://docs.withorb.com/reference/api-reference). +Documentation for the most recent release of this gem can be found [on RubyDoc](https://gemdocs.org/gems/orb/latest). + +The underlying REST API documentation can be found on [docs.withorb.com](https://docs.withorb.com/reference/api-reference). ## Installation +To use this gem during the beta, install directly from GitHub with Bundler by +adding the following to your application's `Gemfile`: + +```ruby +gem "orb", git: "https://github.com/orbcorp/orb-ruby", branch: "main" +``` + +To fetch an initial copy of the gem: + ```sh -gem install orb +bundle install ``` -## Usage +To update the version used by your application when updates are pushed to +GitHub: -The full API of this library can be found in [api.md](https://www.github.com/orbcorp/orb-ruby/blob/main/api.md). +```sh +bundle update orb +``` + +## Usage ```ruby -require 'orb' +require "bundler/setup" +require "orb" -orb = Orb.new(api_key: "My API Key", # defaults to ENV["ORB_API_KEY"] -); +orb = Orb::Client.new( + api_key: "My API Key" # defaults to ENV["ORB_API_KEY"] +) -customer = orb.customers.create(email: "example-customer@withorb.com", name: "My Customer"); +customer = orb.customers.create(email: "example-customer@withorb.com", name: "My Customer") -puts customer.id +puts(customer.id) ``` -## Handling errors +### Errors -When the library is unable to connect to the API, -or if the API returns a non-success status code (i.e., 4xx or 5xx response), -a subclass of `Orb::HTTP::Error` will be thrown: +When the library is unable to connect to the API, or if the API returns a +non-success status code (i.e., 4xx or 5xx response), a subclass of +`Orb::Error` will be thrown: -```rb +```ruby begin customer = orb.customers.create(email: "example-customer@withorb.com", name: "My Customer") -rescue Orb::HTTP::Error => err - puts err.code # 400 +rescue Orb::Error => e + puts(e.code) # 400 end ``` Error codes are as followed: -| Status Code | Error Type | -| ----------- | -------------------------- | -| 400 | `BadRequestError` | -| 401 | `AuthenticationError` | -| 403 | `PermissionDeniedError` | -| 404 | `NotFoundError` | -| 409 | `ConflictError` | -| 422 | `UnprocessableEntityError` | -| 429 | `RateLimitError` | -| >=500 | `InternalServerError` | -| (else) | `APIStatusError` | -| N/A | `APIConnectionError` | +| Cause | Error Type | +| ---------------- | -------------------------- | +| HTTP 400 | `BadRequestError` | +| HTTP 401 | `AuthenticationError` | +| HTTP 403 | `PermissionDeniedError` | +| HTTP 404 | `NotFoundError` | +| HTTP 409 | `ConflictError` | +| HTTP 422 | `UnprocessableEntityError` | +| HTTP 429 | `RateLimitError` | +| HTTP >=500 | `InternalServerError` | +| Other HTTP error | `APIStatusError` | +| Timeout | `APITimeoutError` | +| Network error | `APIConnectionError` | ### Retries -Certain errors will be automatically retried 2 times by default, with a short exponential backoff. -Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, -429 Rate Limit, and >=500 Internal errors will all be retried by default. +Certain errors will be automatically retried 2 times by default, with a short +exponential backoff. Connection errors (for example, due to a network +connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, +and timeouts will all be retried by default. You can use the `max_retries` option to configure or disable this: -```rb +```ruby # Configure the default for all requests: -orb = Orb.new(max_retries: 0, # default is 2 -); +orb = Orb::Client.new( + max_retries: 0 # default is 2 +) + +# Or, configure per-request: +orb.customers.create(email: "example-customer@withorb.com", name: "My Customer", max_retries: 5) ``` -## Advanced +### Timeouts -### How to tell whether `nil` means `null` or missing +By default, requests will time out after 60 seconds. +Timeouts are applied separately to the initial connection and the overall request time, +so in some cases a request could wait 2\*timeout seconds before it fails. -In an API response, a field may be explicitly `nil`, or missing entirely; in either case, its value is `nil` in this library. You can differentiate the two cases with `.model_fields_set`: +You can use the `timeout` option to configure or disable this: ```ruby -if response.my_field.nil? - if response.model_fields_set.include? :my_field - puts 'Got json like {my_field: null}.' - else - puts 'Got json like {}, without a my_field key present at all.' - end -end -``` - -### Configuring the HTTP client +# Configure the default for all requests: +orb = Orb::Client.new( + timeout: nil # default is 60 +) -To avoid dependency clashes, Orb Ruby uses `Net::HTTP` by default. You can use your own http client by implementing your own request handler. TODO: docs forthcoming. +# Or, configure per-request: +orb.customers.create(email: "example-customer@withorb.com", name: "My Customer", timeout: 5) +``` ## Versioning -This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: - -1. Changes that only affect type hints/type documentation, without breaking runtime behavior. -2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_. -3. Changes that we do not expect to impact the vast majority of users in practice. - -We take backwards compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. - -We are keen for your feedback; please open an [issue](https://www.github.com/orbcorp/orb-ruby/issues) with questions, bugs, or suggestions. +This package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the +library is in initial development and has a major version of `0`, APIs may change +at any time. ## Requirements -Ruby 2.7 or higher. +Ruby 3.0 or higher. diff --git a/Rakefile b/Rakefile index d4bd9ac3..82167099 100644 --- a/Rakefile +++ b/Rakefile @@ -1,8 +1,85 @@ -require "rake/testtask" -require "syntax_tree/rake/write_task" +# frozen_string_literal: true -task default: %i[test, format] +require "minitest/test_task" +require "rake/clean" +require "rubocop/rake_task" +require "securerandom" +require "shellwords" -SyntaxTree::Rake::WriteTask.new('format') { |t| t.source_files = "lib/**/*.rb" } +CLEAN.push(*%w[.idea/ .ruby-lsp/ .yardoc/]) -Rake::TestTask.new { |t| t.pattern = "./test/**/*_test.rb" } +xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --] + +task(default: [:test, :format]) + +Minitest::TestTask.create do |t| + t.libs = %w[.] + t.test_globs = ENV.fetch("TEST", "./test/**/*_test.rb") +end + +RuboCop::RakeTask.new(:rubocop) do |t| + t.options = %w[--fail-level E --autocorrect] + if ENV.key?("CI") + t.options += %w[--format github] + end +end + +multitask(:format_rb) do + find = %w[find ./lib ./test ./rbi -type f -and ( -name *.rb -or -name *.rbi ) -print0] + fmt = xargs + %w[rubocop --fail-level F --autocorrect --format simple --] + sh("#{find.shelljoin} | #{fmt.shelljoin}") +end + +multitask(:format_rbs) do + find = %w[find ./sig -type f -name *.rbs -print0] + inplace = /darwin|bsd/ =~ RUBY_PLATFORM ? %w[-i''] : %w[-i] + uuid = SecureRandom.uuid + + # `syntax_tree` has trouble with `rbs`'s class aliases + + sed = xargs + %w[sed -E] + inplace + %w[-e] + # annotate class aliases with a unique comment + pre = sed + ["s/class ([^ ]+) = (.+$)/# #{uuid}\\n\\1: \\2/", "--"] + fmt = xargs + %w[stree write --plugin=rbs --] + # remove the unique comment and transform class aliases to type aliases + subst = <<~SED + s/# #{uuid}// + t l1 + b + : l1 + n + s/([^ :]+): (.+$)/class \\1 = \\2/ + SED + # 1. delete the unique comment + # 2. if deletion happened, branch to label `l1`, else continue + # 3. transform the class alias to a type alias at label `l1` + pst = sed + [subst, "--"] + + # transform class aliases to type aliases, which syntax tree has no trouble with + sh("#{find.shelljoin} | #{pre.shelljoin}") + # run syntax tree to format `*.rbs` files + sh("#{find.shelljoin} | #{fmt.shelljoin}") + # transform type aliases back to class aliases + sh("#{find.shelljoin} | #{pst.shelljoin}") +end + +multitask(format: [:format_rb, :format_rbs]) + +multitask(:steep) do + sh(*%w[steep check]) +end + +multitask(:sorbet) do + sh(*%w[srb typecheck -- .], chdir: "./rbi") +end + +multitask(typecheck: [:steep, :sorbet]) +multitask(lint: [:rubocop, :typecheck]) + +multitask(:build) do + sh(*%w[gem build -- orb.gemspec]) +end + +multitask(release: [:build]) do + sh(*%w[gem push], *FileList["orb-*.gem"]) +end diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..b32391b3 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,27 @@ +# Security Policy + +## Reporting Security Issues + +This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. + +To report a security issue, please contact the Stainless team at security@stainlessapi.com. + +## Responsible Disclosure + +We appreciate the efforts of security researchers and individuals who help us maintain the security of +SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible +disclosure practices by allowing us a reasonable amount of time to investigate and address the issue +before making any information public. + +## Reporting Non-SDK Related Security Issues + +If you encounter security issues that are not directly related to SDKs but pertain to the services +or products provided by Orb please follow the respective company's security reporting guidelines. + +### Orb Terms and Policies + +Please contact team@withorb.com for any questions or concerns regarding security of our services. + +--- + +Thank you for helping us keep the SDKs and systems they interact with secure. diff --git a/Steepfile b/Steepfile new file mode 100644 index 00000000..c60dd8f3 --- /dev/null +++ b/Steepfile @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +require "yaml" + +target :lib do + configure_code_diagnostics(Steep::Diagnostic::Ruby.strict) + + signature("sig") + + YAML.safe_load_file("./manifest.yaml", symbolize_names: true) => { dependencies: } + # currently these libraries lack the `*.rbs` annotations required by `steep` + stdlibs = dependencies - %w[etc net/http set stringio] + + stdlibs.each { library(_1) } +end diff --git a/lib/orb.rb b/lib/orb.rb new file mode 100644 index 00000000..9aaffd19 --- /dev/null +++ b/lib/orb.rb @@ -0,0 +1,220 @@ +# frozen_string_literal: true + +# Standard libraries. +require "cgi" +require "date" +require "erb" +require "etc" +require "json" +require "net/http" +require "securerandom" +require "set" +require "stringio" +require "time" +require "uri" + +# Gems. +require "connection_pool" + +# Package files. +require_relative "orb/pooled_net_requester" +require_relative "orb/version" +require_relative "orb/util" +require_relative "orb/extern" +require_relative "orb/base_model" +require_relative "orb/base_page" +require_relative "orb/request_options" +require_relative "orb/base_client" +require_relative "orb/errors" +require_relative "orb/models/amount_discount" +require_relative "orb/models/billing_cycle_relative_date" +require_relative "orb/models/discount" +require_relative "orb/models/invoice_level_discount" +require_relative "orb/models/pagination_metadata" +require_relative "orb/models/percentage_discount" +require_relative "orb/models/trial_discount" +require_relative "orb/models/top_level_ping_response" +require_relative "orb/models/coupon" +require_relative "orb/models/credit_note" +require_relative "orb/models/customer" +require_relative "orb/models/customers/cost_list_response" +require_relative "orb/models/customers/cost_list_by_external_id_response" +require_relative "orb/models/customers/credit_list_response" +require_relative "orb/models/customers/credit_list_by_external_id_response" +require_relative "orb/models/customers/credits/ledger_list_response" +require_relative "orb/models/customers/credits/ledger_create_entry_response" +require_relative "orb/models/customers/credits/ledger_create_entry_by_external_id_response" +require_relative "orb/models/customers/credits/ledger_list_by_external_id_response" +require_relative "orb/models/customers/credits/top_up_create_response" +require_relative "orb/models/customers/credits/top_up_list_response" +require_relative "orb/models/customers/credits/top_up_create_by_external_id_response" +require_relative "orb/models/customers/credits/top_up_list_by_external_id_response" +require_relative "orb/models/customers/balance_transaction_create_response" +require_relative "orb/models/customers/balance_transaction_list_response" +require_relative "orb/models/event_update_response" +require_relative "orb/models/event_deprecate_response" +require_relative "orb/models/event_ingest_response" +require_relative "orb/models/event_search_response" +require_relative "orb/models/events/backfill_create_response" +require_relative "orb/models/events/backfill_list_response" +require_relative "orb/models/events/backfill_close_response" +require_relative "orb/models/events/backfill_fetch_response" +require_relative "orb/models/events/backfill_revert_response" +require_relative "orb/models/events/event_volumes" +require_relative "orb/models/invoice_line_item_create_response" +require_relative "orb/models/invoice" +require_relative "orb/models/invoice_fetch_upcoming_response" +require_relative "orb/models/item" +require_relative "orb/models/billable_metric" +require_relative "orb/models/plan" +require_relative "orb/models/evaluate_price_group" +require_relative "orb/models/price" +require_relative "orb/models/price_evaluate_response" +require_relative "orb/models/subscription" +require_relative "orb/models/subscription_usage" +require_relative "orb/models/subscriptions" +require_relative "orb/models/subscription_create_response" +require_relative "orb/models/subscription_cancel_response" +require_relative "orb/models/subscription_fetch_costs_response" +require_relative "orb/models/subscription_fetch_schedule_response" +require_relative "orb/models/subscription_price_intervals_response" +require_relative "orb/models/subscription_schedule_plan_change_response" +require_relative "orb/models/subscription_trigger_phase_response" +require_relative "orb/models/subscription_unschedule_cancellation_response" +require_relative "orb/models/subscription_unschedule_fixed_fee_quantity_updates_response" +require_relative "orb/models/subscription_unschedule_pending_plan_changes_response" +require_relative "orb/models/subscription_update_fixed_fee_quantity_response" +require_relative "orb/models/subscription_update_trial_response" +require_relative "orb/models/alert" +require_relative "orb/models/dimensional_price_group" +require_relative "orb/models/dimensional_price_groups" +require_relative "orb/models/top_level_ping_params" +require_relative "orb/models/coupon_create_params" +require_relative "orb/models/coupon_list_params" +require_relative "orb/models/coupon_archive_params" +require_relative "orb/models/coupon_fetch_params" +require_relative "orb/models/coupons/subscription_list_params" +require_relative "orb/models/credit_note_create_params" +require_relative "orb/models/credit_note_list_params" +require_relative "orb/models/credit_note_fetch_params" +require_relative "orb/models/customer_create_params" +require_relative "orb/models/customer_update_params" +require_relative "orb/models/customer_list_params" +require_relative "orb/models/customer_delete_params" +require_relative "orb/models/customer_fetch_params" +require_relative "orb/models/customer_fetch_by_external_id_params" +require_relative "orb/models/customer_sync_payment_methods_from_gateway_params" +require_relative "orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params" +require_relative "orb/models/customer_update_by_external_id_params" +require_relative "orb/models/customers/cost_list_params" +require_relative "orb/models/customers/cost_list_by_external_id_params" +require_relative "orb/models/customers/credit_list_params" +require_relative "orb/models/customers/credit_list_by_external_id_params" +require_relative "orb/models/customers/credits/ledger_list_params" +require_relative "orb/models/customers/credits/ledger_create_entry_params" +require_relative "orb/models/customers/credits/ledger_create_entry_by_external_id_params" +require_relative "orb/models/customers/credits/ledger_list_by_external_id_params" +require_relative "orb/models/customers/credits/top_up_create_params" +require_relative "orb/models/customers/credits/top_up_list_params" +require_relative "orb/models/customers/credits/top_up_delete_params" +require_relative "orb/models/customers/credits/top_up_create_by_external_id_params" +require_relative "orb/models/customers/credits/top_up_delete_by_external_id_params" +require_relative "orb/models/customers/credits/top_up_list_by_external_id_params" +require_relative "orb/models/customers/balance_transaction_create_params" +require_relative "orb/models/customers/balance_transaction_list_params" +require_relative "orb/models/event_update_params" +require_relative "orb/models/event_deprecate_params" +require_relative "orb/models/event_ingest_params" +require_relative "orb/models/event_search_params" +require_relative "orb/models/events/backfill_create_params" +require_relative "orb/models/events/backfill_list_params" +require_relative "orb/models/events/backfill_close_params" +require_relative "orb/models/events/backfill_fetch_params" +require_relative "orb/models/events/backfill_revert_params" +require_relative "orb/models/events/volume_list_params" +require_relative "orb/models/invoice_line_item_create_params" +require_relative "orb/models/invoice_create_params" +require_relative "orb/models/invoice_update_params" +require_relative "orb/models/invoice_list_params" +require_relative "orb/models/invoice_fetch_params" +require_relative "orb/models/invoice_fetch_upcoming_params" +require_relative "orb/models/invoice_issue_params" +require_relative "orb/models/invoice_mark_paid_params" +require_relative "orb/models/invoice_pay_params" +require_relative "orb/models/invoice_void_params" +require_relative "orb/models/item_create_params" +require_relative "orb/models/item_update_params" +require_relative "orb/models/item_list_params" +require_relative "orb/models/item_fetch_params" +require_relative "orb/models/metric_create_params" +require_relative "orb/models/metric_update_params" +require_relative "orb/models/metric_list_params" +require_relative "orb/models/metric_fetch_params" +require_relative "orb/models/plan_create_params" +require_relative "orb/models/plan_update_params" +require_relative "orb/models/plan_list_params" +require_relative "orb/models/plan_fetch_params" +require_relative "orb/models/plans/external_plan_id_update_params" +require_relative "orb/models/plans/external_plan_id_fetch_params" +require_relative "orb/models/price_create_params" +require_relative "orb/models/price_update_params" +require_relative "orb/models/price_list_params" +require_relative "orb/models/price_evaluate_params" +require_relative "orb/models/price_fetch_params" +require_relative "orb/models/prices/external_price_id_update_params" +require_relative "orb/models/prices/external_price_id_fetch_params" +require_relative "orb/models/subscription_create_params" +require_relative "orb/models/subscription_update_params" +require_relative "orb/models/subscription_list_params" +require_relative "orb/models/subscription_cancel_params" +require_relative "orb/models/subscription_fetch_params" +require_relative "orb/models/subscription_fetch_costs_params" +require_relative "orb/models/subscription_fetch_schedule_params" +require_relative "orb/models/subscription_fetch_usage_params" +require_relative "orb/models/subscription_price_intervals_params" +require_relative "orb/models/subscription_schedule_plan_change_params" +require_relative "orb/models/subscription_trigger_phase_params" +require_relative "orb/models/subscription_unschedule_cancellation_params" +require_relative "orb/models/subscription_unschedule_fixed_fee_quantity_updates_params" +require_relative "orb/models/subscription_unschedule_pending_plan_changes_params" +require_relative "orb/models/subscription_update_fixed_fee_quantity_params" +require_relative "orb/models/subscription_update_trial_params" +require_relative "orb/models/alert_retrieve_params" +require_relative "orb/models/alert_update_params" +require_relative "orb/models/alert_list_params" +require_relative "orb/models/alert_create_for_customer_params" +require_relative "orb/models/alert_create_for_external_customer_params" +require_relative "orb/models/alert_create_for_subscription_params" +require_relative "orb/models/alert_disable_params" +require_relative "orb/models/alert_enable_params" +require_relative "orb/models/dimensional_price_group_create_params" +require_relative "orb/models/dimensional_price_group_retrieve_params" +require_relative "orb/models/dimensional_price_group_list_params" +require_relative "orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params" +require_relative "orb/client" +require_relative "orb/page" +require_relative "orb/resources/top_level" +require_relative "orb/resources/coupons" +require_relative "orb/resources/coupons/subscriptions" +require_relative "orb/resources/credit_notes" +require_relative "orb/resources/customers" +require_relative "orb/resources/customers/costs" +require_relative "orb/resources/customers/credits" +require_relative "orb/resources/customers/credits/ledger" +require_relative "orb/resources/customers/credits/top_ups" +require_relative "orb/resources/customers/balance_transactions" +require_relative "orb/resources/events" +require_relative "orb/resources/events/backfills" +require_relative "orb/resources/events/volume" +require_relative "orb/resources/invoice_line_items" +require_relative "orb/resources/invoices" +require_relative "orb/resources/items" +require_relative "orb/resources/metrics" +require_relative "orb/resources/plans" +require_relative "orb/resources/plans/external_plan_id" +require_relative "orb/resources/prices" +require_relative "orb/resources/prices/external_price_id" +require_relative "orb/resources/subscriptions" +require_relative "orb/resources/alerts" +require_relative "orb/resources/dimensional_price_groups" +require_relative "orb/resources/dimensional_price_groups/external_dimensional_price_group_id" diff --git a/lib/orb/auth.rb b/lib/orb/auth.rb deleted file mode 100644 index 54f0d754..00000000 --- a/lib/orb/auth.rb +++ /dev/null @@ -1 +0,0 @@ -# typed: strict diff --git a/lib/orb/base_client.rb b/lib/orb/base_client.rb index 3abf5773..f920237a 100644 --- a/lib/orb/base_client.rb +++ b/lib/orb/base_client.rb @@ -1,281 +1,452 @@ -# typed: true # frozen_string_literal: true -require "json" -require_relative "pooled_net_requester" -require "uri" - -# convert the OpenAPI domain to raw HTTP: -# - apply security schemes -# - coerce requests/responses to and from content types -# - add server host and scheme, base api paths to URI -# - apply retries module Orb + # @private + # + # @abstract + # class BaseClient - DEFAULT_MAX_RETRIES = 2 - attr_reader :accounts, :http_bin + # from whatwg fetch spec + MAX_REDIRECTS = 20 + + # @private + # + # @param req [Hash{Symbol=>Object}] + # + # @raise [ArgumentError] + # + def self.validate!(req) + keys = [:method, :path, :query, :headers, :body, :unwrap, :page, :model, :options] + case req + in Hash + req.each_key do |k| + unless keys.include?(k) + raise ArgumentError.new("Request `req` keys must be one of #{keys}, got #{k.inspect}") + end + end + else + raise ArgumentError.new("Request `req` must be a Hash or RequestOptions, got #{req.inspect}") + end + end + # @private + # + # @return [Orb::PooledNetRequester] + attr_accessor :requester + + # @private + # + # @param base_url [String] + # @param timeout [Float] + # @param max_retries [Integer] + # @param initial_retry_delay [Float] + # @param max_retry_delay [Float] + # @param headers [Hash{String=>String, nil}] + # @param idempotency_header [String, nil] + # def initialize( - server_uri_string:, - requester: nil, - headers: nil, - max_retries: nil + base_url:, + timeout: 0.0, + max_retries: 0, + initial_retry_delay: 0.0, + max_retry_delay: 0.0, + headers: {}, + idempotency_header: nil ) - @requester = requester || PooledNetRequester.new - env_uri = URI.parse(server_uri_string) - @headers = headers - @host = env_uri.host - @scheme = env_uri.scheme&.to_sym - @port = env_uri.port - @max_retries = max_retries || DEFAULT_MAX_RETRIES + @requester = Orb::PooledNetRequester.new + @headers = Orb::Util.normalized_headers( + { + "X-Stainless-Lang" => "ruby", + "X-Stainless-Package-Version" => Orb::VERSION, + "X-Stainless-Runtime" => RUBY_ENGINE, + "X-Stainless-Runtime-Version" => RUBY_ENGINE_VERSION, + "Content-Type" => "application/json", + "Accept" => "application/json" + }, + headers + ) + @base_url = Orb::Util.parse_uri(base_url) + @idempotency_header = idempotency_header&.to_s&.downcase + @max_retries = max_retries + @timeout = timeout + @initial_retry_delay = initial_retry_delay + @max_retry_delay = max_retry_delay end - def auth_headers - {} - end + # @private + # + # @return [Hash{String=>String}] + # + private def auth_headers = {} - def resolve_uri_elements(req) - uri_components = - if req[:url] - uri = URI.parse(req[:url]) - { - host: uri.host, - scheme: uri.scheme, - path: uri.path, - query: uri.query, - port: uri.port - } - else - req.slice(:host, :scheme, :path, :port, :query) - end + # @private + # + # @return [String] + # + private def generate_idempotency_key = "stainless-ruby-retry-#{SecureRandom.uuid}" - uri_components[:query] = uri_components[:query]&.filter do |k, v| - !v.is_a? NotGiven + # @private + # + # @param req [Hash{Symbol=>Object}] . + # + # @option req [Symbol] :method + # + # @option req [String, Array] :path + # + # @option req [Hash{String=>Array, String, nil}, nil] :query + # + # @option req [Hash{String=>String, nil}, nil] :headers + # + # @option req [Object, nil] :body + # + # @option req [Symbol, nil] :unwrap + # + # @option req [Class, nil] :page + # + # @option req [Orb::Converter, Class, nil] :model + # + # @param opts [Hash{Symbol=>Object}] . + # + # @option opts [String, nil] :idempotency_key + # + # @option opts [Hash{String=>Array, String, nil}, nil] :extra_query + # + # @option opts [Hash{String=>String, nil}, nil] :extra_headers + # + # @option opts [Hash{Symbol=>Object}, nil] :extra_body + # + # @option opts [Integer, nil] :max_retries + # + # @option opts [Float, nil] :timeout + # + # @return [Hash{Symbol=>Object}] + # + private def build_request(req, opts) + method, uninterpolated_path = req.fetch_values(:method, :path) + + path = Orb::Util.interpolate_path(uninterpolated_path) + + headers = Orb::Util.normalized_headers( + @headers, + auth_headers, + *[req[:headers], opts[:extra_headers]].compact + ) + + if @idempotency_header && + !headers.key?(@idempotency_header) && + !Net::HTTP::IDEMPOTENT_METHODS_.include?(method.to_s.upcase) + headers[@idempotency_header] = opts.fetch(:idempotency_key) { generate_idempotency_key } end - uri_components - end - def prep_request(**options) - request_content = options[:request_content] - response_content = options[:response_content] - headers = @headers.dup + unless headers.key?("x-stainless-retry-count") + headers["x-stainless-retry-count"] = "0" + end - headers["Content-Type"] = "application/json" + timeout = opts.fetch(:timeout, @timeout).to_f.clamp((0..)) + unless headers.key?("x-stainless-read-timeout") or timeout.zero? + headers["x-stainless-read-timeout"] = timeout.to_s + end - headers["Accept"] = "application/json" + headers.reject! { |_, v| v.to_s.empty? } - method = options[:method].to_sym body = case method - when :post, :put, :patch - body = options[:body] - if body - # TODO(Ruby): bodies that aren't JSON, dummy. Same for responses. - # TODO(Ruby): bodies that aren't hashes. - to_send = - if body.is_a? Hash - body.filter { |k, v| !v.is_a? NotGiven }.to_h - else - body - end - JSON.dump to_send - end - else + in :get | :head | :options | :trace nil + else + Orb::Util.deep_merge(*[req[:body], opts[:extra_body]].compact) end - security_scheme = options[:security_scheme] - - { - method: method, - path: (@base_path || "") + (options[:path] || ""), - body: body, - headers: - headers - .merge(auth_headers) - .filter { |_k, v| !v.nil? } - .transform_values(&:to_s), - host: options[:host] || @host, - scheme: options[:scheme] || @scheme, - port: @port - }.merge(resolve_uri_elements(options)) + url = Orb::Util.join_parsed_uri(@base_url, {**req, path: path}) + headers, encoded = Orb::Util.encode_content(headers, body) + max_retries = opts.fetch(:max_retries, @max_retries) + {method: method, url: url, headers: headers, body: encoded, max_retries: max_retries, timeout: timeout} end - def should_retry?(response) - should_retry_header = response.header["x-should-retry"] - - case should_retry_header - when "true" - true - when "false" - false - else - response_code = response.code.to_i + # @private + # + # @param status [Integer] + # @param headers [Hash{String=>String}] + # + # @return [Boolean] + # + private def should_retry?(status, headers:) + coerced = Orb::Util.coerce_boolean(headers["x-should-retry"]) + case [coerced, status] + in [true | false, _] + coerced + in [_, 408 | 409 | 429 | (500..)] # retry on: # 408: timeouts # 409: locks # 429: rate limits # 500+: unknown errors - [408, 409, 429].include?(response_code) || response_code >= 500 + true + else + false end end - def make_status_error(err_msg:, body:, response:) - raise NotImplementedError - end + # @private + # + # @param headers [Hash{String=>String}] + # @param retry_count [Integer] + # + # @return [Float] + # + private def retry_delay(headers, retry_count:) + # Non-standard extension + span = Float(headers["retry-after-ms"], exception: false)&.then { _1 / 1000 } + return span if span - def make_status_error_from_response(response) - err_body = - begin - JSON.parse(response.body) - rescue StandardError - response - end + retry_header = headers["retry-after"] + return span if (span = Float(retry_header, exception: false)) - # NB: we include the body in the error message as well as returning it, - # since logging error messages is a common and quick way to assess what's wrong with a response. - err_msg = "Error code: #{response.code}; Response: #{response.body}" + span = retry_header && Orb::Util.suppress(ArgumentError) do + Time.httpdate(retry_header) - Time.now + end + return span if span - make_status_error(err_msg: err_msg, body: err_body, response: response) + scale = retry_count**2 + jitter = 1 - (0.25 * rand) + (@initial_retry_delay * scale * jitter).clamp(0, @max_retry_delay) end - # About the Retry-After header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After + # @private # - # ". See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After#syntax for - # details. - def header_based_retry(response) - begin - retry_after = response.header["retry-after"] - retry_after - .split(",") - .map do |element| - as_int = - begin - Integer(element) - rescue StandardError - end - - as_datetime = - begin - Time.httpdate(element) - Time.now - rescue StandardError - end - - [as_int, as_datetime].filter { |x| x }.max - end - rescue StandardError - end - end - - def with_retry(request) - delay = 0.5 - max_delay = 8.0 - tries = 0 - loop do - begin - response = @requester.execute request - is_ok = response.code.to_i < 400 - return response if is_ok - rescue Net::HTTPBadResponse - if tries >= @max_retries - raise HTTP::APIConnectionError.new(request: request) - end - rescue Timeout::Error - if tries >= @max_retries - raise HTTP::APITimeoutError.new(request: request) - end + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @option request [Object] :body + # + # @option request [Integer] :max_retries + # + # @option request [Float] :timeout + # + # @param status [Integer] + # + # @param location_header [String] + # + # @return [Hash{Symbol=>Object}] + # + private def follow_redirect(request, status:, location_header:) + method, url, headers = request.fetch_values(:method, :url, :headers) + location = + Orb::Util.suppress(ArgumentError) do + URI.join(url, location_header) end - if tries >= @max_retries && !should_retry?(response) - raise make_status_error_from_response(response) - end + unless location + message = "Server responded with status #{status} but no valid location header." + raise Orb::APIConnectionError.new(url: url, message: message) + end - tries += 1 - sleep delay - base_delay = header_based_retry(response) || (delay * (2**tries)) - jitter_factor = 1 - 0.25 * rand - delay = [max_delay, [0, base_delay * jitter_factor].max].min + request = {**request, url: location} + + case [url.scheme, location.scheme] + in ["https", "http"] + message = "Tried to redirect to a insecure URL" + raise Orb::APIConnectionError.new(url: url, message: message) + else + nil end - end - # TODO: (Ruby) specialized Ruby methods for http methods - def request(**options) - request_args = prep_request(**options) - # TODO: client-side errors (DNS resolution, timeouts, etc) - # TODO: response codes we don't like, 400 etc. - # TODO: passing retry config - response = with_retry(request_args) - - raw_data = - case response.content_type - when "application/problem+json" - # TODO(PR #2724) after that PR merges, this block shouldn't be necessary - raise StandardError.new("Failed with #{response.code}") - when "application/json" - begin - JSON.parse(response.body) - rescue JSON::ParserError - response.body - end - # TODO parsing other response types - else - response.body - end - if options[:page] - page = - options[:page].new(client: self, json: raw_data, request: options) - page.convert(**raw_data) - return page + # from whatwg fetch spec + case [status, method] + in [301 | 302, :post] | [303, _] + drop = %w[content-encoding content-language content-length content-location content-type] + request = { + **request, + method: method == :head ? :head : :get, + headers: headers.except(*drop), + body: nil + } + else end - model = options[:model] + # from undici + if Orb::Util.uri_origin(url) != Orb::Util.uri_origin(location) + drop = %w[authorization cookie host proxy-authorization] + request = {**request, headers: request.fetch(:headers).except(*drop)} + end - model ? Converter.convert(model, raw_data) : raw_data + request end - end - module HTTP - class Error < StandardError - end + # @private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @option request [Object] :body + # + # @option request [Integer] :max_retries + # + # @option request [Float] :timeout + # + # @param redirect_count [Integer] + # + # @param retry_count [Integer] + # + # @param send_retry_header [Boolean] + # + # @raise [Orb::APIError] + # @return [Net::HTTPResponse] + # + private def send_request(request, redirect_count:, retry_count:, send_retry_header:) + url, headers, body, max_retries = request.fetch_values(:url, :headers, :body, :max_retries) + no_retry = retry_count >= max_retries || body.is_a?(IO) || body.is_a?(StringIO) - class ResponseError < Error - attr_reader :err_msg, :response, :body, :code - def initialize(err_msg:, response:, body:) - @err_msg = err_msg - @response = response - @body = body - @code = response.code.to_i + if send_retry_header + headers["x-stainless-retry-count"] = retry_count.to_s end - end - class RequestError < Error - attr_reader :request - def initialize(request:) - @request = request + begin + response = @requester.execute(request) + status = Integer(response.code) + rescue Orb::APIConnectionError => e + status = e end - end - class BadRequestError < ResponseError - end - class AuthenticationError < ResponseError - end - class PermissionDeniedError < ResponseError - end - class NotFoundError < ResponseError - end - class ConflictError < ResponseError - end - class UnprocessableEntityError < ResponseError - end - class RateLimitError < ResponseError - end - class InternalServerError < ResponseError + case status + in ..299 + response + in 300..399 if redirect_count >= MAX_REDIRECTS + message = "Failed to complete the request within #{MAX_REDIRECTS} redirects." + raise Orb::APIConnectionError.new(url: url, message: message) + in 300..399 + request = follow_redirect(request, status: status, location_header: response["location"]) + send_request( + request, + redirect_count: redirect_count + 1, + retry_count: retry_count, + send_retry_header: send_retry_header + ) + in Orb::APIConnectionError if retry_count >= max_retries + raise status + in (400..) if no_retry || (response && !should_retry?(status, headers: response)) + body = Orb::Util.decode_content(response, suppress_error: true) + + raise Orb::APIStatusError.for( + url: url, + status: status, + body: body, + request: nil, + response: response + ) + in (400..) | Orb::APIConnectionError + delay = retry_delay(response, retry_count: retry_count) + sleep(delay) + + send_request( + request, + redirect_count: redirect_count, + retry_count: retry_count + 1, + send_retry_header: send_retry_header + ) + end end - class APIStatusError < ResponseError + + # @private + # + # @param req [Hash{Symbol=>Object}] . + # + # @option req [Symbol] :method + # + # @option req [String, Array] :path + # + # @option req [Hash{String=>Array, String, nil}, nil] :query + # + # @option req [Hash{String=>String, nil}, nil] :headers + # + # @option req [Object, nil] :body + # + # @option req [Symbol, nil] :unwrap + # + # @option req [Class, nil] :page + # + # @option req [Orb::Converter, Class, nil] :model + # + # @option req [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :options + # + # @param response [nil] + # + # @return [Object] + # + private def parse_response(req, response) + parsed = Orb::Util.decode_content(response) + unwrapped = Orb::Util.dig(parsed, req[:unwrap]) + + page = req[:page] + model = req.fetch(:model, Orb::Unknown) + case [page, model] + in [Class, Class | Orb::Converter | nil] + page.new(client: self, req: req, headers: response, unwrapped: unwrapped) + in [nil, Class | Orb::Converter] + Orb::Converter.coerce(model, unwrapped) + in [nil, nil] + unwrapped + end end - class APIConnectionError < RequestError + + # Execute the request specified by `req`. This is the method that all resource + # methods call into. + # + # @param req [Hash{Symbol=>Object}] . + # + # @option req [Symbol] :method + # + # @option req [String, Array] :path + # + # @option req [Hash{String=>Array, String, nil}, nil] :query + # + # @option req [Hash{String=>String, nil}, nil] :headers + # + # @option req [Object, nil] :body + # + # @option req [Symbol, nil] :unwrap + # + # @option req [Class, nil] :page + # + # @option req [Orb::Converter, Class, nil] :model + # + # @option req [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :options + # + # @raise [Orb::APIError] + # @return [Object] + # + def request(req) + self.class.validate!(req) + opts = req[:options].to_h + Orb::RequestOptions.validate!(opts) + request = build_request(req, opts) + + # Don't send the current retry count in the headers if the caller modified the header defaults. + send_retry_header = request.fetch(:headers)["x-stainless-retry-count"] == "0" + response = send_request( + request, + redirect_count: 0, + retry_count: 0, + send_retry_header: send_retry_header + ) + parse_response(req, response) end - class APITimeoutError < RequestError + + # @return [String] + # + def inspect + base_url = Orb::Util.unparse_uri(@base_url) + "#<#{self.class.name}:0x#{object_id.to_s(16)} base_url=#{base_url} max_retries=#{@max_retries} timeout=#{@timeout}>" end end end diff --git a/lib/orb/base_model.rb b/lib/orb/base_model.rb new file mode 100644 index 00000000..bf9ec66a --- /dev/null +++ b/lib/orb/base_model.rb @@ -0,0 +1,1189 @@ +# frozen_string_literal: true + +module Orb + # @private + # + # @abstract + # + module Converter + # rubocop:disable Lint/UnusedMethodArgument + + # @private + # + # @param value [Object] + # + # @return [Object] + # + def coerce(value) = value + + # @private + # + # @param value [Object] + # + # @return [Object] + # + def dump(value) = value + + # @private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + # + def try_strict_coerce(value) = (raise NotImplementedError) + + # rubocop:enable Lint/UnusedMethodArgument + + class << self + # @private + # + # @param spec [Hash{Symbol=>Object}, Proc, Orb::Converter, Class] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + # @return [Proc] + # + def type_info(spec) + case spec + in Hash + type_info(spec.slice(:const, :enum, :union).first&.last) + in Proc + spec + in Orb::Converter | Class + -> { spec } + in true | false + -> { Orb::BooleanModel } + in NilClass | true | false | Symbol | Integer | Float + -> { spec.class } + end + end + + # @private + # + # Based on `target`, transform `value` into `target`, to the extent possible: + # + # 1. if the given `value` conforms to `target` already, return the given `value` + # 2. if it's possible and safe to convert the given `value` to `target`, then the + # converted value + # 3. otherwise, the given `value` unaltered + # + # @param target [Orb::Converter, Class] + # @param value [Object] + # + # @return [Object] + # + def coerce(target, value) + case target + in Orb::Converter + target.coerce(value) + in Class + case target + in -> { _1 <= NilClass } + nil + in -> { _1 <= Integer } + value.is_a?(Numeric) ? Integer(value) : value + in -> { _1 <= Float } + value.is_a?(Numeric) ? Float(value) : value + in -> { _1 <= Symbol } + value.is_a?(String) ? value.to_sym : value + in -> { _1 <= String } + value.is_a?(Symbol) ? value.to_s : value + in -> { _1 <= Date || _1 <= Time } + value.is_a?(String) ? target.parse(value) : value + in -> { _1 <= IO } + value.is_a?(String) ? StringIO.new(value) : value + else + value + end + end + end + + # @private + # + # @param target [Orb::Converter, Class] + # @param value [Object] + # + # @return [Object] + # + def dump(target, value) + case target + in Orb::Converter + target.dump(value) + else + value + end + end + + # @private + # + # The underlying algorithm for computing maximal compatibility is subject to + # future improvements. + # + # Similar to `#.coerce`, used to determine the best union variant to decode into. + # + # 1. determine if strict-ish coercion is possible + # 2. return either result of successful coercion or if loose coercion is possible + # 3. return a score for recursively tallied count for fields that can be coerced + # + # @param target [Orb::Converter, Class] + # @param value [Object] + # + # @return [Object] + # + def try_strict_coerce(target, value) + case target + in Orb::Converter + target.try_strict_coerce(value) + in Class + case [target, value] + in [-> { _1 <= NilClass }, _] + [true, nil, value.nil? ? 1 : 0] + in [-> { _1 <= Integer }, Numeric] + [true, Integer(value), 1] + in [-> { _1 <= Float }, Numeric] + [true, Float(value), 1] + in [-> { _1 <= String }, Symbol] + [true, value.to_s, 1] + in [-> { _1 <= Date || _1 <= Time }, String] + Orb::Util.suppress(ArgumentError, Date::Error) do + return [true, target.parse(value), 1] + end + [false, false, 0] + in [_, ^target] + [true, value, 1] + else + [false, false, 0] + end + end + end + end + end + + # @private + # + # @abstract + # + # When we don't know what to expect for the value. + class Unknown + extend Orb::Converter + + # rubocop:disable Lint/UnusedMethodArgument + + private_class_method :new + + # @param other [Object] + # + # @return [Boolean] + # + def self.===(other) = true + + # @param other [Object] + # + # @return [Boolean] + # + def self.==(other) = other.is_a?(Class) && other <= Orb::Unknown + + # @!parse + # # @private + # # + # # @param value [Object] + # # + # # @return [Object] + # # + # def self.coerce(value) = super + + # @!parse + # # @private + # # + # # @param value [Object] + # # + # # @return [Object] + # # + # def self.dump(value) = super + + # @private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + # + def self.try_strict_coerce(value) + # prevent unknown variant from being chosen during the first coercion pass + [false, true, 0] + end + + # rubocop:enable Lint/UnusedMethodArgument + end + + # @private + # + # @abstract + # + # Ruby has no Boolean class; this is something for models to refer to. + class BooleanModel + extend Orb::Converter + + private_class_method :new + + # @param other [Object] + # + # @return [Boolean] + # + def self.===(other) = other == true || other == false + + # @param other [Object] + # + # @return [Boolean] + # + def self.==(other) = other.is_a?(Class) && other <= Orb::BooleanModel + + # @!parse + # # @private + # # + # # @param value [Boolean, Object] + # # + # # @return [Boolean, Object] + # # + # def self.coerce(value) = super + + # @!parse + # # @private + # # + # # @param value [Boolean, Object] + # # + # # @return [Boolean, Object] + # # + # def self.dump(value) = super + + # @private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + # + def self.try_strict_coerce(value) + case value + in true | false + [true, value, 1] + else + [false, false, 0] + end + end + end + + # @private + # + # @abstract + # + # A value from among a specified list of options. OpenAPI enum values map to Ruby + # values in the SDK as follows: + # + # 1. boolean => true | false + # 2. integer => Integer + # 3. float => Float + # 4. string => Symbol + # + # We can therefore convert string values to Symbols, but can't convert other + # values safely. + class Enum + extend Orb::Converter + + # All of the valid Symbol values for this enum. + # + # @return [Array] + # + def self.values = (@values ||= constants.map { const_get(_1) }) + + # @private + # + # Guard against thread safety issues by instantiating `@values`. + # + private_class_method def self.finalize! = values + + private_class_method :new + + # @param other [Object] + # + # @return [Boolean] + # + def self.===(other) = values.include?(other) + + # @param other [Object] + # + # @return [Boolean] + # + def self.==(other) + other.is_a?(Class) && other <= Orb::Enum && other.values.to_set == values.to_set + end + + # @private + # + # @param value [String, Symbol, Object] + # + # @return [Symbol, Object] + # + def self.coerce(value) = (value.is_a?(String) ? value.to_sym : value) + + # @!parse + # # @private + # # + # # @param value [Symbol, Object] + # # + # # @return [Symbol, Object] + # # + # def self.dump(value) = super + + # @private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + # + def self.try_strict_coerce(value) + return [true, value, 1] if values.include?(value) + + case value + in String if values.include?(val = value.to_sym) + [true, val, 1] + else + case [value, values.first] + in [true | false, true | false] | [Integer, Integer] | [Symbol | String, Symbol] + [false, true, 0] + else + [false, false, 0] + end + end + end + end + + # @private + # + # @abstract + # + class Union + extend Orb::Extern + extend Orb::Converter + + # @private + # + # All of the specified variant info for this union. + # + # @return [Array] + # + private_class_method def self.known_variants = (@known_variants ||= []) + + class << self + # @private + # + # All of the specified variants for this union. + # + # @return [Array] + # + protected def variants + @known_variants.map { |key, variant_fn| [key, variant_fn.call] } + end + end + + # @private + # + # @param property [Symbol] + # + private_class_method def self.discriminator(property) + case property + in Symbol + @discriminator = property + end + end + + # @private + # + # @param key [Symbol, Hash{Symbol=>Object}, Proc, Orb::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}, Proc, Orb::Converter, Class] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + private_class_method def self.variant(key, spec = nil) + variant_info = + case key + in Symbol + [key, Orb::Converter.type_info(spec)] + in Proc | Orb::Converter | Class | Hash + [nil, Orb::Converter.type_info(key)] + end + + known_variants << variant_info + end + + # @private + # + # @param value [Object] + # + # @return [Orb::Converter, Class, nil] + # + private_class_method def self.resolve_variant(value) + case [@discriminator, value] + in [_, Orb::BaseModel] + value.class + in [Symbol, Hash] + key = + if value.key?(@discriminator) + value.fetch(@discriminator) + elsif value.key?((discriminator = @discriminator.to_s)) + value.fetch(discriminator) + end + + key = key.to_sym if key.is_a?(String) + _, resolved = known_variants.find { |k,| k == key } + resolved.nil? ? Orb::Unknown : resolved.call + else + nil + end + end + + # rubocop:disable Style/HashEachMethods + # rubocop:disable Style/CaseEquality + + private_class_method :new + + # @param other [Object] + # + # @return [Boolean] + # + def self.===(other) + known_variants.any? do |_, variant_fn| + variant_fn.call === other + end + end + + # @param other [Object] + # + # @return [Boolean] + # + def self.==(other) + other.is_a?(Class) && other <= Orb::Union && other.variants == variants + end + + # @private + # + # @param value [Object] + # + # @return [Object] + # + def self.coerce(value) + if (variant = resolve_variant(value)) + return Orb::Converter.coerce(variant, value) + end + + matches = [] + + known_variants.each do |_, variant_fn| + variant = variant_fn.call + + case Orb::Converter.try_strict_coerce(variant, value) + in [true, coerced, _] + return coerced + in [false, true, score] + matches << [score, variant] + in [false, false, _] + nil + end + end + + # rubocop:disable Style/NumberedParametersLimit + _, variant = matches.sort! { _2.first <=> _1.first }.find { |score,| !score.zero? } + # rubocop:enable Style/NumberedParametersLimit + variant.nil? ? value : Orb::Converter.coerce(variant, value) + end + + # @private + # + # @param value [Object] + # + # @return [Object] + # + def self.dump(value) + if (variant = resolve_variant(value)) + return Orb::Converter.dump(variant, value) + end + + known_variants.each do |_, variant_fn| + variant = variant_fn.call + if variant === value + return Orb::Converter.dump(variant, value) + end + end + value + end + + # @private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + # + def self.try_strict_coerce(value) + # TODO(ruby) this will result in super linear decoding behaviour for nested unions + # follow up with a decoding context that captures current strictness levels + if (variant = resolve_variant(value)) + return Converter.try_strict_coerce(variant, value) + end + + coercible = false + max_score = 0 + + known_variants.each do |_, variant_fn| + variant = variant_fn.call + + case Orb::Converter.try_strict_coerce(variant, value) + in [true, coerced, score] + return [true, coerced, score] + in [false, true, score] + coercible = true + max_score = [max_score, score].max + in [false, false, _] + nil + end + end + + [false, coercible, max_score] + end + + # rubocop:enable Style/CaseEquality + # rubocop:enable Style/HashEachMethods + end + + # @private + # + # @abstract + # + # Array of items of a given type. + class ArrayOf + include Orb::Converter + + private_class_method :new + + def self.[](...) = new(...) + + # @param other [Object] + # + # @return [Boolean] + # + def ===(other) + type = item_type + case other + in Array + # rubocop:disable Style/CaseEquality + other.all? { |item| type === item } + # rubocop:enable Style/CaseEquality + else + false + end + end + + # @param other [Object] + # + # @return [Boolean] + # + def ==(other) = other.is_a?(Orb::ArrayOf) && other.item_type == item_type + + # @private + # + # @param value [Enumerable, Object] + # + # @return [Array, Object] + # + def coerce(value) + type = item_type + case value + in Enumerable unless value.is_a?(Hash) + value.map { |item| Orb::Converter.coerce(type, item) } + else + value + end + end + + # @private + # + # @param value [Enumerable, Object] + # + # @return [Array, Object] + # + def dump(value) + type = item_type + case value + in Enumerable unless value.is_a?(Hash) + value.map { |item| Orb::Converter.dump(type, item) }.to_a + else + value + end + end + + # @private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + # + def try_strict_coerce(value) + case value + in Array + type = item_type + great_success = true + tally = 0 + + mapped = + value.map do |item| + case Orb::Converter.try_strict_coerce(type, item) + in [true, coerced, score] + tally += score + coerced + in [false, true, score] + great_success = false + tally += score + item + in [false, false, _] + great_success &&= item.nil? + item + end + end + + if great_success + [true, mapped, tally] + else + [false, true, tally] + end + else + [false, false, 0] + end + end + + # @private + # + # @return [Orb::Converter, Class] + # + protected def item_type = @item_type_fn.call + + # @private + # + # @param type_info [Hash{Symbol=>Object}, Proc, Orb::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + def initialize(type_info, spec = {}) + @item_type_fn = Orb::Converter.type_info(type_info || spec) + end + end + + # @private + # + # @abstract + # + # Hash of items of a given type. + class HashOf + include Orb::Converter + + private_class_method :new + + def self.[](...) = new(...) + + # @param other [Object] + # + # @return [Boolean] + # + def ===(other) + type = item_type + case other + in Hash + other.all? do |key, val| + case [key, val] + in [Symbol | String, ^type] + true + else + false + end + end + else + false + end + end + + # @param other [Object] + # + # @return [Boolean] + # + def ==(other) = other.is_a?(Orb::HashOf) && other.item_type == item_type + + # @private + # + # @param value [Hash{Object=>Object}, Object] + # + # @return [Hash{Symbol=>Object}, Object] + # + def coerce(value) + type = item_type + case value + in Hash + value.to_h do |key, val| + coerced = Orb::Converter.coerce(type, val) + [key.is_a?(String) ? key.to_sym : key, coerced] + end + else + value + end + end + + # @private + # + # @param value [Hash{Object=>Object}, Object] + # + # @return [Hash{Symbol=>Object}, Object] + # + def dump(value) + type = item_type + case value + in Hash + value.transform_values do |val| + Orb::Converter.dump(type, val) + end + else + value + end + end + + # @private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + # + def try_strict_coerce(value) + case value + in Hash + type = item_type + great_success = true + tally = 0 + + mapped = + value.transform_values do |val| + case Orb::Converter.try_strict_coerce(type, val) + in [true, coerced, score] + tally += score + coerced + in [false, true, score] + great_success = false + tally += score + val + in [false, false, _] + great_success &&= val.nil? + val + end + end + + if great_success + [true, mapped, tally] + else + [false, true, tally] + end + else + [false, false, 0] + end + end + + # @private + # + # @return [Orb::Converter, Class] + # + protected def item_type = @item_type_fn.call + + # @private + # + # @param type_info [Hash{Symbol=>Object}, Proc, Orb::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + def initialize(type_info, spec = {}) + @item_type_fn = Orb::Converter.type_info(type_info || spec) + end + end + + # @private + # + # @abstract + # + class BaseModel + extend Orb::Extern + extend Orb::Converter + + # @private + # + # Assumes superclass fields are totally defined before fields are accessed / + # defined on subclasses. + # + # @return [Hash{Symbol=>Hash{Symbol=>Object}}] + # + def self.known_fields + @known_fields ||= (self < Orb::BaseModel ? superclass.known_fields.dup : {}) + end + + class << self + # @private + # + # @return [Hash{Symbol=>Hash{Symbol=>Object}}] + # + def fields + known_fields.transform_values do |field| + {**field.except(:type_fn), type: field.fetch(:type_fn).call} + end + end + end + + # @private + # + # @return [Hash{Symbol=>Proc}] + # + def self.defaults = (@defaults ||= {}) + + # @private + # + # @param name_sym [Symbol] + # + # @param required [Boolean] + # + # @param type_info [Hash{Symbol=>Object}, Proc, Orb::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + private_class_method def self.add_field(name_sym, required:, type_info:, spec:) + type_fn, info = + case type_info + in Proc | Class | Orb::Converter + [Orb::Converter.type_info({**spec, union: type_info}), spec] + in Hash + [Orb::Converter.type_info(type_info), type_info] + end + + fallback = info[:const] + defaults[name_sym] = fallback if required && !info[:nil?] && info.key?(:const) + + key = info.fetch(:api_name, name_sym) + setter = "#{name_sym}=" + + if known_fields.key?(name_sym) + [name_sym, setter].each { |name| undef_method(name) } + end + + known_fields[name_sym] = {mode: @mode, key: key, required: required, type_fn: type_fn} + + define_method(setter) do |val| + @data[key] = val + end + + define_method(name_sym) do + field_type = type_fn.call + value = @data.fetch(key) { self.class.defaults[key] } + Orb::Converter.coerce(field_type, value) + rescue StandardError + name = self.class.name.split("::").last + raise Orb::ConversionError.new( + "Failed to parse #{name}.#{name_sym} as #{field_type.inspect}. " \ + "To get the unparsed API response, use #{name}[:#{key}]." + ) + end + end + + # @private + # + # @param name_sym [Symbol] + # + # @param type_info [Hash{Symbol=>Object}, Proc, Orb::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + def self.required(name_sym, type_info, spec = {}) + add_field(name_sym, required: true, type_info: type_info, spec: spec) + end + + # @private + # + # @param name_sym [Symbol] + # + # @param type_info [Hash{Symbol=>Object}, Proc, Orb::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + def self.optional(name_sym, type_info, spec = {}) + add_field(name_sym, required: false, type_info: type_info, spec: spec) + end + + # @private + # + # `request_only` attributes not excluded from `.#coerce` when receiving responses + # even if well behaved servers should not send them + # + # @param blk [Proc] + # + private_class_method def self.request_only(&blk) + @mode = :dump + blk.call + ensure + @mode = nil + end + + # @private + # + # `response_only` attributes are omitted from `.#dump` when making requests + # + # @param blk [Proc] + # + private_class_method def self.response_only(&blk) + @mode = :coerce + blk.call + ensure + @mode = nil + end + + # @param other [Object] + # + # @return [Boolean] + # + def ==(other) + case other + in Orb::BaseModel + self.class.fields == other.class.fields && @data == other.to_h + else + false + end + end + + # @private + # + # @param value [Orb::BaseModel, Hash{Object=>Object}, Object] + # + # @return [Orb::BaseModel, Object] + # + def self.coerce(value) + case (coerced = Orb::Util.coerce_hash(value)) + in Hash + new(coerced) + else + value + end + end + + # @private + # + # @param value [Orb::BaseModel, Object] + # + # @return [Hash{Object=>Object}, Object] + # + def self.dump(value) + unless (coerced = Orb::Util.coerce_hash(value)).is_a?(Hash) + return value + end + + values = coerced.filter_map do |key, val| + name = key.to_sym + case (field = known_fields[name]) + in nil + [name, val] + else + mode, type_fn, api_name = field.fetch_values(:mode, :type_fn, :key) + case mode + in :coerce + next + else + target = type_fn.call + [api_name, Orb::Converter.dump(target, val)] + end + end + end.to_h + + defaults.each do |key, val| + next if values.key?(key) + + values[key] = val + end + + values + end + + # @private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + # + def self.try_strict_coerce(value) + case value + in Hash | Orb::BaseModel + value = value.to_h + else + return [false, false, 0] + end + + keys = value.keys.to_set + great_success = true + tally = 0 + acc = {} + + known_fields.each_value do |field| + mode, required, type_fn, api_name = field.fetch_values(:mode, :required, :type_fn, :key) + keys.delete(api_name) + + case [required && mode != :dump, value.key?(api_name)] + in [_, true] + target = type_fn.call + item = value.fetch(api_name) + case Orb::Converter.try_strict_coerce(target, item) + in [true, coerced, score] + tally += score + acc[api_name] = coerced + in [false, true, score] + great_success = false + tally += score + acc[api_name] = item + in [false, false, _] + great_success &&= item.nil? + end + in [true, false] + great_success = false + in [false, false] + nil + end + end + + keys.each do |key| + acc[key] = value.fetch(key) + end + + great_success ? [true, new(acc), tally] : [false, true, tally] + end + + # Returns the raw value associated with the given key, if found. Otherwise, nil is + # returned. + # + # It is valid to lookup keys that are not in the API spec, for example to access + # undocumented features. This method does not parse response data into + # higher-level types. Lookup by anything other than a Symbol is an ArgumentError. + # + # @param key [Symbol] + # + # @return [Object, nil] + # + def [](key) + unless key.instance_of?(Symbol) + raise ArgumentError.new("Expected symbol key for lookup, got #{key.inspect}") + end + + @data[key] + end + + # Returns a Hash of the data underlying this object. O(1) + # + # Keys are Symbols and values are the raw values from the response. The return + # value indicates which values were ever set on the object. i.e. there will be a + # key in this hash if they ever were, even if the set value was nil. + # + # This method is not recursive. The returned value is shared by the object, so it + # should not be mutated. + # + # @return [Hash{Symbol=>Object}] + # + def to_h = @data + + alias_method :to_hash, :to_h + + # @param keys [Array, nil] + # + # @return [Hash{Symbol=>Object}] + # + def deconstruct_keys(keys) + (keys || self.class.known_fields.keys).filter_map do |k| + unless self.class.known_fields.key?(k) + next + end + + [k, method(k).call] + end + .to_h + end + + # Create a new instance of a model. + # + # @param data [Hash{Symbol=>Object}, Orb::BaseModel] + # + def initialize(data = {}) + case (coerced = Orb::Util.coerce_hash(data)) + in Hash + @data = coerced.transform_keys(&:to_sym) + else + raise ArgumentError.new("Expected a #{Hash} or #{Orb::BaseModel}, got #{data.inspect}") + end + end + + # @return [String] + # + def to_s = @data.to_s + + # @return [String] + # + def inspect + "#<#{self.class.name}:0x#{object_id.to_s(16)} #{deconstruct_keys(nil).map do |k, v| + "#{k}=#{v.inspect}" + end.join(' ')}>" + end + end +end diff --git a/lib/orb/base_page.rb b/lib/orb/base_page.rb new file mode 100644 index 00000000..f8a32ac1 --- /dev/null +++ b/lib/orb/base_page.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Orb + # @private + # + # @abstract + # + module BasePage + # rubocop:disable Lint/UnusedMethodArgument + + # @return [Boolean] + # + def next_page? = (raise NotImplementedError) + + # @raise [Orb::APIError] + # @return [Orb::BasePage] + # + def next_page = (raise NotImplementedError) + + # @param blk [Proc] + # + # @return [void] + # + def auto_paging_each(&blk) = (raise NotImplementedError) + + # @return [Enumerable] + # + def to_enum = super(:auto_paging_each) + + alias_method :enum_for, :to_enum + + # @!parse + # # @private + # # + # # @param client [Orb::BaseClient] + # # @param req [Hash{Symbol=>Object}] + # # @param headers [Hash{String=>String}] + # # @param unwrapped [Object] + # # + # def initialize(client:, req:, headers:, unwrapped:); end + + # rubocop:enable Lint/UnusedMethodArgument + end +end diff --git a/lib/orb/base_pagination.rb b/lib/orb/base_pagination.rb deleted file mode 100644 index 7daaf3a9..00000000 --- a/lib/orb/base_pagination.rb +++ /dev/null @@ -1,32 +0,0 @@ -# typed: true -require "orb/util" - -module Orb - module Pagination - module Page - def next_page? - raise NotImplementedError - end - - def page_items - raise NotImplementedError - end - - def get_next_page - @client.request(**Orb::Util.deep_merge(@request, next_page_options)) - end - - def next_page_options - raise NotImplementedError - end - - def auto_paging_each(&block) - page_response = @client.request(**@request) - while page_response.next_page? - page_response = page_response.get_next_page - page_response&.page_items&.each(&block) - end - end - end - end -end diff --git a/lib/orb/client.rb b/lib/orb/client.rb new file mode 100644 index 00000000..cd1a421f --- /dev/null +++ b/lib/orb/client.rb @@ -0,0 +1,130 @@ +# frozen_string_literal: true + +module Orb + class Client < Orb::BaseClient + # Default max number of retries to attempt after a failed retryable request. + DEFAULT_MAX_RETRIES = 2 + + # Default per-request timeout. + DEFAULT_TIMEOUT_IN_SECONDS = 60.0 + + # Default initial retry delay in seconds. + # Overall delay is calculated using exponential backoff + jitter. + DEFAULT_INITIAL_RETRY_DELAY = 0.5 + + # Default max retry delay in seconds. + DEFAULT_MAX_RETRY_DELAY = 8.0 + + # Client option + # @return [String] + attr_reader :api_key + + # @return [Orb::Resources::TopLevel] + attr_reader :top_level + + # @return [Orb::Resources::Coupons] + attr_reader :coupons + + # @return [Orb::Resources::CreditNotes] + attr_reader :credit_notes + + # @return [Orb::Resources::Customers] + attr_reader :customers + + # @return [Orb::Resources::Events] + attr_reader :events + + # @return [Orb::Resources::InvoiceLineItems] + attr_reader :invoice_line_items + + # @return [Orb::Resources::Invoices] + attr_reader :invoices + + # @return [Orb::Resources::Items] + attr_reader :items + + # @return [Orb::Resources::Metrics] + attr_reader :metrics + + # @return [Orb::Resources::Plans] + attr_reader :plans + + # @return [Orb::Resources::Prices] + attr_reader :prices + + # @return [Orb::Resources::Subscriptions] + attr_reader :subscriptions + + # @return [Orb::Resources::Alerts] + attr_reader :alerts + + # @return [Orb::Resources::DimensionalPriceGroups] + attr_reader :dimensional_price_groups + + # @private + # + # @return [Hash{String=>String}] + # + private def auth_headers + {"Authorization" => "Bearer #{@api_key}"} + end + + # Creates and returns a new client for interacting with the API. + # + # @param base_url [String, nil] Override the default base URL for the API, e.g., `"https://api.example.com/v2/"` + # + # @param api_key [String, nil] Defaults to `ENV["ORB_API_KEY"]` + # + # @param max_retries [Integer] Max number of retries to attempt after a failed retryable request. + # + # @param timeout [Float] + # + # @param initial_retry_delay [Float] + # + # @param max_retry_delay [Float] + # + # @param idempotency_header [String] + # + def initialize( + base_url: nil, + api_key: ENV["ORB_API_KEY"], + max_retries: DEFAULT_MAX_RETRIES, + timeout: DEFAULT_TIMEOUT_IN_SECONDS, + initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY, + max_retry_delay: DEFAULT_MAX_RETRY_DELAY, + idempotency_header: "Idempotency-Key" + ) + base_url ||= "https://api.withorb.com/v1" + + if api_key.nil? + raise ArgumentError.new("api_key is required") + end + + @api_key = api_key.to_s + + super( + base_url: base_url, + timeout: timeout, + max_retries: max_retries, + initial_retry_delay: initial_retry_delay, + max_retry_delay: max_retry_delay, + idempotency_header: idempotency_header + ) + + @top_level = Orb::Resources::TopLevel.new(client: self) + @coupons = Orb::Resources::Coupons.new(client: self) + @credit_notes = Orb::Resources::CreditNotes.new(client: self) + @customers = Orb::Resources::Customers.new(client: self) + @events = Orb::Resources::Events.new(client: self) + @invoice_line_items = Orb::Resources::InvoiceLineItems.new(client: self) + @invoices = Orb::Resources::Invoices.new(client: self) + @items = Orb::Resources::Items.new(client: self) + @metrics = Orb::Resources::Metrics.new(client: self) + @plans = Orb::Resources::Plans.new(client: self) + @prices = Orb::Resources::Prices.new(client: self) + @subscriptions = Orb::Resources::Subscriptions.new(client: self) + @alerts = Orb::Resources::Alerts.new(client: self) + @dimensional_price_groups = Orb::Resources::DimensionalPriceGroups.new(client: self) + end + end +end diff --git a/lib/orb/errors.rb b/lib/orb/errors.rb new file mode 100644 index 00000000..d7cd0799 --- /dev/null +++ b/lib/orb/errors.rb @@ -0,0 +1,284 @@ +# frozen_string_literal: true + +module Orb + class Error < StandardError + # @!parse + # # @return [StandardError, nil] + # attr_reader :cause + end + + class ConversionError < Orb::Error + end + + class APIError < Orb::Error + # @return [URI::Generic] + attr_reader :url + + # @return [Integer, nil] + attr_reader :status + + # @return [Object, nil] + attr_reader :body + + # @private + # + # @param url [URI::Generic] + # @param status [Integer, nil] + # @param body [Object, nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + # + def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil) + @url = url + @status = status + @body = body + @request = request + @response = response + super(message) + end + end + + class APIConnectionError < Orb::APIError + # @!parse + # # @return [nil] + # attr_reader :status + + # @!parse + # # @return [nil] + # attr_reader :body + + # @private + # + # @param url [URI::Generic] + # @param status [nil] + # @param body [nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + # + def initialize( + url:, + status: nil, + body: nil, + request: nil, + response: nil, + message: "Connection error." + ) + super + end + end + + class APITimeoutError < Orb::APIConnectionError + # @private + # + # @param url [URI::Generic] + # @param status [nil] + # @param body [nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + # + def initialize( + url:, + status: nil, + body: nil, + request: nil, + response: nil, + message: "Request timed out." + ) + super + end + end + + class APIStatusError < Orb::APIError + # @private + # + # @param url [URI::Generic] + # @param status [Integer] + # @param body [Object, nil] + # @param request [nil] + # @param response [nil] + # + # @return [Orb::APIStatusError] + # + def self.for(url:, status:, body:, request:, response:) + key = Orb::Util.dig(body, :type) + kwargs = {url: url, status: status, body: body, request: request, response: response} + + case [status, key] + in [400, Orb::ConstraintViolation::TYPE] + Orb::ConstraintViolation.new(**kwargs) + in [400, Orb::DuplicateResourceCreation::TYPE] + Orb::DuplicateResourceCreation.new(**kwargs) + in [400, Orb::FeatureNotAvailable::TYPE] + Orb::FeatureNotAvailable.new(**kwargs) + in [400, Orb::RequestValidationError::TYPE] + Orb::RequestValidationError.new(**kwargs) + in [401, Orb::OrbAuthenticationError::TYPE] + Orb::OrbAuthenticationError.new(**kwargs) + in [404, Orb::ResourceNotFound::TYPE] + Orb::ResourceNotFound.new(**kwargs) + in [404, Orb::URLNotFound::TYPE] + Orb::URLNotFound.new(**kwargs) + in [409, Orb::ResourceConflict::TYPE] + Orb::ResourceConflict.new(**kwargs) + in [413, Orb::RequestTooLarge::TYPE] + Orb::RequestTooLarge.new(**kwargs) + in [413, Orb::ResourceTooLarge::TYPE] + Orb::ResourceTooLarge.new(**kwargs) + in [429, Orb::TooManyRequests::TYPE] + Orb::TooManyRequests.new(**kwargs) + in [500, Orb::OrbInternalServerError::TYPE] + Orb::OrbInternalServerError.new(**kwargs) + in [400, _] + Orb::BadRequestError.new(**kwargs) + in [401, _] + Orb::AuthenticationError.new(**kwargs) + in [403, _] + Orb::PermissionDeniedError.new(**kwargs) + in [404, _] + Orb::NotFoundError.new(**kwargs) + in [409, _] + Orb::ConflictError.new(**kwargs) + in [422, _] + Orb::UnprocessableEntityError.new(**kwargs) + in [429, _] + Orb::RateLimitError.new(**kwargs) + in [(500..), _] + Orb::InternalServerError.new(**kwargs) + else + Orb::APIStatusError.new(**kwargs) + end + end + + # @!parse + # # @return [Integer] + # attr_reader :status + + # @private + # + # @param url [URI::Generic] + # @param status [Integer] + # @param body [Object, nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + # + def initialize(url:, status:, body:, request:, response:, message: nil) + message ||= {url: url.to_s, status: status, body: body} + super( + url: url, + status: status, + body: body, + request: request, + response: response, + message: message&.to_s + ) + end + end + + class BadRequestError < Orb::APIStatusError + HTTP_STATUS = 400 + end + + class AuthenticationError < Orb::APIStatusError + HTTP_STATUS = 401 + end + + class PermissionDeniedError < Orb::APIStatusError + HTTP_STATUS = 403 + end + + class NotFoundError < Orb::APIStatusError + HTTP_STATUS = 404 + end + + class ConflictError < Orb::APIStatusError + HTTP_STATUS = 409 + end + + class UnprocessableEntityError < Orb::APIStatusError + HTTP_STATUS = 422 + end + + class RateLimitError < Orb::APIStatusError + HTTP_STATUS = 429 + end + + class InternalServerError < Orb::APIStatusError + HTTP_STATUS = (500..) + end + + class ConstraintViolation < Orb::APIStatusError + HTTP_STATUS = 400 + + TYPE = "https://docs.withorb.com/reference/error-responses#400-constraint-violation" + end + + class DuplicateResourceCreation < Orb::APIStatusError + HTTP_STATUS = 400 + + TYPE = "https://docs.withorb.com/reference/error-responses#400-duplicate-resource-creation" + end + + class FeatureNotAvailable < Orb::APIStatusError + HTTP_STATUS = 400 + + TYPE = "https://docs.withorb.com/reference/error-responses#404-feature-not-available" + end + + class RequestValidationError < Orb::APIStatusError + HTTP_STATUS = 400 + + TYPE = "https://docs.withorb.com/reference/error-responses#400-request-validation-errors" + end + + class OrbAuthenticationError < Orb::APIStatusError + HTTP_STATUS = 401 + + TYPE = "https://docs.withorb.com/reference/error-responses#401-authentication-error" + end + + class ResourceNotFound < Orb::APIStatusError + HTTP_STATUS = 404 + + TYPE = "https://docs.withorb.com/reference/error-responses#404-resource-not-found" + end + + class URLNotFound < Orb::APIStatusError + HTTP_STATUS = 404 + + TYPE = "https://docs.withorb.com/reference/error-responses#404-url-not-found" + end + + class ResourceConflict < Orb::APIStatusError + HTTP_STATUS = 409 + + TYPE = "https://docs.withorb.com/reference/error-responses#409-resource-conflict" + end + + class RequestTooLarge < Orb::APIStatusError + HTTP_STATUS = 413 + + TYPE = "https://docs.withorb.com/reference/error-responses#413-request-too-large" + end + + class ResourceTooLarge < Orb::APIStatusError + HTTP_STATUS = 413 + + TYPE = "https://docs.withorb.com/reference/error-responses#413-resource-too-large" + end + + class TooManyRequests < Orb::APIStatusError + HTTP_STATUS = 429 + + TYPE = "https://docs.withorb.com/reference/error-responses#429-too-many-requests" + end + + class OrbInternalServerError < Orb::APIStatusError + HTTP_STATUS = 500 + + TYPE = "https://docs.withorb.com/reference/error-responses#500-internal-server-error" + end +end diff --git a/lib/orb/extern.rb b/lib/orb/extern.rb new file mode 100644 index 00000000..f66913f8 --- /dev/null +++ b/lib/orb/extern.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Orb + # @private + # + # @abstract + # + module Extern + # @private + # + # @param blk [Proc] + # + def sorbet!(&blk); end + end +end diff --git a/lib/orb/model.rb b/lib/orb/model.rb deleted file mode 100644 index 3858c629..00000000 --- a/lib/orb/model.rb +++ /dev/null @@ -1,211 +0,0 @@ -# typed: true -# frozen_string_literal: true - -# TODO: OpenAPI supports reference cycles, -# so these classes need some way to resolve them, -# perhaps `Object.const_get` - -# TODO: type-guided serialization - -require "singleton" - -module Orb - class NotGiven - include Singleton - end - # TODO: move model types into a module - module Converter - def convert(convert) - raise NotImplementedError - end - - def self.convert(type, value) - if type.is_a?(Class) && type.superclass == Model - type.convert(**(value || {})) - elsif type.is_a?(Converter) || type.include?(Converter) - type.convert(value) - elsif type.is_a?(Class) - # TODO: selective hardcoded coercion here, - # eg int->float - if type == NilClass - nil - elsif type == Float && value.is_a?(Numeric) - value.to_f - elsif [Integer, String].include? type - value - end - else - raise StandardError.new("can't coerce #{value.class} to #{type}") - end - end - - # Is `value` a member of the type of this converter's output? - # XXX this isn't coercion. The value must already be exactly correct. - # It uses JSON schema's notion of type. - # So, eg, Ruby doesn't have booleans, but this function's domain does. - def same_type?(value) - raise NotImplementedError - end - - # dispatch function for `same_type`, to include `String` and other - # base classes - def self.same_type?(type, value) - if type.is_a?(Converter) || type.include?(Converter) - type.same_type? value - else - value.is_a? type - end - end - end - - class Unknown - include Converter - def self.convert(value) - value - end - def self.same_type?(value) - true - end - end - - # Ruby has no boolean class; this is just something for models to refer to. - # may not even be needed. - class BooleanModel - include Converter - def self.convert(value) - value - end - def self.same_type?(value) - [true, false].include? value - end - end - - class Enum - include Converter - - # NB we don't do runtime validation, so `options` is just an FYI - # for the reader. - def initialize(options) - @options = options - end - - def convert(value) - if value.is_a? String - value.to_sym - else - value - end - end - - def same_type?(value) - options.include? value - end - end - - class ArrayOf - include Converter - def initialize(items) - @items = items - end - - def convert(value) - # TODO: responding to 'not an enumerable' by just bailing out with nil? - value.map { |item| Converter.convert(@items, item) } - end - - def same_type?(value) - value.is_a?(Array) && - value.all? { |item| Converter.same_type?(@items, item) } - end - end - - class Model - include Converter - - def self.same_type?(value) - value.is_a? self - end - - def self.add_field(fn, t, mode) - @fields ||= {} - @fields[fn.to_sym] = { type: t, mode: mode } - - define_method(fn) { @data[fn.to_sym] } - - case mode - when :rw, :w - define_method("#{fn}=") { |val| @data[fn.to_sym] = val } - end - end - - # NB `required` is basically just a signal to the reader. We don't do runtime validation anyway. - def self.required(fn, t, mode = :rw) - add_field(fn, t, mode) - end - - # NB `optional` is basically just a signal to the reader. We don't do runtime validation anyway. - def self.optional(fn, t, mode = :rw) - add_field(fn, t, mode) - end - - class << self - attr_accessor :fields - end - - def self.convert_field(data, model) - if model.is_a? Converter - model.convert data - elsif model.superclass == Model - # TODO: what if the data aren't a hash at all? - model.convert(**(data || {})) - elsif model.instance_of?(Class) - # TODO: selective hardcoded coercion here, - # eg int->float - - data - else - raise NotImplementedError - end - end - - def self.convert(**data) - model = new - model.convert(**data) - model - end - - def convert(**data) - # TODO: what if data isn't a hash? - data.each do |field_name, value| - next if value.nil? - - # TODO: decide whether raw data should have only symbols, only string keys, or both - field = - self.class.fields[field_name.to_sym] || - self.class.fields[field_name.to_s] - if field - next if field[:mode] == :w - - result = Converter.convert(field[:type], value) - # TODO: error handling: if conversion throws, just put back whatever we got from the raw json? - @data[field_name.to_sym] = result - else - @data[field_name.to_sym] = value - end - end - end - - # TODO(Ruby) recursive to_h - def to_h - out = @data - self.class.fields.each do |field_name, _| - out[field_name] = instance_variable_get("@#{field_name.to_sym}") - end - out - end - - def initialize(**_data) - @data = {} - end - end -end diff --git a/lib/orb/models/alert.rb b/lib/orb/models/alert.rb new file mode 100644 index 00000000..f4e835e3 --- /dev/null +++ b/lib/orb/models/alert.rb @@ -0,0 +1,280 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # alert => { + # id: String, + # created_at: Time, + # currency: String, + # customer: Orb::Models::Alert::Customer, + # enabled: Orb::BooleanModel, + # **_ + # } + # ``` + class Alert < Orb::BaseModel + # @!attribute id + # Also referred to as alert_id in this documentation. + # + # @return [String] + required :id, String + + # @!attribute created_at + # The creation time of the resource in Orb. + # + # @return [Time] + required :created_at, Time + + # @!attribute currency + # The name of the currency the credit balance or invoice cost is denominated in. + # + # @return [String, nil] + required :currency, String, nil?: true + + # @!attribute customer + # The customer the alert applies to. + # + # @return [Orb::Models::Alert::Customer, nil] + required :customer, -> { Orb::Models::Alert::Customer }, nil?: true + + # @!attribute enabled + # Whether the alert is enabled or disabled. + # + # @return [Boolean] + required :enabled, Orb::BooleanModel + + # @!attribute metric + # The metric the alert applies to. + # + # @return [Orb::Models::Alert::Metric, nil] + required :metric, -> { Orb::Models::Alert::Metric }, nil?: true + + # @!attribute plan + # The plan the alert applies to. + # + # @return [Orb::Models::Alert::Plan, nil] + required :plan, -> { Orb::Models::Alert::Plan }, nil?: true + + # @!attribute subscription + # The subscription the alert applies to. + # + # @return [Orb::Models::Alert::Subscription, nil] + required :subscription, -> { Orb::Models::Alert::Subscription }, nil?: true + + # @!attribute thresholds + # The thresholds that define the conditions under which the alert will be + # triggered. + # + # @return [Array, nil] + required :thresholds, -> { Orb::ArrayOf[Orb::Models::Alert::Threshold] }, nil?: true + + # @!attribute type + # The type of alert. This must be a valid alert type. + # + # @return [Symbol, Orb::Models::Alert::Type] + required :type, enum: -> { Orb::Models::Alert::Type } + + # @!parse + # # [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending, + # # usage, or credit balance and trigger webhooks when a threshold is exceeded. + # # + # # Alerts created through the API can be scoped to either customers or + # # subscriptions. + # # + # # @param id [String] + # # @param created_at [Time] + # # @param currency [String, nil] + # # @param customer [Orb::Models::Alert::Customer, nil] + # # @param enabled [Boolean] + # # @param metric [Orb::Models::Alert::Metric, nil] + # # @param plan [Orb::Models::Alert::Plan, nil] + # # @param subscription [Orb::Models::Alert::Subscription, nil] + # # @param thresholds [Array, nil] + # # @param type [Symbol, Orb::Models::Alert::Type] + # # + # def initialize(id:, created_at:, currency:, customer:, enabled:, metric:, plan:, subscription:, thresholds:, type:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # The customer the alert applies to. + # # + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # metric => { + # id: String + # } + # ``` + class Metric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # The metric the alert applies to. + # # + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # plan => { + # id: String, + # external_plan_id: String, + # name: String, + # plan_version: String + # } + # ``` + class Plan < Orb::BaseModel + # @!attribute id + # + # @return [String, nil] + required :id, String, nil?: true + + # @!attribute external_plan_id + # An optional user-defined ID for this plan resource, used throughout the system + # as an alias for this Plan. Use this field to identify a plan by an existing + # identifier in your system. + # + # @return [String, nil] + required :external_plan_id, String, nil?: true + + # @!attribute name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute plan_version + # + # @return [String] + required :plan_version, String + + # @!parse + # # The plan the alert applies to. + # # + # # @param id [String, nil] + # # @param external_plan_id [String, nil] + # # @param name [String, nil] + # # @param plan_version [String] + # # + # def initialize(id:, external_plan_id:, name:, plan_version:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # subscription => { + # id: String + # } + # ``` + class Subscription < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # The subscription the alert applies to. + # # + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # threshold => { + # value: Float + # } + # ``` + class Threshold < Orb::BaseModel + # @!attribute value + # The value at which an alert will fire. For credit balance alerts, the alert will + # fire at or below this value. For usage and cost alerts, the alert will fire at + # or above this value. + # + # @return [Float] + required :value, Float + + # @!parse + # # Thresholds are used to define the conditions under which an alert will be + # # triggered. + # # + # # @param value [Float] + # # + # def initialize(value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # The type of alert. This must be a valid alert type. + # + # @example + # ```ruby + # case type + # in :usage_exceeded + # # ... + # in :cost_exceeded + # # ... + # in :credit_balance_depleted + # # ... + # in :credit_balance_dropped + # # ... + # in :credit_balance_recovered + # # ... + # end + # ``` + class Type < Orb::Enum + USAGE_EXCEEDED = :usage_exceeded + COST_EXCEEDED = :cost_exceeded + CREDIT_BALANCE_DEPLETED = :credit_balance_depleted + CREDIT_BALANCE_DROPPED = :credit_balance_dropped + CREDIT_BALANCE_RECOVERED = :credit_balance_recovered + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/orb/models/alert_create_for_customer_params.rb b/lib/orb/models/alert_create_for_customer_params.rb new file mode 100644 index 00000000..8a2b6ae6 --- /dev/null +++ b/lib/orb/models/alert_create_for_customer_params.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +module Orb + module Models + class AlertCreateForCustomerParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute currency + # The case sensitive currency or custom pricing unit to use for this alert. + # + # @return [String] + required :currency, String + + # @!attribute type + # The type of alert to create. This must be a valid alert type. + # + # @return [Symbol, Orb::Models::AlertCreateForCustomerParams::Type] + required :type, enum: -> { Orb::Models::AlertCreateForCustomerParams::Type } + + # @!attribute thresholds + # The thresholds that define the values at which the alert will be triggered. + # + # @return [Array, nil] + optional :thresholds, + -> { Orb::ArrayOf[Orb::Models::AlertCreateForCustomerParams::Threshold] }, + nil?: true + + # @!parse + # # @param currency [String] + # # @param type [Symbol, Orb::Models::AlertCreateForCustomerParams::Type] + # # @param thresholds [Array, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(currency:, type:, thresholds: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The type of alert to create. This must be a valid alert type. + # + # @example + # ```ruby + # case type + # in :usage_exceeded + # # ... + # in :cost_exceeded + # # ... + # in :credit_balance_depleted + # # ... + # in :credit_balance_dropped + # # ... + # in :credit_balance_recovered + # # ... + # end + # ``` + class Type < Orb::Enum + USAGE_EXCEEDED = :usage_exceeded + COST_EXCEEDED = :cost_exceeded + CREDIT_BALANCE_DEPLETED = :credit_balance_depleted + CREDIT_BALANCE_DROPPED = :credit_balance_dropped + CREDIT_BALANCE_RECOVERED = :credit_balance_recovered + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # threshold => { + # value: Float + # } + # ``` + class Threshold < Orb::BaseModel + # @!attribute value + # The value at which an alert will fire. For credit balance alerts, the alert will + # fire at or below this value. For usage and cost alerts, the alert will fire at + # or above this value. + # + # @return [Float] + required :value, Float + + # @!parse + # # Thresholds are used to define the conditions under which an alert will be + # # triggered. + # # + # # @param value [Float] + # # + # def initialize(value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/alert_create_for_external_customer_params.rb b/lib/orb/models/alert_create_for_external_customer_params.rb new file mode 100644 index 00000000..1bd56f4f --- /dev/null +++ b/lib/orb/models/alert_create_for_external_customer_params.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +module Orb + module Models + class AlertCreateForExternalCustomerParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute currency + # The case sensitive currency or custom pricing unit to use for this alert. + # + # @return [String] + required :currency, String + + # @!attribute type + # The type of alert to create. This must be a valid alert type. + # + # @return [Symbol, Orb::Models::AlertCreateForExternalCustomerParams::Type] + required :type, enum: -> { Orb::Models::AlertCreateForExternalCustomerParams::Type } + + # @!attribute thresholds + # The thresholds that define the values at which the alert will be triggered. + # + # @return [Array, nil] + optional :thresholds, + -> { Orb::ArrayOf[Orb::Models::AlertCreateForExternalCustomerParams::Threshold] }, + nil?: true + + # @!parse + # # @param currency [String] + # # @param type [Symbol, Orb::Models::AlertCreateForExternalCustomerParams::Type] + # # @param thresholds [Array, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(currency:, type:, thresholds: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The type of alert to create. This must be a valid alert type. + # + # @example + # ```ruby + # case type + # in :usage_exceeded + # # ... + # in :cost_exceeded + # # ... + # in :credit_balance_depleted + # # ... + # in :credit_balance_dropped + # # ... + # in :credit_balance_recovered + # # ... + # end + # ``` + class Type < Orb::Enum + USAGE_EXCEEDED = :usage_exceeded + COST_EXCEEDED = :cost_exceeded + CREDIT_BALANCE_DEPLETED = :credit_balance_depleted + CREDIT_BALANCE_DROPPED = :credit_balance_dropped + CREDIT_BALANCE_RECOVERED = :credit_balance_recovered + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # threshold => { + # value: Float + # } + # ``` + class Threshold < Orb::BaseModel + # @!attribute value + # The value at which an alert will fire. For credit balance alerts, the alert will + # fire at or below this value. For usage and cost alerts, the alert will fire at + # or above this value. + # + # @return [Float] + required :value, Float + + # @!parse + # # Thresholds are used to define the conditions under which an alert will be + # # triggered. + # # + # # @param value [Float] + # # + # def initialize(value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/alert_create_for_subscription_params.rb b/lib/orb/models/alert_create_for_subscription_params.rb new file mode 100644 index 00000000..72c07c28 --- /dev/null +++ b/lib/orb/models/alert_create_for_subscription_params.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +module Orb + module Models + class AlertCreateForSubscriptionParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute thresholds + # The thresholds that define the values at which the alert will be triggered. + # + # @return [Array] + required :thresholds, -> { Orb::ArrayOf[Orb::Models::AlertCreateForSubscriptionParams::Threshold] } + + # @!attribute type + # The type of alert to create. This must be a valid alert type. + # + # @return [Symbol, Orb::Models::AlertCreateForSubscriptionParams::Type] + required :type, enum: -> { Orb::Models::AlertCreateForSubscriptionParams::Type } + + # @!attribute metric_id + # The metric to track usage for. + # + # @return [String, nil] + optional :metric_id, String, nil?: true + + # @!parse + # # @param thresholds [Array] + # # @param type [Symbol, Orb::Models::AlertCreateForSubscriptionParams::Type] + # # @param metric_id [String, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(thresholds:, type:, metric_id: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # threshold => { + # value: Float + # } + # ``` + class Threshold < Orb::BaseModel + # @!attribute value + # The value at which an alert will fire. For credit balance alerts, the alert will + # fire at or below this value. For usage and cost alerts, the alert will fire at + # or above this value. + # + # @return [Float] + required :value, Float + + # @!parse + # # Thresholds are used to define the conditions under which an alert will be + # # triggered. + # # + # # @param value [Float] + # # + # def initialize(value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # The type of alert to create. This must be a valid alert type. + # + # @example + # ```ruby + # case type + # in :usage_exceeded + # # ... + # in :cost_exceeded + # # ... + # in :credit_balance_depleted + # # ... + # in :credit_balance_dropped + # # ... + # in :credit_balance_recovered + # # ... + # end + # ``` + class Type < Orb::Enum + USAGE_EXCEEDED = :usage_exceeded + COST_EXCEEDED = :cost_exceeded + CREDIT_BALANCE_DEPLETED = :credit_balance_depleted + CREDIT_BALANCE_DROPPED = :credit_balance_dropped + CREDIT_BALANCE_RECOVERED = :credit_balance_recovered + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/orb/models/alert_disable_params.rb b/lib/orb/models/alert_disable_params.rb new file mode 100644 index 00000000..a235d065 --- /dev/null +++ b/lib/orb/models/alert_disable_params.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Orb + module Models + class AlertDisableParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute subscription_id + # Used to update the status of a plan alert scoped to this subscription_id + # + # @return [String, nil] + optional :subscription_id, String, nil?: true + + # @!parse + # # @param subscription_id [String, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(subscription_id: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/alert_enable_params.rb b/lib/orb/models/alert_enable_params.rb new file mode 100644 index 00000000..422778ae --- /dev/null +++ b/lib/orb/models/alert_enable_params.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Orb + module Models + class AlertEnableParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute subscription_id + # Used to update the status of a plan alert scoped to this subscription_id + # + # @return [String, nil] + optional :subscription_id, String, nil?: true + + # @!parse + # # @param subscription_id [String, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(subscription_id: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/alert_list_params.rb b/lib/orb/models/alert_list_params.rb new file mode 100644 index 00000000..cf0bcc16 --- /dev/null +++ b/lib/orb/models/alert_list_params.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +module Orb + module Models + class AlertListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute created_at_gt + # + # @return [Time, nil] + optional :created_at_gt, Time, api_name: :"created_at[gt]", nil?: true + + # @!attribute created_at_gte + # + # @return [Time, nil] + optional :created_at_gte, Time, api_name: :"created_at[gte]", nil?: true + + # @!attribute created_at_lt + # + # @return [Time, nil] + optional :created_at_lt, Time, api_name: :"created_at[lt]", nil?: true + + # @!attribute created_at_lte + # + # @return [Time, nil] + optional :created_at_lte, Time, api_name: :"created_at[lte]", nil?: true + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute customer_id + # Fetch alerts scoped to this customer_id + # + # @return [String, nil] + optional :customer_id, String, nil?: true + + # @!attribute external_customer_id + # Fetch alerts scoped to this external_customer_id + # + # @return [String, nil] + optional :external_customer_id, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!attribute subscription_id + # Fetch alerts scoped to this subscription_id + # + # @return [String, nil] + optional :subscription_id, String, nil?: true + + # @!parse + # # @param created_at_gt [Time, nil] + # # @param created_at_gte [Time, nil] + # # @param created_at_lt [Time, nil] + # # @param created_at_lte [Time, nil] + # # @param cursor [String, nil] + # # @param customer_id [String, nil] + # # @param external_customer_id [String, nil] + # # @param limit [Integer] + # # @param subscription_id [String, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # created_at_gt: nil, + # created_at_gte: nil, + # created_at_lt: nil, + # created_at_lte: nil, + # cursor: nil, + # customer_id: nil, + # external_customer_id: nil, + # limit: nil, + # subscription_id: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/alert_retrieve_params.rb b/lib/orb/models/alert_retrieve_params.rb new file mode 100644 index 00000000..00640dbc --- /dev/null +++ b/lib/orb/models/alert_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class AlertRetrieveParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/alert_update_params.rb b/lib/orb/models/alert_update_params.rb new file mode 100644 index 00000000..e007bc57 --- /dev/null +++ b/lib/orb/models/alert_update_params.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +module Orb + module Models + class AlertUpdateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute thresholds + # The thresholds that define the values at which the alert will be triggered. + # + # @return [Array] + required :thresholds, -> { Orb::ArrayOf[Orb::Models::AlertUpdateParams::Threshold] } + + # @!parse + # # @param thresholds [Array] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(thresholds:, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # threshold => { + # value: Float + # } + # ``` + class Threshold < Orb::BaseModel + # @!attribute value + # The value at which an alert will fire. For credit balance alerts, the alert will + # fire at or below this value. For usage and cost alerts, the alert will fire at + # or above this value. + # + # @return [Float] + required :value, Float + + # @!parse + # # Thresholds are used to define the conditions under which an alert will be + # # triggered. + # # + # # @param value [Float] + # # + # def initialize(value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/amount_discount.rb b/lib/orb/models/amount_discount.rb new file mode 100644 index 00000000..ccb02fef --- /dev/null +++ b/lib/orb/models/amount_discount.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # amount_discount => { + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: Orb::Models::AmountDiscount::DiscountType, + # reason: String + # } + # ``` + class AmountDiscount < Orb::BaseModel + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # List of price_ids that this discount applies to. For plan/plan phase discounts, + # this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, Orb::Models::AmountDiscount::DiscountType] + required :discount_type, enum: -> { Orb::Models::AmountDiscount::DiscountType } + + # @!attribute reason + # + # @return [String, nil] + optional :reason, String, nil?: true + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param discount_type [Symbol, Orb::Models::AmountDiscount::DiscountType] + # # @param reason [String, nil] + # # + # def initialize(amount_discount:, applies_to_price_ids:, discount_type:, reason: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case discount_type + # in :amount + # # ... + # end + # ``` + class DiscountType < Orb::Enum + AMOUNT = :amount + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/orb/models/backfill_close_response.rb b/lib/orb/models/backfill_close_response.rb deleted file mode 100644 index 2edf17ef..00000000 --- a/lib/orb/models/backfill_close_response.rb +++ /dev/null @@ -1,26 +0,0 @@ -require "orb/model" -module Orb - module Models - class BackfillCloseResponse < Orb::Model - # @!attribute [rw] id - required :id, String - # @!attribute [rw] close_time - required :close_time, String - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] customer_id - required :customer_id, String - # @!attribute [rw] reverted_at - required :reverted_at, String - # @!attribute [rw] status - required :status, - Orb::Enum.new( - [:"pending", :"reflected", :"pending_revert", :"reverted"] - ) - # @!attribute [rw] timeframe_end - required :timeframe_end, String - # @!attribute [rw] timeframe_start - required :timeframe_start, String - end - end -end diff --git a/lib/orb/models/backfill_create_response.rb b/lib/orb/models/backfill_create_response.rb deleted file mode 100644 index 8b6bd386..00000000 --- a/lib/orb/models/backfill_create_response.rb +++ /dev/null @@ -1,26 +0,0 @@ -require "orb/model" -module Orb - module Models - class BackfillCreateResponse < Orb::Model - # @!attribute [rw] id - required :id, String - # @!attribute [rw] close_time - required :close_time, String - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] customer_id - required :customer_id, String - # @!attribute [rw] reverted_at - required :reverted_at, String - # @!attribute [rw] status - required :status, - Orb::Enum.new( - [:"pending", :"reflected", :"pending_revert", :"reverted"] - ) - # @!attribute [rw] timeframe_end - required :timeframe_end, String - # @!attribute [rw] timeframe_start - required :timeframe_start, String - end - end -end diff --git a/lib/orb/models/backfill_fetch_response.rb b/lib/orb/models/backfill_fetch_response.rb deleted file mode 100644 index 6fbb5678..00000000 --- a/lib/orb/models/backfill_fetch_response.rb +++ /dev/null @@ -1,26 +0,0 @@ -require "orb/model" -module Orb - module Models - class BackfillFetchResponse < Orb::Model - # @!attribute [rw] id - required :id, String - # @!attribute [rw] close_time - required :close_time, String - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] customer_id - required :customer_id, String - # @!attribute [rw] reverted_at - required :reverted_at, String - # @!attribute [rw] status - required :status, - Orb::Enum.new( - [:"pending", :"reflected", :"pending_revert", :"reverted"] - ) - # @!attribute [rw] timeframe_end - required :timeframe_end, String - # @!attribute [rw] timeframe_start - required :timeframe_start, String - end - end -end diff --git a/lib/orb/models/backfill_list_response.rb b/lib/orb/models/backfill_list_response.rb deleted file mode 100644 index 07a63ae0..00000000 --- a/lib/orb/models/backfill_list_response.rb +++ /dev/null @@ -1,26 +0,0 @@ -require "orb/model" -module Orb - module Models - class BackfillListResponse < Orb::Model - # @!attribute [rw] id - required :id, String - # @!attribute [rw] close_time - required :close_time, String - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] customer_id - required :customer_id, String - # @!attribute [rw] reverted_at - required :reverted_at, String - # @!attribute [rw] status - required :status, - Orb::Enum.new( - [:"pending", :"reflected", :"pending_revert", :"reverted"] - ) - # @!attribute [rw] timeframe_end - required :timeframe_end, String - # @!attribute [rw] timeframe_start - required :timeframe_start, String - end - end -end diff --git a/lib/orb/models/backfill_revert_response.rb b/lib/orb/models/backfill_revert_response.rb deleted file mode 100644 index 953434c9..00000000 --- a/lib/orb/models/backfill_revert_response.rb +++ /dev/null @@ -1,26 +0,0 @@ -require "orb/model" -module Orb - module Models - class BackfillRevertResponse < Orb::Model - # @!attribute [rw] id - required :id, String - # @!attribute [rw] close_time - required :close_time, String - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] customer_id - required :customer_id, String - # @!attribute [rw] reverted_at - required :reverted_at, String - # @!attribute [rw] status - required :status, - Orb::Enum.new( - [:"pending", :"reflected", :"pending_revert", :"reverted"] - ) - # @!attribute [rw] timeframe_end - required :timeframe_end, String - # @!attribute [rw] timeframe_start - required :timeframe_start, String - end - end -end diff --git a/lib/orb/models/balance_transaction_create_response.rb b/lib/orb/models/balance_transaction_create_response.rb deleted file mode 100644 index 1c6eb659..00000000 --- a/lib/orb/models/balance_transaction_create_response.rb +++ /dev/null @@ -1,47 +0,0 @@ -require "orb/model" -module Orb - module Models - class BalanceTransactionCreateResponse < Orb::Model - class CreditNote < Orb::Model - # @!attribute [rw] id - required :id, String - end - class Invoice < Orb::Model - # @!attribute [rw] id - required :id, String - end - # @!attribute [rw] id - required :id, String - # @!attribute [rw] action - required :action, - Orb::Enum.new( - [ - :"applied_to_invoice", - :"manual_adjustment", - :"prorated_refund", - :"revert_prorated_refund", - :"return_from_voiding", - :"credit_note_applied", - :"credit_note_voided", - :"overpayment_refund" - ] - ) - # @!attribute [rw] amount - required :amount, String - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] credit_note - required :credit_note, CreditNote - # @!attribute [rw] description - required :description, String - # @!attribute [rw] ending_balance - required :ending_balance, String - # @!attribute [rw] invoice - required :invoice, Invoice - # @!attribute [rw] starting_balance - required :starting_balance, String - # @!attribute [rw] type - required :type, Orb::Enum.new([:"increment", :"decrement"]) - end - end -end diff --git a/lib/orb/models/balance_transaction_list_response.rb b/lib/orb/models/balance_transaction_list_response.rb deleted file mode 100644 index ce92a57d..00000000 --- a/lib/orb/models/balance_transaction_list_response.rb +++ /dev/null @@ -1,47 +0,0 @@ -require "orb/model" -module Orb - module Models - class BalanceTransactionListResponse < Orb::Model - class CreditNote < Orb::Model - # @!attribute [rw] id - required :id, String - end - class Invoice < Orb::Model - # @!attribute [rw] id - required :id, String - end - # @!attribute [rw] id - required :id, String - # @!attribute [rw] action - required :action, - Orb::Enum.new( - [ - :"applied_to_invoice", - :"manual_adjustment", - :"prorated_refund", - :"revert_prorated_refund", - :"return_from_voiding", - :"credit_note_applied", - :"credit_note_voided", - :"overpayment_refund" - ] - ) - # @!attribute [rw] amount - required :amount, String - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] credit_note - required :credit_note, CreditNote - # @!attribute [rw] description - required :description, String - # @!attribute [rw] ending_balance - required :ending_balance, String - # @!attribute [rw] invoice - required :invoice, Invoice - # @!attribute [rw] starting_balance - required :starting_balance, String - # @!attribute [rw] type - required :type, Orb::Enum.new([:"increment", :"decrement"]) - end - end -end diff --git a/lib/orb/models/billable_metric.rb b/lib/orb/models/billable_metric.rb new file mode 100644 index 00000000..250c1825 --- /dev/null +++ b/lib/orb/models/billable_metric.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # billable_metric => { + # id: String, + # description: String, + # item: Orb::Models::Item, + # metadata: -> { Orb::HashOf[String] === _1 }, + # name: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute item + # The Item resource represents a sellable product or good. Items are associated + # with all line items, billable metrics, and prices and are used for defining + # external sync behavior for invoices and tax calculation purposes. + # + # @return [Orb::Models::Item] + required :item, -> { Orb::Models::Item } + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute status + # + # @return [Symbol, Orb::Models::BillableMetric::Status] + required :status, enum: -> { Orb::Models::BillableMetric::Status } + + # @!parse + # # The Metric resource represents a calculation of a quantity based on events. + # # Metrics are defined by the query that transforms raw usage events into + # # meaningful values for your customers. + # # + # # @param id [String] + # # @param description [String, nil] + # # @param item [Orb::Models::Item] + # # @param metadata [Hash{Symbol=>String}] + # # @param name [String] + # # @param status [Symbol, Orb::Models::BillableMetric::Status] + # # + # def initialize(id:, description:, item:, metadata:, name:, status:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :draft + # # ... + # in :archived + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + DRAFT = :draft + ARCHIVED = :archived + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/orb/models/billing_cycle_relative_date.rb b/lib/orb/models/billing_cycle_relative_date.rb new file mode 100644 index 00000000..918b3132 --- /dev/null +++ b/lib/orb/models/billing_cycle_relative_date.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Orb + module Models + # @abstract + # + # @example + # ```ruby + # case billing_cycle_relative_date + # in :start_of_term + # # ... + # in :end_of_term + # # ... + # end + # ``` + class BillingCycleRelativeDate < Orb::Enum + START_OF_TERM = :start_of_term + END_OF_TERM = :end_of_term + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end +end diff --git a/lib/orb/models/cost_list_by_external_id_response.rb b/lib/orb/models/cost_list_by_external_id_response.rb deleted file mode 100644 index 73fe7924..00000000 --- a/lib/orb/models/cost_list_by_external_id_response.rb +++ /dev/null @@ -1,45 +0,0 @@ -require "orb/model" -module Orb - module Models - class CostListByExternalIDResponse < Orb::Model - class Data < Orb::Model - class PerPriceCosts < Orb::Model - class PriceGroups < Orb::Model - # @!attribute [rw] grouping_key - required :grouping_key, String - # @!attribute [rw] grouping_value - required :grouping_value, String - # @!attribute [rw] secondary_grouping_key - required :secondary_grouping_key, String - # @!attribute [rw] secondary_grouping_value - required :secondary_grouping_value, String - # @!attribute [rw] total - required :total, String - end - # @!attribute [rw] price - required :price, Orb::Unknown - # @!attribute [rw] subtotal - required :subtotal, String - # @!attribute [rw] total - required :total, String - # @!attribute [rw] price_groups - optional :price_groups, Orb::ArrayOf.new(PriceGroups) - # @!attribute [rw] quantity - optional :quantity, Float - end - # @!attribute [rw] per_price_costs - required :per_price_costs, Orb::ArrayOf.new(PerPriceCosts) - # @!attribute [rw] subtotal - required :subtotal, String - # @!attribute [rw] timeframe_end - required :timeframe_end, String - # @!attribute [rw] timeframe_start - required :timeframe_start, String - # @!attribute [rw] total - required :total, String - end - # @!attribute [rw] data - required :data, Orb::ArrayOf.new(Data) - end - end -end diff --git a/lib/orb/models/cost_list_response.rb b/lib/orb/models/cost_list_response.rb deleted file mode 100644 index 14b46528..00000000 --- a/lib/orb/models/cost_list_response.rb +++ /dev/null @@ -1,45 +0,0 @@ -require "orb/model" -module Orb - module Models - class CostListResponse < Orb::Model - class Data < Orb::Model - class PerPriceCosts < Orb::Model - class PriceGroups < Orb::Model - # @!attribute [rw] grouping_key - required :grouping_key, String - # @!attribute [rw] grouping_value - required :grouping_value, String - # @!attribute [rw] secondary_grouping_key - required :secondary_grouping_key, String - # @!attribute [rw] secondary_grouping_value - required :secondary_grouping_value, String - # @!attribute [rw] total - required :total, String - end - # @!attribute [rw] price - required :price, Orb::Unknown - # @!attribute [rw] subtotal - required :subtotal, String - # @!attribute [rw] total - required :total, String - # @!attribute [rw] price_groups - optional :price_groups, Orb::ArrayOf.new(PriceGroups) - # @!attribute [rw] quantity - optional :quantity, Float - end - # @!attribute [rw] per_price_costs - required :per_price_costs, Orb::ArrayOf.new(PerPriceCosts) - # @!attribute [rw] subtotal - required :subtotal, String - # @!attribute [rw] timeframe_end - required :timeframe_end, String - # @!attribute [rw] timeframe_start - required :timeframe_start, String - # @!attribute [rw] total - required :total, String - end - # @!attribute [rw] data - required :data, Orb::ArrayOf.new(Data) - end - end -end diff --git a/lib/orb/models/coupon.rb b/lib/orb/models/coupon.rb index 1352d53f..65f1c46f 100644 --- a/lib/orb/models/coupon.rb +++ b/lib/orb/models/coupon.rb @@ -1,21 +1,110 @@ -require "orb/model" +# frozen_string_literal: true + module Orb module Models - class Coupon < Orb::Model - # @!attribute [rw] id + # @example + # ```ruby + # coupon => { + # id: String, + # archived_at: Time, + # discount: Orb::Models::Coupon::Discount, + # duration_in_months: Integer, + # max_redemptions: Integer, + # **_ + # } + # ``` + class Coupon < Orb::BaseModel + # @!attribute id + # Also referred to as coupon_id in this documentation. + # + # @return [String] required :id, String - # @!attribute [rw] archived_at - required :archived_at, String - # @!attribute [rw] discount - required :discount, Orb::Unknown - # @!attribute [rw] duration_in_months - required :duration_in_months, Integer - # @!attribute [rw] max_redemptions - required :max_redemptions, Integer - # @!attribute [rw] redemption_code + + # @!attribute archived_at + # An archived coupon can no longer be redeemed. Active coupons will have a value + # of null for `archived_at`; this field will be non-null for archived coupons. + # + # @return [Time, nil] + required :archived_at, Time, nil?: true + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::AmountDiscount] + required :discount, union: -> { Orb::Models::Coupon::Discount } + + # @!attribute duration_in_months + # This allows for a coupon's discount to apply for a limited time (determined in + # months); a `null` value here means "unlimited time". + # + # @return [Integer, nil] + required :duration_in_months, Integer, nil?: true + + # @!attribute max_redemptions + # The maximum number of redemptions allowed for this coupon before it is + # exhausted; `null` here means "unlimited". + # + # @return [Integer, nil] + required :max_redemptions, Integer, nil?: true + + # @!attribute redemption_code + # This string can be used to redeem this coupon for a given subscription. + # + # @return [String] required :redemption_code, String - # @!attribute [rw] times_redeemed + + # @!attribute times_redeemed + # The number of times this coupon has been redeemed. + # + # @return [Integer] required :times_redeemed, Integer + + # @!parse + # # A coupon represents a reusable discount configuration that can be applied either + # # as a fixed or percentage amount to an invoice or subscription. Coupons are + # # activated using a redemption code, which applies the discount to a subscription + # # or invoice. The duration of a coupon determines how long it remains available + # # for use by end users. + # # + # # @param id [String] + # # @param archived_at [Time, nil] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::AmountDiscount] + # # @param duration_in_months [Integer, nil] + # # @param max_redemptions [Integer, nil] + # # @param redemption_code [String] + # # @param times_redeemed [Integer] + # # + # def initialize(id:, archived_at:, discount:, duration_in_months:, max_redemptions:, redemption_code:, times_redeemed:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case discount + # in {discount_type: "percentage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, percentage_discount: Float, reason: String} + # # Orb::Models::PercentageDiscount ... + # in {discount_type: "amount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, reason: String} + # # Orb::Models::AmountDiscount ... + # end + # ``` + # + # @example + # ```ruby + # case discount + # in Orb::Models::PercentageDiscount + # # ... + # in Orb::Models::AmountDiscount + # # ... + # end + # ``` + class Discount < Orb::Union + discriminator :discount_type + + variant :percentage, -> { Orb::Models::PercentageDiscount } + + variant :amount, -> { Orb::Models::AmountDiscount } + end end end end diff --git a/lib/orb/models/coupon_archive_params.rb b/lib/orb/models/coupon_archive_params.rb new file mode 100644 index 00000000..619351db --- /dev/null +++ b/lib/orb/models/coupon_archive_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class CouponArchiveParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/coupon_create_params.rb b/lib/orb/models/coupon_create_params.rb new file mode 100644 index 00000000..0b2ea66f --- /dev/null +++ b/lib/orb/models/coupon_create_params.rb @@ -0,0 +1,130 @@ +# frozen_string_literal: true + +module Orb + module Models + class CouponCreateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute discount + # + # @return [Orb::Models::CouponCreateParams::Discount::NewCouponPercentageDiscount, Orb::Models::CouponCreateParams::Discount::NewCouponAmountDiscount] + required :discount, union: -> { Orb::Models::CouponCreateParams::Discount } + + # @!attribute redemption_code + # This string can be used to redeem this coupon for a given subscription. + # + # @return [String] + required :redemption_code, String + + # @!attribute duration_in_months + # This allows for a coupon's discount to apply for a limited time (determined in + # months); a `null` value here means "unlimited time". + # + # @return [Integer, nil] + optional :duration_in_months, Integer, nil?: true + + # @!attribute max_redemptions + # The maximum number of redemptions allowed for this coupon before it is + # exhausted;`null` here means "unlimited". + # + # @return [Integer, nil] + optional :max_redemptions, Integer, nil?: true + + # @!parse + # # @param discount [Orb::Models::CouponCreateParams::Discount::NewCouponPercentageDiscount, Orb::Models::CouponCreateParams::Discount::NewCouponAmountDiscount] + # # @param redemption_code [String] + # # @param duration_in_months [Integer, nil] + # # @param max_redemptions [Integer, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(discount:, redemption_code:, duration_in_months: nil, max_redemptions: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case discount + # in {discount_type: "percentage", percentage_discount: Float} + # # Orb::Models::CouponCreateParams::Discount::NewCouponPercentageDiscount ... + # in {discount_type: "amount", amount_discount: String} + # # Orb::Models::CouponCreateParams::Discount::NewCouponAmountDiscount ... + # end + # ``` + # + # @example + # ```ruby + # case discount + # in Orb::Models::CouponCreateParams::Discount::NewCouponPercentageDiscount + # # ... + # in Orb::Models::CouponCreateParams::Discount::NewCouponAmountDiscount + # # ... + # end + # ``` + class Discount < Orb::Union + discriminator :discount_type + + variant :percentage, -> { Orb::Models::CouponCreateParams::Discount::NewCouponPercentageDiscount } + + variant :amount, -> { Orb::Models::CouponCreateParams::Discount::NewCouponAmountDiscount } + + # @example + # ```ruby + # new_coupon_percentage_discount => { + # discount_type: :percentage, + # percentage_discount: Float + # } + # ``` + class NewCouponPercentageDiscount < Orb::BaseModel + # @!attribute discount_type + # + # @return [Symbol, :percentage] + required :discount_type, const: :percentage + + # @!attribute percentage_discount + # + # @return [Float] + required :percentage_discount, Float + + # @!parse + # # @param percentage_discount [Float] + # # @param discount_type [Symbol, :percentage] + # # + # def initialize(percentage_discount:, discount_type: :percentage, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_coupon_amount_discount => { + # amount_discount: String, + # discount_type: :amount + # } + # ``` + class NewCouponAmountDiscount < Orb::BaseModel + # @!attribute amount_discount + # + # @return [String] + required :amount_discount, String + + # @!attribute discount_type + # + # @return [Symbol, :amount] + required :discount_type, const: :amount + + # @!parse + # # @param amount_discount [String] + # # @param discount_type [Symbol, :amount] + # # + # def initialize(amount_discount:, discount_type: :amount, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + end +end diff --git a/lib/orb/models/coupon_fetch_params.rb b/lib/orb/models/coupon_fetch_params.rb new file mode 100644 index 00000000..60763772 --- /dev/null +++ b/lib/orb/models/coupon_fetch_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class CouponFetchParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/coupon_list_params.rb b/lib/orb/models/coupon_list_params.rb new file mode 100644 index 00000000..a4251958 --- /dev/null +++ b/lib/orb/models/coupon_list_params.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Orb + module Models + class CouponListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!attribute redemption_code + # Filter to coupons matching this redemption code. + # + # @return [String, nil] + optional :redemption_code, String, nil?: true + + # @!attribute show_archived + # Show archived coupons as well (by default, this endpoint only returns active + # coupons). + # + # @return [Boolean, nil] + optional :show_archived, Orb::BooleanModel, nil?: true + + # @!parse + # # @param cursor [String, nil] + # # @param limit [Integer] + # # @param redemption_code [String, nil] + # # @param show_archived [Boolean, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(cursor: nil, limit: nil, redemption_code: nil, show_archived: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/coupons/subscription_list_params.rb b/lib/orb/models/coupons/subscription_list_params.rb new file mode 100644 index 00000000..1766bc45 --- /dev/null +++ b/lib/orb/models/coupons/subscription_list_params.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Orb + module Models + module Coupons + class SubscriptionListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!parse + # # @param cursor [String, nil] + # # @param limit [Integer] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(cursor: nil, limit: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/credit_list_by_external_id_response.rb b/lib/orb/models/credit_list_by_external_id_response.rb deleted file mode 100644 index b3c485fe..00000000 --- a/lib/orb/models/credit_list_by_external_id_response.rb +++ /dev/null @@ -1,15 +0,0 @@ -require "orb/model" -module Orb - module Models - class CreditListByExternalIDResponse < Orb::Model - # @!attribute [rw] id - required :id, String - # @!attribute [rw] balance - required :balance, Float - # @!attribute [rw] expiry_date - required :expiry_date, String - # @!attribute [rw] per_unit_cost_basis - required :per_unit_cost_basis, String - end - end -end diff --git a/lib/orb/models/credit_list_response.rb b/lib/orb/models/credit_list_response.rb deleted file mode 100644 index 767f9e88..00000000 --- a/lib/orb/models/credit_list_response.rb +++ /dev/null @@ -1,15 +0,0 @@ -require "orb/model" -module Orb - module Models - class CreditListResponse < Orb::Model - # @!attribute [rw] id - required :id, String - # @!attribute [rw] balance - required :balance, Float - # @!attribute [rw] expiry_date - required :expiry_date, String - # @!attribute [rw] per_unit_cost_basis - required :per_unit_cost_basis, String - end - end -end diff --git a/lib/orb/models/credit_note.rb b/lib/orb/models/credit_note.rb index 6f2e030e..e8a2015f 100644 --- a/lib/orb/models/credit_note.rb +++ b/lib/orb/models/credit_note.rb @@ -1,139 +1,639 @@ -require "orb/model" +# frozen_string_literal: true + module Orb module Models - class CreditNote < Orb::Model - class Customer < Orb::Model - # @!attribute [rw] id + # @example + # ```ruby + # credit_note => { + # id: String, + # created_at: Time, + # credit_note_number: String, + # credit_note_pdf: String, + # customer: Orb::Models::CreditNote::Customer, + # **_ + # } + # ``` + class CreditNote < Orb::BaseModel + # @!attribute id + # The Orb id of this credit note. + # + # @return [String] + required :id, String + + # @!attribute created_at + # The creation time of the resource in Orb. + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_note_number + # The unique identifier for credit notes. + # + # @return [String] + required :credit_note_number, String + + # @!attribute credit_note_pdf + # A URL to a PDF of the credit note. + # + # @return [String, nil] + required :credit_note_pdf, String, nil?: true + + # @!attribute customer + # + # @return [Orb::Models::CreditNote::Customer] + required :customer, -> { Orb::Models::CreditNote::Customer } + + # @!attribute invoice_id + # The id of the invoice resource that this credit note is applied to. + # + # @return [String] + required :invoice_id, String + + # @!attribute line_items + # All of the line items associated with this credit note. + # + # @return [Array] + required :line_items, -> { Orb::ArrayOf[Orb::Models::CreditNote::LineItem] } + + # @!attribute maximum_amount_adjustment + # The maximum amount applied on the original invoice + # + # @return [Orb::Models::CreditNote::MaximumAmountAdjustment, nil] + required :maximum_amount_adjustment, -> { Orb::Models::CreditNote::MaximumAmountAdjustment }, nil?: true + + # @!attribute memo + # An optional memo supplied on the credit note. + # + # @return [String, nil] + required :memo, String, nil?: true + + # @!attribute minimum_amount_refunded + # Any credited amount from the applied minimum on the invoice. + # + # @return [String, nil] + required :minimum_amount_refunded, String, nil?: true + + # @!attribute reason + # + # @return [Symbol, Orb::Models::CreditNote::Reason, nil] + required :reason, enum: -> { Orb::Models::CreditNote::Reason }, nil?: true + + # @!attribute subtotal + # The total prior to any creditable invoice-level discounts or minimums. + # + # @return [String] + required :subtotal, String + + # @!attribute total + # The total including creditable invoice-level discounts or minimums, and tax. + # + # @return [String] + required :total, String + + # @!attribute type + # + # @return [Symbol, Orb::Models::CreditNote::Type] + required :type, enum: -> { Orb::Models::CreditNote::Type } + + # @!attribute voided_at + # The time at which the credit note was voided in Orb, if applicable. + # + # @return [Time, nil] + required :voided_at, Time, nil?: true + + # @!attribute [r] discounts + # Any discounts applied on the original invoice. + # + # @return [Array, nil] + optional :discounts, -> { Orb::ArrayOf[Orb::Models::CreditNote::Discount] } + + # @!parse + # # @return [Array] + # attr_writer :discounts + + # @!parse + # # The [Credit Note](/invoicing/credit-notes) resource represents a credit that has + # # been applied to a particular invoice. + # # + # # @param id [String] + # # @param created_at [Time] + # # @param credit_note_number [String] + # # @param credit_note_pdf [String, nil] + # # @param customer [Orb::Models::CreditNote::Customer] + # # @param invoice_id [String] + # # @param line_items [Array] + # # @param maximum_amount_adjustment [Orb::Models::CreditNote::MaximumAmountAdjustment, nil] + # # @param memo [String, nil] + # # @param minimum_amount_refunded [String, nil] + # # @param reason [Symbol, Orb::Models::CreditNote::Reason, nil] + # # @param subtotal [String] + # # @param total [String] + # # @param type [Symbol, Orb::Models::CreditNote::Type] + # # @param voided_at [Time, nil] + # # @param discounts [Array] + # # + # def initialize( + # id:, + # created_at:, + # credit_note_number:, + # credit_note_pdf:, + # customer:, + # invoice_id:, + # line_items:, + # maximum_amount_adjustment:, + # memo:, + # minimum_amount_refunded:, + # reason:, + # subtotal:, + # total:, + # type:, + # voided_at:, + # discounts: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] required :id, String - # @!attribute [rw] external_customer_id - required :external_customer_id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class Discounts < Orb::Model - class AppliesToPrices < Orb::Model - # @!attribute [rw] id - required :id, String - # @!attribute [rw] name_ - required :name_, String + + # @example + # ```ruby + # line_item => { + # id: String, + # amount: String, + # name: String, + # quantity: Float, + # subtotal: String, + # **_ + # } + # ``` + class LineItem < Orb::BaseModel + # @!attribute id + # The Orb id of this resource. + # + # @return [String] + required :id, String + + # @!attribute amount + # The amount of the line item, including any line item minimums and discounts. + # + # @return [String] + required :amount, String + + # @!attribute name + # The name of the corresponding invoice line item. + # + # @return [String] + required :name, String + + # @!attribute quantity + # An optional quantity credited. + # + # @return [Float, nil] + required :quantity, Float, nil?: true + + # @!attribute subtotal + # The amount of the line item, excluding any line item minimums and discounts. + # + # @return [String] + required :subtotal, String + + # @!attribute tax_amounts + # Any tax amounts applied onto the line item. + # + # @return [Array] + required :tax_amounts, -> { Orb::ArrayOf[Orb::Models::CreditNote::LineItem::TaxAmount] } + + # @!attribute [r] discounts + # Any line item discounts from the invoice's line item. + # + # @return [Array, nil] + optional :discounts, -> { Orb::ArrayOf[Orb::Models::CreditNote::LineItem::Discount] } + + # @!parse + # # @return [Array] + # attr_writer :discounts + + # @!parse + # # @param id [String] + # # @param amount [String] + # # @param name [String] + # # @param quantity [Float, nil] + # # @param subtotal [String] + # # @param tax_amounts [Array] + # # @param discounts [Array] + # # + # def initialize(id:, amount:, name:, quantity:, subtotal:, tax_amounts:, discounts: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tax_amount => { + # amount: String, + # tax_rate_description: String, + # tax_rate_percentage: String + # } + # ``` + class TaxAmount < Orb::BaseModel + # @!attribute amount + # The amount of additional tax incurred by this tax rate. + # + # @return [String] + required :amount, String + + # @!attribute tax_rate_description + # The human-readable description of the applied tax rate. + # + # @return [String] + required :tax_rate_description, String + + # @!attribute tax_rate_percentage + # The tax rate percentage, out of 100. + # + # @return [String, nil] + required :tax_rate_percentage, String, nil?: true + + # @!parse + # # @param amount [String] + # # @param tax_rate_description [String] + # # @param tax_rate_percentage [String, nil] + # # + # def initialize(amount:, tax_rate_description:, tax_rate_percentage:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - # @!attribute [rw] amount_applied - required :amount_applied, String - # @!attribute [rw] discount_type - required :discount_type, Orb::Enum.new([:"percentage"]) - # @!attribute [rw] percentage_discount - required :percentage_discount, Float - # @!attribute [rw] applies_to_prices - optional :applies_to_prices, Orb::ArrayOf.new(AppliesToPrices) - # @!attribute [rw] reason - optional :reason, String - end - class LineItems < Orb::Model - class Discounts < Orb::Model - # @!attribute [rw] id + + # @example + # ```ruby + # discount => { + # id: String, + # amount_applied: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: Orb::Models::CreditNote::LineItem::Discount::DiscountType, + # percentage_discount: Float, + # **_ + # } + # ``` + class Discount < Orb::BaseModel + # @!attribute id + # + # @return [String] required :id, String - # @!attribute [rw] amount_applied + + # @!attribute amount_applied + # + # @return [String] required :amount_applied, String - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] discount_type - required :discount_type, Orb::Enum.new([:"percentage", :"amount"]) - # @!attribute [rw] percentage_discount + + # @!attribute applies_to_price_ids + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, Orb::Models::CreditNote::LineItem::Discount::DiscountType] + required :discount_type, enum: -> { Orb::Models::CreditNote::LineItem::Discount::DiscountType } + + # @!attribute percentage_discount + # + # @return [Float] required :percentage_discount, Float - # @!attribute [rw] amount_discount - optional :amount_discount, String - # @!attribute [rw] reason - optional :reason, String - end - class SubLineItems < Orb::Model - # @!attribute [rw] amount - required :amount, String - # @!attribute [rw] name_ - required :name_, String - # @!attribute [rw] quantity - required :quantity, Float - end - class TaxAmounts < Orb::Model - # @!attribute [rw] amount - required :amount, String - # @!attribute [rw] tax_rate_description - required :tax_rate_description, String - # @!attribute [rw] tax_rate_percentage - required :tax_rate_percentage, String + + # @!attribute amount_discount + # + # @return [String, nil] + optional :amount_discount, String, nil?: true + + # @!attribute reason + # + # @return [String, nil] + optional :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount_applied [String] + # # @param applies_to_price_ids [Array] + # # @param discount_type [Symbol, Orb::Models::CreditNote::LineItem::Discount::DiscountType] + # # @param percentage_discount [Float] + # # @param amount_discount [String, nil] + # # @param reason [String, nil] + # # + # def initialize( + # id:, + # amount_applied:, + # applies_to_price_ids:, + # discount_type:, + # percentage_discount:, + # amount_discount: nil, + # reason: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case discount_type + # in :percentage + # # ... + # in :amount + # # ... + # end + # ``` + class DiscountType < Orb::Enum + PERCENTAGE = :percentage + AMOUNT = :amount + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end end - # @!attribute [rw] id - required :id, String - # @!attribute [rw] amount - required :amount, String - # @!attribute [rw] discounts - required :discounts, Orb::ArrayOf.new(Discounts) - # @!attribute [rw] name_ - required :name_, String - # @!attribute [rw] quantity - required :quantity, Float - # @!attribute [rw] sub_line_items - required :sub_line_items, Orb::ArrayOf.new(SubLineItems) - # @!attribute [rw] subtotal - required :subtotal, String - # @!attribute [rw] tax_amounts - required :tax_amounts, Orb::ArrayOf.new(TaxAmounts) end - class MaximumAmountAdjustment < Orb::Model - class AppliesToPrices < Orb::Model - # @!attribute [rw] id + + # @example + # ```ruby + # maximum_amount_adjustment => { + # amount_applied: String, + # discount_type: Orb::Models::CreditNote::MaximumAmountAdjustment::DiscountType, + # percentage_discount: Float, + # applies_to_prices: -> { Orb::ArrayOf[Orb::Models::CreditNote::MaximumAmountAdjustment::AppliesToPrice] === _1 }, + # reason: String + # } + # ``` + class MaximumAmountAdjustment < Orb::BaseModel + # @!attribute amount_applied + # + # @return [String] + required :amount_applied, String + + # @!attribute discount_type + # + # @return [Symbol, Orb::Models::CreditNote::MaximumAmountAdjustment::DiscountType] + required :discount_type, enum: -> { Orb::Models::CreditNote::MaximumAmountAdjustment::DiscountType } + + # @!attribute percentage_discount + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute applies_to_prices + # + # @return [Array, nil] + optional :applies_to_prices, + -> { Orb::ArrayOf[Orb::Models::CreditNote::MaximumAmountAdjustment::AppliesToPrice] }, + nil?: true + + # @!attribute reason + # + # @return [String, nil] + optional :reason, String, nil?: true + + # @!parse + # # The maximum amount applied on the original invoice + # # + # # @param amount_applied [String] + # # @param discount_type [Symbol, Orb::Models::CreditNote::MaximumAmountAdjustment::DiscountType] + # # @param percentage_discount [Float] + # # @param applies_to_prices [Array, nil] + # # @param reason [String, nil] + # # + # def initialize(amount_applied:, discount_type:, percentage_discount:, applies_to_prices: nil, reason: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case discount_type + # in :percentage + # # ... + # end + # ``` + class DiscountType < Orb::Enum + PERCENTAGE = :percentage + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # applies_to_price => { + # id: String, + # name: String + # } + # ``` + class AppliesToPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] required :id, String - # @!attribute [rw] name_ - required :name_, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - # @!attribute [rw] amount_applied + end + + # @abstract + # + # @example + # ```ruby + # case reason + # in :Duplicate + # # ... + # in :Fraudulent + # # ... + # in :"Order change" + # # ... + # in :"Product unsatisfactory" + # # ... + # end + # ``` + class Reason < Orb::Enum + DUPLICATE = :Duplicate + FRAUDULENT = :Fraudulent + ORDER_CHANGE = :"Order change" + PRODUCT_UNSATISFACTORY = :"Product unsatisfactory" + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # @example + # ```ruby + # case type + # in :refund + # # ... + # in :adjustment + # # ... + # end + # ``` + class Type < Orb::Enum + REFUND = :refund + ADJUSTMENT = :adjustment + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # discount => { + # amount_applied: String, + # discount_type: Orb::Models::CreditNote::Discount::DiscountType, + # percentage_discount: Float, + # applies_to_prices: -> { Orb::ArrayOf[Orb::Models::CreditNote::Discount::AppliesToPrice] === _1 }, + # reason: String + # } + # ``` + class Discount < Orb::BaseModel + # @!attribute amount_applied + # + # @return [String] required :amount_applied, String - # @!attribute [rw] discount_type - required :discount_type, Orb::Enum.new([:"percentage"]) - # @!attribute [rw] percentage_discount + + # @!attribute discount_type + # + # @return [Symbol, Orb::Models::CreditNote::Discount::DiscountType] + required :discount_type, enum: -> { Orb::Models::CreditNote::Discount::DiscountType } + + # @!attribute percentage_discount + # + # @return [Float] required :percentage_discount, Float - # @!attribute [rw] applies_to_prices - optional :applies_to_prices, Orb::ArrayOf.new(AppliesToPrices) - # @!attribute [rw] reason - optional :reason, String + + # @!attribute applies_to_prices + # + # @return [Array, nil] + optional :applies_to_prices, + -> { Orb::ArrayOf[Orb::Models::CreditNote::Discount::AppliesToPrice] }, + nil?: true + + # @!attribute reason + # + # @return [String, nil] + optional :reason, String, nil?: true + + # @!parse + # # @param amount_applied [String] + # # @param discount_type [Symbol, Orb::Models::CreditNote::Discount::DiscountType] + # # @param percentage_discount [Float] + # # @param applies_to_prices [Array, nil] + # # @param reason [String, nil] + # # + # def initialize(amount_applied:, discount_type:, percentage_discount:, applies_to_prices: nil, reason: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case discount_type + # in :percentage + # # ... + # end + # ``` + class DiscountType < Orb::Enum + PERCENTAGE = :percentage + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # applies_to_price => { + # id: String, + # name: String + # } + # ``` + class AppliesToPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end end - # @!attribute [rw] id - required :id, String - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] credit_note_number - required :credit_note_number, String - # @!attribute [rw] credit_note_pdf - required :credit_note_pdf, String - # @!attribute [rw] customer - required :customer, Customer - # @!attribute [rw] discounts - required :discounts, Orb::ArrayOf.new(Discounts) - # @!attribute [rw] invoice_id - required :invoice_id, String - # @!attribute [rw] line_items - required :line_items, Orb::ArrayOf.new(LineItems) - # @!attribute [rw] maximum_amount_adjustment - required :maximum_amount_adjustment, MaximumAmountAdjustment - # @!attribute [rw] memo - required :memo, String - # @!attribute [rw] minimum_amount_refunded - required :minimum_amount_refunded, String - # @!attribute [rw] reason - required :reason, - Orb::Enum.new( - [ - :"Duplicate", - :"Fraudulent", - :"Order change", - :"Product unsatisfactory" - ] - ) - # @!attribute [rw] subtotal - required :subtotal, String - # @!attribute [rw] total - required :total, String - # @!attribute [rw] type - required :type, Orb::Enum.new([:"refund", :"adjustment"]) - # @!attribute [rw] voided_at - required :voided_at, String end end end diff --git a/lib/orb/models/credit_note_create_params.rb b/lib/orb/models/credit_note_create_params.rb new file mode 100644 index 00000000..f4855fc2 --- /dev/null +++ b/lib/orb/models/credit_note_create_params.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +module Orb + module Models + class CreditNoteCreateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute line_items + # + # @return [Array] + required :line_items, -> { Orb::ArrayOf[Orb::Models::CreditNoteCreateParams::LineItem] } + + # @!attribute memo + # An optional memo to attach to the credit note. + # + # @return [String, nil] + optional :memo, String, nil?: true + + # @!attribute reason + # An optional reason for the credit note. + # + # @return [Symbol, Orb::Models::CreditNoteCreateParams::Reason, nil] + optional :reason, enum: -> { Orb::Models::CreditNoteCreateParams::Reason }, nil?: true + + # @!parse + # # @param line_items [Array] + # # @param memo [String, nil] + # # @param reason [Symbol, Orb::Models::CreditNoteCreateParams::Reason, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(line_items:, memo: nil, reason: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # line_item => { + # amount: String, + # invoice_line_item_id: String + # } + # ``` + class LineItem < Orb::BaseModel + # @!attribute amount + # The total amount in the invoice's currency to credit this line item. + # + # @return [String] + required :amount, String + + # @!attribute invoice_line_item_id + # The ID of the line item to credit. + # + # @return [String] + required :invoice_line_item_id, String + + # @!parse + # # @param amount [String] + # # @param invoice_line_item_id [String] + # # + # def initialize(amount:, invoice_line_item_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # An optional reason for the credit note. + # + # @example + # ```ruby + # case reason + # in :duplicate + # # ... + # in :fraudulent + # # ... + # in :order_change + # # ... + # in :product_unsatisfactory + # # ... + # end + # ``` + class Reason < Orb::Enum + DUPLICATE = :duplicate + FRAUDULENT = :fraudulent + ORDER_CHANGE = :order_change + PRODUCT_UNSATISFACTORY = :product_unsatisfactory + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/orb/models/credit_note_fetch_params.rb b/lib/orb/models/credit_note_fetch_params.rb new file mode 100644 index 00000000..b71c30fd --- /dev/null +++ b/lib/orb/models/credit_note_fetch_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class CreditNoteFetchParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/credit_note_list_params.rb b/lib/orb/models/credit_note_list_params.rb new file mode 100644 index 00000000..f0d3e45f --- /dev/null +++ b/lib/orb/models/credit_note_list_params.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Orb + module Models + class CreditNoteListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!parse + # # @param cursor [String, nil] + # # @param limit [Integer] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(cursor: nil, limit: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/customer.rb b/lib/orb/models/customer.rb index 347889f6..b220e68d 100644 --- a/lib/orb/models/customer.rb +++ b/lib/orb/models/customer.rb @@ -1,227 +1,913 @@ -require "orb/model" +# frozen_string_literal: true + module Orb module Models - class Customer < Orb::Model - class BillingAddress < Orb::Model - # @!attribute [rw] city - required :city, String - # @!attribute [rw] country - required :country, String - # @!attribute [rw] line1 - required :line1, String - # @!attribute [rw] line2 - required :line2, String - # @!attribute [rw] postal_code - required :postal_code, String - # @!attribute [rw] state - required :state, String + # @example + # ```ruby + # customer => { + # id: String, + # additional_emails: -> { Orb::ArrayOf[String] === _1 }, + # auto_collection: Orb::BooleanModel, + # balance: String, + # billing_address: Orb::Models::Customer::BillingAddress, + # **_ + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute additional_emails + # + # @return [Array] + required :additional_emails, Orb::ArrayOf[String] + + # @!attribute auto_collection + # + # @return [Boolean] + required :auto_collection, Orb::BooleanModel + + # @!attribute balance + # The customer's current balance in their currency. + # + # @return [String] + required :balance, String + + # @!attribute billing_address + # + # @return [Orb::Models::Customer::BillingAddress, nil] + required :billing_address, -> { Orb::Models::Customer::BillingAddress }, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute currency + # + # @return [String, nil] + required :currency, String, nil?: true + + # @!attribute email + # A valid customer email, to be used for notifications. When Orb triggers payment + # through a payment gateway, this email will be used for any automatically issued + # receipts. + # + # @return [String] + required :email, String + + # @!attribute email_delivery + # + # @return [Boolean] + required :email_delivery, Orb::BooleanModel + + # @!attribute exempt_from_automated_tax + # + # @return [Boolean, nil] + required :exempt_from_automated_tax, Orb::BooleanModel, nil?: true + + # @!attribute external_customer_id + # An optional user-defined ID for this customer resource, used throughout the + # system as an alias for this Customer. Use this field to identify a customer by + # an existing identifier in your system. + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute name + # The full name of the customer + # + # @return [String] + required :name, String + + # @!attribute payment_provider + # This is used for creating charges or invoices in an external system via Orb. + # When not in test mode, the connection must first be configured in the Orb + # webapp. + # + # @return [Symbol, Orb::Models::Customer::PaymentProvider, nil] + required :payment_provider, enum: -> { Orb::Models::Customer::PaymentProvider }, nil?: true + + # @!attribute payment_provider_id + # The ID of this customer in an external payments solution, such as Stripe. This + # is used for creating charges or invoices in the external system via Orb. + # + # @return [String, nil] + required :payment_provider_id, String, nil?: true + + # @!attribute portal_url + # + # @return [String, nil] + required :portal_url, String, nil?: true + + # @!attribute shipping_address + # + # @return [Orb::Models::Customer::ShippingAddress, nil] + required :shipping_address, -> { Orb::Models::Customer::ShippingAddress }, nil?: true + + # @!attribute tax_id + # Tax IDs are commonly required to be displayed on customer invoices, which are + # added to the headers of invoices. + # + # ### Supported Tax ID Countries and Types + # + # | Country | Type | Description | + # | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # | Andorra | `ad_nrt` | Andorran NRT Number | + # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # | Austria | `eu_vat` | European VAT Number | + # | Bahrain | `bh_vat` | Bahraini VAT Number | + # | Belgium | `eu_vat` | European VAT Number | + # | Bolivia | `bo_tin` | Bolivian Tax ID | + # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # | Brazil | `br_cpf` | Brazilian CPF Number | + # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # | Bulgaria | `eu_vat` | European VAT Number | + # | Canada | `ca_bn` | Canadian BN | + # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # | Chile | `cl_tin` | Chilean TIN | + # | China | `cn_tin` | Chinese Tax ID | + # | Colombia | `co_nit` | Colombian NIT Number | + # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # | Croatia | `eu_vat` | European VAT Number | + # | Cyprus | `eu_vat` | European VAT Number | + # | Czech Republic | `eu_vat` | European VAT Number | + # | Denmark | `eu_vat` | European VAT Number | + # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # | Estonia | `eu_vat` | European VAT Number | + # | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # | Finland | `eu_vat` | European VAT Number | + # | France | `eu_vat` | European VAT Number | + # | Georgia | `ge_vat` | Georgian VAT | + # | Germany | `eu_vat` | European VAT Number | + # | Greece | `eu_vat` | European VAT Number | + # | Hong Kong | `hk_br` | Hong Kong BR Number | + # | Hungary | `eu_vat` | European VAT Number | + # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # | Iceland | `is_vat` | Icelandic VAT | + # | India | `in_gst` | Indian GST Number | + # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # | Ireland | `eu_vat` | European VAT Number | + # | Israel | `il_vat` | Israel VAT | + # | Italy | `eu_vat` | European VAT Number | + # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # | Latvia | `eu_vat` | European VAT Number | + # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # | Lithuania | `eu_vat` | European VAT Number | + # | Luxembourg | `eu_vat` | European VAT Number | + # | Malaysia | `my_frp` | Malaysian FRP Number | + # | Malaysia | `my_itn` | Malaysian ITN | + # | Malaysia | `my_sst` | Malaysian SST Number | + # | Malta | `eu_vat ` | European VAT Number | + # | Mexico | `mx_rfc` | Mexican RFC Number | + # | Netherlands | `eu_vat` | European VAT Number | + # | New Zealand | `nz_gst` | New Zealand GST Number | + # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # | Norway | `no_vat` | Norwegian VAT Number | + # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # | Oman | `om_vat` | Omani VAT Number | + # | Peru | `pe_ruc` | Peruvian RUC Number | + # | Philippines | `ph_tin ` | Philippines Tax Identification Number | + # | Poland | `eu_vat` | European VAT Number | + # | Portugal | `eu_vat` | European VAT Number | + # | Romania | `eu_vat` | European VAT Number | + # | Romania | `ro_tin` | Romanian Tax ID Number | + # | Russia | `ru_inn` | Russian INN | + # | Russia | `ru_kpp` | Russian KPP | + # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # | Serbia | `rs_pib` | Serbian PIB Number | + # | Singapore | `sg_gst` | Singaporean GST | + # | Singapore | `sg_uen` | Singaporean UEN | + # | Slovakia | `eu_vat` | European VAT Number | + # | Slovenia | `eu_vat` | European VAT Number | + # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # | South Africa | `za_vat` | South African VAT Number | + # | South Korea | `kr_brn` | Korean BRN | + # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # | Spain | `eu_vat` | European VAT Number | + # | Sweden | `eu_vat` | European VAT Number | + # | Switzerland | `ch_vat` | Switzerland VAT Number | + # | Taiwan | `tw_vat` | Taiwanese VAT | + # | Thailand | `th_vat` | Thai VAT | + # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # | Ukraine | `ua_vat` | Ukrainian VAT | + # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # | United States | `us_ein` | United States EIN | + # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # + # @return [Orb::Models::Customer::TaxID, nil] + required :tax_id, -> { Orb::Models::Customer::TaxID }, nil?: true + + # @!attribute timezone + # A timezone identifier from the IANA timezone database, such as + # "America/Los_Angeles". This "defaults to your account's timezone if not set. + # This cannot be changed after customer creation. + # + # @return [String] + required :timezone, String + + # @!attribute accounting_sync_configuration + # + # @return [Orb::Models::Customer::AccountingSyncConfiguration, nil] + optional :accounting_sync_configuration, + -> { Orb::Models::Customer::AccountingSyncConfiguration }, + nil?: true + + # @!attribute reporting_configuration + # + # @return [Orb::Models::Customer::ReportingConfiguration, nil] + optional :reporting_configuration, -> { Orb::Models::Customer::ReportingConfiguration }, nil?: true + + # @!parse + # # A customer is a buyer of your products, and the other party to the billing + # # relationship. + # # + # # In Orb, customers are assigned system generated identifiers automatically, but + # # it's often desirable to have these match existing identifiers in your system. To + # # avoid having to denormalize Orb ID information, you can pass in an + # # `external_customer_id` with your own identifier. See + # # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + # # information about how these aliases work in Orb. + # # + # # In addition to having an identifier in your system, a customer may exist in a + # # payment provider solution like Stripe. Use the `payment_provider_id` and the + # # `payment_provider` enum field to express this mapping. + # # + # # A customer also has a timezone (from the standard + # # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + # # your account's timezone. See [Timezone localization](/essentials/timezones) for + # # information on what this timezone parameter influences within Orb. + # # + # # @param id [String] + # # @param additional_emails [Array] + # # @param auto_collection [Boolean] + # # @param balance [String] + # # @param billing_address [Orb::Models::Customer::BillingAddress, nil] + # # @param created_at [Time] + # # @param currency [String, nil] + # # @param email [String] + # # @param email_delivery [Boolean] + # # @param exempt_from_automated_tax [Boolean, nil] + # # @param external_customer_id [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param name [String] + # # @param payment_provider [Symbol, Orb::Models::Customer::PaymentProvider, nil] + # # @param payment_provider_id [String, nil] + # # @param portal_url [String, nil] + # # @param shipping_address [Orb::Models::Customer::ShippingAddress, nil] + # # @param tax_id [Orb::Models::Customer::TaxID, nil] + # # @param timezone [String] + # # @param accounting_sync_configuration [Orb::Models::Customer::AccountingSyncConfiguration, nil] + # # @param reporting_configuration [Orb::Models::Customer::ReportingConfiguration, nil] + # # + # def initialize( + # id:, + # additional_emails:, + # auto_collection:, + # balance:, + # billing_address:, + # created_at:, + # currency:, + # email:, + # email_delivery:, + # exempt_from_automated_tax:, + # external_customer_id:, + # metadata:, + # name:, + # payment_provider:, + # payment_provider_id:, + # portal_url:, + # shipping_address:, + # tax_id:, + # timezone:, + # accounting_sync_configuration: nil, + # reporting_configuration: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billing_address => { + # city: String, + # country: String, + # line1: String, + # line2: String, + # postal_code: String + # } + # ``` + class BillingAddress < Orb::BaseModel + # @!attribute city + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute line1 + # + # @return [String, nil] + required :line1, String, nil?: true + + # @!attribute line2 + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute postal_code + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # + # @return [String, nil] + required :state, String, nil?: true + + # @!parse + # # @param city [String, nil] + # # @param country [String, nil] + # # @param line1 [String, nil] + # # @param line2 [String, nil] + # # @param postal_code [String, nil] + # # @param state [String, nil] + # # + # def initialize(city:, country:, line1:, line2:, postal_code:, state:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class ShippingAddress < Orb::Model - # @!attribute [rw] city - required :city, String - # @!attribute [rw] country - required :country, String - # @!attribute [rw] line1 - required :line1, String - # @!attribute [rw] line2 - required :line2, String - # @!attribute [rw] postal_code - required :postal_code, String - # @!attribute [rw] state - required :state, String + + # @abstract + # + # This is used for creating charges or invoices in an external system via Orb. + # When not in test mode, the connection must first be configured in the Orb + # webapp. + # + # @example + # ```ruby + # case payment_provider + # in :quickbooks + # # ... + # in :"bill.com" + # # ... + # in :stripe_charge + # # ... + # in :stripe_invoice + # # ... + # in :netsuite + # # ... + # end + # ``` + class PaymentProvider < Orb::Enum + QUICKBOOKS = :quickbooks + BILL_COM = :"bill.com" + STRIPE_CHARGE = :stripe_charge + STRIPE_INVOICE = :stripe_invoice + NETSUITE = :netsuite + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end end - class TaxID < Orb::Model - # @!attribute [rw] country - required :country, - Orb::Enum.new( - [ - :"AE", - :"AT", - :"AU", - :"BE", - :"BG", - :"BR", - :"CA", - :"CH", - :"CL", - :"CY", - :"CZ", - :"DE", - :"DK", - :"EE", - :"EG", - :"ES", - :"EU", - :"FI", - :"FR", - :"GB", - :"GE", - :"GR", - :"HK", - :"HR", - :"HU", - :"ID", - :"IE", - :"IL", - :"IN", - :"IS", - :"IT", - :"JP", - :"KE", - :"KR", - :"LI", - :"LT", - :"LU", - :"LV", - :"MT", - :"MX", - :"MY", - :"NL", - :"NO", - :"NZ", - :"PH", - :"PL", - :"PT", - :"RO", - :"RU", - :"SA", - :"SE", - :"SG", - :"SI", - :"SK", - :"TH", - :"TR", - :"TW", - :"UA", - :"US", - :"ZA" - ] - ) - # @!attribute [rw] type - required :type, - Orb::Enum.new( - [ - :"ae_trn", - :"eu_vat", - :"au_abn", - :"au_arn", - :"bg_uic", - :"br_cnpj", - :"br_cpf", - :"ca_bn", - :"ca_gst_hst", - :"ca_pst_bc", - :"ca_pst_mb", - :"ca_pst_sk", - :"ca_qst", - :"ch_vat", - :"cl_tin", - :"eg_tin", - :"es_cif", - :"eu_oss_vat", - :"gb_vat", - :"ge_vat", - :"hk_br", - :"hu_tin", - :"id_npwp", - :"il_vat", - :"in_gst", - :"is_vat", - :"jp_cn", - :"jp_rn", - :"jp_trn", - :"ke_pin", - :"kr_brn", - :"li_uid", - :"mx_rfc", - :"my_frp", - :"my_itn", - :"my_sst", - :"no_vat", - :"nz_gst", - :"ph_tin", - :"ru_inn", - :"ru_kpp", - :"sa_vat", - :"sg_gst", - :"sg_uen", - :"si_tin", - :"th_vat", - :"tr_tin", - :"tw_vat", - :"ua_vat", - :"us_ein", - :"za_vat" - ] - ) - # @!attribute [rw] value - required :value, String + + # @example + # ```ruby + # shipping_address => { + # city: String, + # country: String, + # line1: String, + # line2: String, + # postal_code: String + # } + # ``` + class ShippingAddress < Orb::BaseModel + # @!attribute city + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute line1 + # + # @return [String, nil] + required :line1, String, nil?: true + + # @!attribute line2 + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute postal_code + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # + # @return [String, nil] + required :state, String, nil?: true + + # @!parse + # # @param city [String, nil] + # # @param country [String, nil] + # # @param line1 [String, nil] + # # @param line2 [String, nil] + # # @param postal_code [String, nil] + # # @param state [String, nil] + # # + # def initialize(city:, country:, line1:, line2:, postal_code:, state:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class AccountingSyncConfiguration < Orb::Model - class AccountingProviders < Orb::Model - # @!attribute [rw] external_provider_id - required :external_provider_id, String - # @!attribute [rw] provider_type - required :provider_type, Orb::Enum.new([:"quickbooks", :"netsuite"]) + + # @example + # ```ruby + # tax_id => { + # country: Orb::Models::Customer::TaxID::Country, + # type: Orb::Models::Customer::TaxID::Type, + # value: String + # } + # ``` + class TaxID < Orb::BaseModel + # @!attribute country + # + # @return [Symbol, Orb::Models::Customer::TaxID::Country] + required :country, enum: -> { Orb::Models::Customer::TaxID::Country } + + # @!attribute type + # + # @return [Symbol, Orb::Models::Customer::TaxID::Type] + required :type, enum: -> { Orb::Models::Customer::TaxID::Type } + + # @!attribute value + # + # @return [String] + required :value, String + + # @!parse + # # Tax IDs are commonly required to be displayed on customer invoices, which are + # # added to the headers of invoices. + # # + # # ### Supported Tax ID Countries and Types + # # + # # | Country | Type | Description | + # # | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # # | Andorra | `ad_nrt` | Andorran NRT Number | + # # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # # | Austria | `eu_vat` | European VAT Number | + # # | Bahrain | `bh_vat` | Bahraini VAT Number | + # # | Belgium | `eu_vat` | European VAT Number | + # # | Bolivia | `bo_tin` | Bolivian Tax ID | + # # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # # | Brazil | `br_cpf` | Brazilian CPF Number | + # # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # # | Bulgaria | `eu_vat` | European VAT Number | + # # | Canada | `ca_bn` | Canadian BN | + # # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # # | Chile | `cl_tin` | Chilean TIN | + # # | China | `cn_tin` | Chinese Tax ID | + # # | Colombia | `co_nit` | Colombian NIT Number | + # # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # # | Croatia | `eu_vat` | European VAT Number | + # # | Cyprus | `eu_vat` | European VAT Number | + # # | Czech Republic | `eu_vat` | European VAT Number | + # # | Denmark | `eu_vat` | European VAT Number | + # # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # # | Estonia | `eu_vat` | European VAT Number | + # # | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # # | Finland | `eu_vat` | European VAT Number | + # # | France | `eu_vat` | European VAT Number | + # # | Georgia | `ge_vat` | Georgian VAT | + # # | Germany | `eu_vat` | European VAT Number | + # # | Greece | `eu_vat` | European VAT Number | + # # | Hong Kong | `hk_br` | Hong Kong BR Number | + # # | Hungary | `eu_vat` | European VAT Number | + # # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # # | Iceland | `is_vat` | Icelandic VAT | + # # | India | `in_gst` | Indian GST Number | + # # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # # | Ireland | `eu_vat` | European VAT Number | + # # | Israel | `il_vat` | Israel VAT | + # # | Italy | `eu_vat` | European VAT Number | + # # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # # | Latvia | `eu_vat` | European VAT Number | + # # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # # | Lithuania | `eu_vat` | European VAT Number | + # # | Luxembourg | `eu_vat` | European VAT Number | + # # | Malaysia | `my_frp` | Malaysian FRP Number | + # # | Malaysia | `my_itn` | Malaysian ITN | + # # | Malaysia | `my_sst` | Malaysian SST Number | + # # | Malta | `eu_vat ` | European VAT Number | + # # | Mexico | `mx_rfc` | Mexican RFC Number | + # # | Netherlands | `eu_vat` | European VAT Number | + # # | New Zealand | `nz_gst` | New Zealand GST Number | + # # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # # | Norway | `no_vat` | Norwegian VAT Number | + # # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # # | Oman | `om_vat` | Omani VAT Number | + # # | Peru | `pe_ruc` | Peruvian RUC Number | + # # | Philippines | `ph_tin ` | Philippines Tax Identification Number | + # # | Poland | `eu_vat` | European VAT Number | + # # | Portugal | `eu_vat` | European VAT Number | + # # | Romania | `eu_vat` | European VAT Number | + # # | Romania | `ro_tin` | Romanian Tax ID Number | + # # | Russia | `ru_inn` | Russian INN | + # # | Russia | `ru_kpp` | Russian KPP | + # # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # # | Serbia | `rs_pib` | Serbian PIB Number | + # # | Singapore | `sg_gst` | Singaporean GST | + # # | Singapore | `sg_uen` | Singaporean UEN | + # # | Slovakia | `eu_vat` | European VAT Number | + # # | Slovenia | `eu_vat` | European VAT Number | + # # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # # | South Africa | `za_vat` | South African VAT Number | + # # | South Korea | `kr_brn` | Korean BRN | + # # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # # | Spain | `eu_vat` | European VAT Number | + # # | Sweden | `eu_vat` | European VAT Number | + # # | Switzerland | `ch_vat` | Switzerland VAT Number | + # # | Taiwan | `tw_vat` | Taiwanese VAT | + # # | Thailand | `th_vat` | Thai VAT | + # # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # # | Ukraine | `ua_vat` | Ukrainian VAT | + # # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # # | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + # # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # # | United States | `us_ein` | United States EIN | + # # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # # + # # @param country [Symbol, Orb::Models::Customer::TaxID::Country] + # # @param type [Symbol, Orb::Models::Customer::TaxID::Type] + # # @param value [String] + # # + # def initialize(country:, type:, value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case country + # in :AD + # # ... + # in :AE + # # ... + # in :AR + # # ... + # in :AT + # # ... + # in :AU + # # ... + # in ... + # #... + # end + # ``` + class Country < Orb::Enum + AD = :AD + AE = :AE + AR = :AR + AT = :AT + AU = :AU + BE = :BE + BG = :BG + BH = :BH + BO = :BO + BR = :BR + CA = :CA + CH = :CH + CL = :CL + CN = :CN + CO = :CO + CR = :CR + CY = :CY + CZ = :CZ + DE = :DE + DK = :DK + EE = :EE + DO = :DO + EC = :EC + EG = :EG + ES = :ES + EU = :EU + FI = :FI + FR = :FR + GB = :GB + GE = :GE + GR = :GR + HK = :HK + HR = :HR + HU = :HU + ID = :ID + IE = :IE + IL = :IL + IN = :IN + IS = :IS + IT = :IT + JP = :JP + KE = :KE + KR = :KR + KZ = :KZ + LI = :LI + LT = :LT + LU = :LU + LV = :LV + MT = :MT + MX = :MX + MY = :MY + NG = :NG + NL = :NL + NO = :NO + NZ = :NZ + OM = :OM + PE = :PE + PH = :PH + PL = :PL + PT = :PT + RO = :RO + RS = :RS + RU = :RU + SA = :SA + SE = :SE + SG = :SG + SI = :SI + SK = :SK + SV = :SV + TH = :TH + TR = :TR + TW = :TW + UA = :UA + US = :US + UY = :UY + VE = :VE + VN = :VN + ZA = :ZA + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # @example + # ```ruby + # case type + # in :ad_nrt + # # ... + # in :ae_trn + # # ... + # in :ar_cuit + # # ... + # in :eu_vat + # # ... + # in :au_abn + # # ... + # in ... + # #... + # end + # ``` + class Type < Orb::Enum + AD_NRT = :ad_nrt + AE_TRN = :ae_trn + AR_CUIT = :ar_cuit + EU_VAT = :eu_vat + AU_ABN = :au_abn + AU_ARN = :au_arn + BG_UIC = :bg_uic + BH_VAT = :bh_vat + BO_TIN = :bo_tin + BR_CNPJ = :br_cnpj + BR_CPF = :br_cpf + CA_BN = :ca_bn + CA_GST_HST = :ca_gst_hst + CA_PST_BC = :ca_pst_bc + CA_PST_MB = :ca_pst_mb + CA_PST_SK = :ca_pst_sk + CA_QST = :ca_qst + CH_VAT = :ch_vat + CL_TIN = :cl_tin + CN_TIN = :cn_tin + CO_NIT = :co_nit + CR_TIN = :cr_tin + DO_RCN = :do_rcn + EC_RUC = :ec_ruc + EG_TIN = :eg_tin + ES_CIF = :es_cif + EU_OSS_VAT = :eu_oss_vat + GB_VAT = :gb_vat + GE_VAT = :ge_vat + HK_BR = :hk_br + HU_TIN = :hu_tin + ID_NPWP = :id_npwp + IL_VAT = :il_vat + IN_GST = :in_gst + IS_VAT = :is_vat + JP_CN = :jp_cn + JP_RN = :jp_rn + JP_TRN = :jp_trn + KE_PIN = :ke_pin + KR_BRN = :kr_brn + KZ_BIN = :kz_bin + LI_UID = :li_uid + MX_RFC = :mx_rfc + MY_FRP = :my_frp + MY_ITN = :my_itn + MY_SST = :my_sst + NG_TIN = :ng_tin + NO_VAT = :no_vat + NO_VOEC = :no_voec + NZ_GST = :nz_gst + OM_VAT = :om_vat + PE_RUC = :pe_ruc + PH_TIN = :ph_tin + RO_TIN = :ro_tin + RS_PIB = :rs_pib + RU_INN = :ru_inn + RU_KPP = :ru_kpp + SA_VAT = :sa_vat + SG_GST = :sg_gst + SG_UEN = :sg_uen + SI_TIN = :si_tin + SV_NIT = :sv_nit + TH_VAT = :th_vat + TR_TIN = :tr_tin + TW_VAT = :tw_vat + UA_VAT = :ua_vat + US_EIN = :us_ein + UY_RUC = :uy_ruc + VE_RIF = :ve_rif + VN_TIN = :vn_tin + ZA_VAT = :za_vat + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end end - # @!attribute [rw] accounting_providers - required :accounting_providers, Orb::ArrayOf.new(AccountingProviders) - # @!attribute [rw] excluded + end + + # @example + # ```ruby + # accounting_sync_configuration => { + # accounting_providers: -> { Orb::ArrayOf[Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider] === _1 }, + # excluded: Orb::BooleanModel + # } + # ``` + class AccountingSyncConfiguration < Orb::BaseModel + # @!attribute accounting_providers + # + # @return [Array] + required :accounting_providers, + -> { Orb::ArrayOf[Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider] } + + # @!attribute excluded + # + # @return [Boolean] required :excluded, Orb::BooleanModel + + # @!parse + # # @param accounting_providers [Array] + # # @param excluded [Boolean] + # # + # def initialize(accounting_providers:, excluded:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # accounting_provider => { + # external_provider_id: String, + # provider_type: Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider::ProviderType + # } + # ``` + class AccountingProvider < Orb::BaseModel + # @!attribute external_provider_id + # + # @return [String, nil] + required :external_provider_id, String, nil?: true + + # @!attribute provider_type + # + # @return [Symbol, Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider::ProviderType] + required :provider_type, + enum: -> { + Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider::ProviderType + } + + # @!parse + # # @param external_provider_id [String, nil] + # # @param provider_type [Symbol, Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider::ProviderType] + # # + # def initialize(external_provider_id:, provider_type:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case provider_type + # in :quickbooks + # # ... + # in :netsuite + # # ... + # end + # ``` + class ProviderType < Orb::Enum + QUICKBOOKS = :quickbooks + NETSUITE = :netsuite + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end end - class ReportingConfiguration < Orb::Model - # @!attribute [rw] exempt + + # @example + # ```ruby + # reporting_configuration => { + # exempt: Orb::BooleanModel + # } + # ``` + class ReportingConfiguration < Orb::BaseModel + # @!attribute exempt + # + # @return [Boolean] required :exempt, Orb::BooleanModel + + # @!parse + # # @param exempt [Boolean] + # # + # def initialize(exempt:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - # @!attribute [rw] id - required :id, String - # @!attribute [rw] additional_emails - required :additional_emails, Orb::ArrayOf.new(String) - # @!attribute [rw] auto_collection - required :auto_collection, Orb::BooleanModel - # @!attribute [rw] balance - required :balance, String - # @!attribute [rw] billing_address - required :billing_address, BillingAddress - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] currency - required :currency, String - # @!attribute [rw] email - required :email, String - # @!attribute [rw] email_delivery - required :email_delivery, Orb::BooleanModel - # @!attribute [rw] external_customer_id - required :external_customer_id, String - # @!attribute [rw] metadata - required :metadata, Hash - # @!attribute [rw] name_ - required :name_, String - # @!attribute [rw] payment_provider - required :payment_provider, - Orb::Enum.new( - [ - :"quickbooks", - :"bill.com", - :"stripe_charge", - :"stripe_invoice", - :"netsuite" - ] - ) - # @!attribute [rw] payment_provider_id - required :payment_provider_id, String - # @!attribute [rw] portal_url - required :portal_url, String - # @!attribute [rw] shipping_address - required :shipping_address, ShippingAddress - # @!attribute [rw] tax_id - required :tax_id, TaxID - # @!attribute [rw] timezone - required :timezone, String - # @!attribute [rw] accounting_sync_configuration - optional :accounting_sync_configuration, AccountingSyncConfiguration - # @!attribute [rw] reporting_configuration - optional :reporting_configuration, ReportingConfiguration end end end diff --git a/lib/orb/models/customer_create_params.rb b/lib/orb/models/customer_create_params.rb new file mode 100644 index 00000000..1f69a508 --- /dev/null +++ b/lib/orb/models/customer_create_params.rb @@ -0,0 +1,942 @@ +# frozen_string_literal: true + +module Orb + module Models + class CustomerCreateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute email + # A valid customer email, to be used for notifications. When Orb triggers payment + # through a payment gateway, this email will be used for any automatically issued + # receipts. + # + # @return [String] + required :email, String + + # @!attribute name + # The full name of the customer + # + # @return [String] + required :name, String + + # @!attribute accounting_sync_configuration + # + # @return [Orb::Models::CustomerCreateParams::AccountingSyncConfiguration, nil] + optional :accounting_sync_configuration, + -> { Orb::Models::CustomerCreateParams::AccountingSyncConfiguration }, + nil?: true + + # @!attribute additional_emails + # Additional email addresses for this customer. If populated, these email + # addresses will be CC'd for customer communications. + # + # @return [Array, nil] + optional :additional_emails, Orb::ArrayOf[String], nil?: true + + # @!attribute auto_collection + # Used to determine if invoices for this customer will automatically attempt to + # charge a saved payment method, if available. This parameter defaults to `True` + # when a payment provider is provided on customer creation. + # + # @return [Boolean, nil] + optional :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute billing_address + # + # @return [Orb::Models::CustomerCreateParams::BillingAddress, nil] + optional :billing_address, -> { Orb::Models::CustomerCreateParams::BillingAddress }, nil?: true + + # @!attribute currency + # An ISO 4217 currency string used for the customer's invoices and balance. If not + # set at creation time, will be set at subscription creation time. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute email_delivery + # + # @return [Boolean, nil] + optional :email_delivery, Orb::BooleanModel, nil?: true + + # @!attribute external_customer_id + # An optional user-defined ID for this customer resource, used throughout the + # system as an alias for this Customer. Use this field to identify a customer by + # an existing identifier in your system. + # + # @return [String, nil] + optional :external_customer_id, String, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute payment_provider + # This is used for creating charges or invoices in an external system via Orb. + # When not in test mode, the connection must first be configured in the Orb + # webapp. + # + # @return [Symbol, Orb::Models::CustomerCreateParams::PaymentProvider, nil] + optional :payment_provider, enum: -> { Orb::Models::CustomerCreateParams::PaymentProvider }, nil?: true + + # @!attribute payment_provider_id + # The ID of this customer in an external payments solution, such as Stripe. This + # is used for creating charges or invoices in the external system via Orb. + # + # @return [String, nil] + optional :payment_provider_id, String, nil?: true + + # @!attribute reporting_configuration + # + # @return [Orb::Models::CustomerCreateParams::ReportingConfiguration, nil] + optional :reporting_configuration, + -> { Orb::Models::CustomerCreateParams::ReportingConfiguration }, + nil?: true + + # @!attribute shipping_address + # + # @return [Orb::Models::CustomerCreateParams::ShippingAddress, nil] + optional :shipping_address, -> { Orb::Models::CustomerCreateParams::ShippingAddress }, nil?: true + + # @!attribute tax_configuration + # + # @return [Orb::Models::CustomerCreateParams::TaxConfiguration::NewAvalaraTaxConfiguration, Orb::Models::CustomerCreateParams::TaxConfiguration::NewTaxJarConfiguration, nil] + optional :tax_configuration, + union: -> { + Orb::Models::CustomerCreateParams::TaxConfiguration + }, + nil?: true + + # @!attribute tax_id + # Tax IDs are commonly required to be displayed on customer invoices, which are + # added to the headers of invoices. + # + # ### Supported Tax ID Countries and Types + # + # | Country | Type | Description | + # | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # | Andorra | `ad_nrt` | Andorran NRT Number | + # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # | Austria | `eu_vat` | European VAT Number | + # | Bahrain | `bh_vat` | Bahraini VAT Number | + # | Belgium | `eu_vat` | European VAT Number | + # | Bolivia | `bo_tin` | Bolivian Tax ID | + # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # | Brazil | `br_cpf` | Brazilian CPF Number | + # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # | Bulgaria | `eu_vat` | European VAT Number | + # | Canada | `ca_bn` | Canadian BN | + # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # | Chile | `cl_tin` | Chilean TIN | + # | China | `cn_tin` | Chinese Tax ID | + # | Colombia | `co_nit` | Colombian NIT Number | + # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # | Croatia | `eu_vat` | European VAT Number | + # | Cyprus | `eu_vat` | European VAT Number | + # | Czech Republic | `eu_vat` | European VAT Number | + # | Denmark | `eu_vat` | European VAT Number | + # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # | Estonia | `eu_vat` | European VAT Number | + # | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # | Finland | `eu_vat` | European VAT Number | + # | France | `eu_vat` | European VAT Number | + # | Georgia | `ge_vat` | Georgian VAT | + # | Germany | `eu_vat` | European VAT Number | + # | Greece | `eu_vat` | European VAT Number | + # | Hong Kong | `hk_br` | Hong Kong BR Number | + # | Hungary | `eu_vat` | European VAT Number | + # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # | Iceland | `is_vat` | Icelandic VAT | + # | India | `in_gst` | Indian GST Number | + # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # | Ireland | `eu_vat` | European VAT Number | + # | Israel | `il_vat` | Israel VAT | + # | Italy | `eu_vat` | European VAT Number | + # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # | Latvia | `eu_vat` | European VAT Number | + # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # | Lithuania | `eu_vat` | European VAT Number | + # | Luxembourg | `eu_vat` | European VAT Number | + # | Malaysia | `my_frp` | Malaysian FRP Number | + # | Malaysia | `my_itn` | Malaysian ITN | + # | Malaysia | `my_sst` | Malaysian SST Number | + # | Malta | `eu_vat ` | European VAT Number | + # | Mexico | `mx_rfc` | Mexican RFC Number | + # | Netherlands | `eu_vat` | European VAT Number | + # | New Zealand | `nz_gst` | New Zealand GST Number | + # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # | Norway | `no_vat` | Norwegian VAT Number | + # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # | Oman | `om_vat` | Omani VAT Number | + # | Peru | `pe_ruc` | Peruvian RUC Number | + # | Philippines | `ph_tin ` | Philippines Tax Identification Number | + # | Poland | `eu_vat` | European VAT Number | + # | Portugal | `eu_vat` | European VAT Number | + # | Romania | `eu_vat` | European VAT Number | + # | Romania | `ro_tin` | Romanian Tax ID Number | + # | Russia | `ru_inn` | Russian INN | + # | Russia | `ru_kpp` | Russian KPP | + # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # | Serbia | `rs_pib` | Serbian PIB Number | + # | Singapore | `sg_gst` | Singaporean GST | + # | Singapore | `sg_uen` | Singaporean UEN | + # | Slovakia | `eu_vat` | European VAT Number | + # | Slovenia | `eu_vat` | European VAT Number | + # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # | South Africa | `za_vat` | South African VAT Number | + # | South Korea | `kr_brn` | Korean BRN | + # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # | Spain | `eu_vat` | European VAT Number | + # | Sweden | `eu_vat` | European VAT Number | + # | Switzerland | `ch_vat` | Switzerland VAT Number | + # | Taiwan | `tw_vat` | Taiwanese VAT | + # | Thailand | `th_vat` | Thai VAT | + # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # | Ukraine | `ua_vat` | Ukrainian VAT | + # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # | United States | `us_ein` | United States EIN | + # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # + # @return [Orb::Models::CustomerCreateParams::TaxID, nil] + optional :tax_id, -> { Orb::Models::CustomerCreateParams::TaxID }, nil?: true + + # @!attribute timezone + # A timezone identifier from the IANA timezone database, such as + # `"America/Los_Angeles"`. This defaults to your account's timezone if not set. + # This cannot be changed after customer creation. + # + # @return [String, nil] + optional :timezone, String, nil?: true + + # @!parse + # # @param email [String] + # # @param name [String] + # # @param accounting_sync_configuration [Orb::Models::CustomerCreateParams::AccountingSyncConfiguration, nil] + # # @param additional_emails [Array, nil] + # # @param auto_collection [Boolean, nil] + # # @param billing_address [Orb::Models::CustomerCreateParams::BillingAddress, nil] + # # @param currency [String, nil] + # # @param email_delivery [Boolean, nil] + # # @param external_customer_id [String, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param payment_provider [Symbol, Orb::Models::CustomerCreateParams::PaymentProvider, nil] + # # @param payment_provider_id [String, nil] + # # @param reporting_configuration [Orb::Models::CustomerCreateParams::ReportingConfiguration, nil] + # # @param shipping_address [Orb::Models::CustomerCreateParams::ShippingAddress, nil] + # # @param tax_configuration [Orb::Models::CustomerCreateParams::TaxConfiguration::NewAvalaraTaxConfiguration, Orb::Models::CustomerCreateParams::TaxConfiguration::NewTaxJarConfiguration, nil] + # # @param tax_id [Orb::Models::CustomerCreateParams::TaxID, nil] + # # @param timezone [String, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # email:, + # name:, + # accounting_sync_configuration: nil, + # additional_emails: nil, + # auto_collection: nil, + # billing_address: nil, + # currency: nil, + # email_delivery: nil, + # external_customer_id: nil, + # metadata: nil, + # payment_provider: nil, + # payment_provider_id: nil, + # reporting_configuration: nil, + # shipping_address: nil, + # tax_configuration: nil, + # tax_id: nil, + # timezone: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # accounting_sync_configuration => { + # accounting_providers: -> { Orb::ArrayOf[Orb::Models::CustomerCreateParams::AccountingSyncConfiguration::AccountingProvider] === _1 }, + # excluded: Orb::BooleanModel + # } + # ``` + class AccountingSyncConfiguration < Orb::BaseModel + # @!attribute accounting_providers + # + # @return [Array, nil] + optional :accounting_providers, + -> { + Orb::ArrayOf[Orb::Models::CustomerCreateParams::AccountingSyncConfiguration::AccountingProvider] + }, + nil?: true + + # @!attribute excluded + # + # @return [Boolean, nil] + optional :excluded, Orb::BooleanModel, nil?: true + + # @!parse + # # @param accounting_providers [Array, nil] + # # @param excluded [Boolean, nil] + # # + # def initialize(accounting_providers: nil, excluded: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # accounting_provider => { + # external_provider_id: String, + # provider_type: String + # } + # ``` + class AccountingProvider < Orb::BaseModel + # @!attribute external_provider_id + # + # @return [String] + required :external_provider_id, String + + # @!attribute provider_type + # + # @return [String] + required :provider_type, String + + # @!parse + # # @param external_provider_id [String] + # # @param provider_type [String] + # # + # def initialize(external_provider_id:, provider_type:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_address => { + # city: String, + # country: String, + # line1: String, + # line2: String, + # postal_code: String + # } + # ``` + class BillingAddress < Orb::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute line1 + # + # @return [String, nil] + optional :line1, String, nil?: true + + # @!attribute line2 + # + # @return [String, nil] + optional :line2, String, nil?: true + + # @!attribute postal_code + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!attribute state + # + # @return [String, nil] + optional :state, String, nil?: true + + # @!parse + # # @param city [String, nil] + # # @param country [String, nil] + # # @param line1 [String, nil] + # # @param line2 [String, nil] + # # @param postal_code [String, nil] + # # @param state [String, nil] + # # + # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # This is used for creating charges or invoices in an external system via Orb. + # When not in test mode, the connection must first be configured in the Orb + # webapp. + # + # @example + # ```ruby + # case payment_provider + # in :quickbooks + # # ... + # in :"bill.com" + # # ... + # in :stripe_charge + # # ... + # in :stripe_invoice + # # ... + # in :netsuite + # # ... + # end + # ``` + class PaymentProvider < Orb::Enum + QUICKBOOKS = :quickbooks + BILL_COM = :"bill.com" + STRIPE_CHARGE = :stripe_charge + STRIPE_INVOICE = :stripe_invoice + NETSUITE = :netsuite + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # reporting_configuration => { + # exempt: Orb::BooleanModel + # } + # ``` + class ReportingConfiguration < Orb::BaseModel + # @!attribute exempt + # + # @return [Boolean] + required :exempt, Orb::BooleanModel + + # @!parse + # # @param exempt [Boolean] + # # + # def initialize(exempt:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # shipping_address => { + # city: String, + # country: String, + # line1: String, + # line2: String, + # postal_code: String + # } + # ``` + class ShippingAddress < Orb::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute line1 + # + # @return [String, nil] + optional :line1, String, nil?: true + + # @!attribute line2 + # + # @return [String, nil] + optional :line2, String, nil?: true + + # @!attribute postal_code + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!attribute state + # + # @return [String, nil] + optional :state, String, nil?: true + + # @!parse + # # @param city [String, nil] + # # @param country [String, nil] + # # @param line1 [String, nil] + # # @param line2 [String, nil] + # # @param postal_code [String, nil] + # # @param state [String, nil] + # # + # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case tax_configuration + # in {tax_provider: "avalara", tax_exempt: Orb::BooleanModel, tax_exemption_code: String} + # # Orb::Models::CustomerCreateParams::TaxConfiguration::NewAvalaraTaxConfiguration ... + # in {tax_provider: "taxjar", tax_exempt: Orb::BooleanModel} + # # Orb::Models::CustomerCreateParams::TaxConfiguration::NewTaxJarConfiguration ... + # end + # ``` + # + # @example + # ```ruby + # case tax_configuration + # in Orb::Models::CustomerCreateParams::TaxConfiguration::NewAvalaraTaxConfiguration + # # ... + # in Orb::Models::CustomerCreateParams::TaxConfiguration::NewTaxJarConfiguration + # # ... + # end + # ``` + class TaxConfiguration < Orb::Union + discriminator :tax_provider + + variant :avalara, + -> { + Orb::Models::CustomerCreateParams::TaxConfiguration::NewAvalaraTaxConfiguration + } + + variant :taxjar, -> { Orb::Models::CustomerCreateParams::TaxConfiguration::NewTaxJarConfiguration } + + # @example + # ```ruby + # new_avalara_tax_configuration => { + # tax_exempt: Orb::BooleanModel, + # tax_provider: :avalara, + # tax_exemption_code: String + # } + # ``` + class NewAvalaraTaxConfiguration < Orb::BaseModel + # @!attribute tax_exempt + # + # @return [Boolean] + required :tax_exempt, Orb::BooleanModel + + # @!attribute tax_provider + # + # @return [Symbol, :avalara] + required :tax_provider, const: :avalara + + # @!attribute tax_exemption_code + # + # @return [String, nil] + optional :tax_exemption_code, String, nil?: true + + # @!parse + # # @param tax_exempt [Boolean] + # # @param tax_exemption_code [String, nil] + # # @param tax_provider [Symbol, :avalara] + # # + # def initialize(tax_exempt:, tax_exemption_code: nil, tax_provider: :avalara, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_tax_jar_configuration => { + # tax_exempt: Orb::BooleanModel, + # tax_provider: :taxjar + # } + # ``` + class NewTaxJarConfiguration < Orb::BaseModel + # @!attribute tax_exempt + # + # @return [Boolean] + required :tax_exempt, Orb::BooleanModel + + # @!attribute tax_provider + # + # @return [Symbol, :taxjar] + required :tax_provider, const: :taxjar + + # @!parse + # # @param tax_exempt [Boolean] + # # @param tax_provider [Symbol, :taxjar] + # # + # def initialize(tax_exempt:, tax_provider: :taxjar, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # tax_id => { + # country: Orb::Models::CustomerCreateParams::TaxID::Country, + # type: Orb::Models::CustomerCreateParams::TaxID::Type, + # value: String + # } + # ``` + class TaxID < Orb::BaseModel + # @!attribute country + # + # @return [Symbol, Orb::Models::CustomerCreateParams::TaxID::Country] + required :country, enum: -> { Orb::Models::CustomerCreateParams::TaxID::Country } + + # @!attribute type + # + # @return [Symbol, Orb::Models::CustomerCreateParams::TaxID::Type] + required :type, enum: -> { Orb::Models::CustomerCreateParams::TaxID::Type } + + # @!attribute value + # + # @return [String] + required :value, String + + # @!parse + # # Tax IDs are commonly required to be displayed on customer invoices, which are + # # added to the headers of invoices. + # # + # # ### Supported Tax ID Countries and Types + # # + # # | Country | Type | Description | + # # | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # # | Andorra | `ad_nrt` | Andorran NRT Number | + # # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # # | Austria | `eu_vat` | European VAT Number | + # # | Bahrain | `bh_vat` | Bahraini VAT Number | + # # | Belgium | `eu_vat` | European VAT Number | + # # | Bolivia | `bo_tin` | Bolivian Tax ID | + # # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # # | Brazil | `br_cpf` | Brazilian CPF Number | + # # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # # | Bulgaria | `eu_vat` | European VAT Number | + # # | Canada | `ca_bn` | Canadian BN | + # # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # # | Chile | `cl_tin` | Chilean TIN | + # # | China | `cn_tin` | Chinese Tax ID | + # # | Colombia | `co_nit` | Colombian NIT Number | + # # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # # | Croatia | `eu_vat` | European VAT Number | + # # | Cyprus | `eu_vat` | European VAT Number | + # # | Czech Republic | `eu_vat` | European VAT Number | + # # | Denmark | `eu_vat` | European VAT Number | + # # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # # | Estonia | `eu_vat` | European VAT Number | + # # | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # # | Finland | `eu_vat` | European VAT Number | + # # | France | `eu_vat` | European VAT Number | + # # | Georgia | `ge_vat` | Georgian VAT | + # # | Germany | `eu_vat` | European VAT Number | + # # | Greece | `eu_vat` | European VAT Number | + # # | Hong Kong | `hk_br` | Hong Kong BR Number | + # # | Hungary | `eu_vat` | European VAT Number | + # # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # # | Iceland | `is_vat` | Icelandic VAT | + # # | India | `in_gst` | Indian GST Number | + # # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # # | Ireland | `eu_vat` | European VAT Number | + # # | Israel | `il_vat` | Israel VAT | + # # | Italy | `eu_vat` | European VAT Number | + # # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # # | Latvia | `eu_vat` | European VAT Number | + # # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # # | Lithuania | `eu_vat` | European VAT Number | + # # | Luxembourg | `eu_vat` | European VAT Number | + # # | Malaysia | `my_frp` | Malaysian FRP Number | + # # | Malaysia | `my_itn` | Malaysian ITN | + # # | Malaysia | `my_sst` | Malaysian SST Number | + # # | Malta | `eu_vat ` | European VAT Number | + # # | Mexico | `mx_rfc` | Mexican RFC Number | + # # | Netherlands | `eu_vat` | European VAT Number | + # # | New Zealand | `nz_gst` | New Zealand GST Number | + # # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # # | Norway | `no_vat` | Norwegian VAT Number | + # # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # # | Oman | `om_vat` | Omani VAT Number | + # # | Peru | `pe_ruc` | Peruvian RUC Number | + # # | Philippines | `ph_tin ` | Philippines Tax Identification Number | + # # | Poland | `eu_vat` | European VAT Number | + # # | Portugal | `eu_vat` | European VAT Number | + # # | Romania | `eu_vat` | European VAT Number | + # # | Romania | `ro_tin` | Romanian Tax ID Number | + # # | Russia | `ru_inn` | Russian INN | + # # | Russia | `ru_kpp` | Russian KPP | + # # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # # | Serbia | `rs_pib` | Serbian PIB Number | + # # | Singapore | `sg_gst` | Singaporean GST | + # # | Singapore | `sg_uen` | Singaporean UEN | + # # | Slovakia | `eu_vat` | European VAT Number | + # # | Slovenia | `eu_vat` | European VAT Number | + # # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # # | South Africa | `za_vat` | South African VAT Number | + # # | South Korea | `kr_brn` | Korean BRN | + # # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # # | Spain | `eu_vat` | European VAT Number | + # # | Sweden | `eu_vat` | European VAT Number | + # # | Switzerland | `ch_vat` | Switzerland VAT Number | + # # | Taiwan | `tw_vat` | Taiwanese VAT | + # # | Thailand | `th_vat` | Thai VAT | + # # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # # | Ukraine | `ua_vat` | Ukrainian VAT | + # # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # # | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + # # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # # | United States | `us_ein` | United States EIN | + # # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # # + # # @param country [Symbol, Orb::Models::CustomerCreateParams::TaxID::Country] + # # @param type [Symbol, Orb::Models::CustomerCreateParams::TaxID::Type] + # # @param value [String] + # # + # def initialize(country:, type:, value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case country + # in :AD + # # ... + # in :AE + # # ... + # in :AR + # # ... + # in :AT + # # ... + # in :AU + # # ... + # in ... + # #... + # end + # ``` + class Country < Orb::Enum + AD = :AD + AE = :AE + AR = :AR + AT = :AT + AU = :AU + BE = :BE + BG = :BG + BH = :BH + BO = :BO + BR = :BR + CA = :CA + CH = :CH + CL = :CL + CN = :CN + CO = :CO + CR = :CR + CY = :CY + CZ = :CZ + DE = :DE + DK = :DK + EE = :EE + DO = :DO + EC = :EC + EG = :EG + ES = :ES + EU = :EU + FI = :FI + FR = :FR + GB = :GB + GE = :GE + GR = :GR + HK = :HK + HR = :HR + HU = :HU + ID = :ID + IE = :IE + IL = :IL + IN = :IN + IS = :IS + IT = :IT + JP = :JP + KE = :KE + KR = :KR + KZ = :KZ + LI = :LI + LT = :LT + LU = :LU + LV = :LV + MT = :MT + MX = :MX + MY = :MY + NG = :NG + NL = :NL + NO = :NO + NZ = :NZ + OM = :OM + PE = :PE + PH = :PH + PL = :PL + PT = :PT + RO = :RO + RS = :RS + RU = :RU + SA = :SA + SE = :SE + SG = :SG + SI = :SI + SK = :SK + SV = :SV + TH = :TH + TR = :TR + TW = :TW + UA = :UA + US = :US + UY = :UY + VE = :VE + VN = :VN + ZA = :ZA + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # @example + # ```ruby + # case type + # in :ad_nrt + # # ... + # in :ae_trn + # # ... + # in :ar_cuit + # # ... + # in :eu_vat + # # ... + # in :au_abn + # # ... + # in ... + # #... + # end + # ``` + class Type < Orb::Enum + AD_NRT = :ad_nrt + AE_TRN = :ae_trn + AR_CUIT = :ar_cuit + EU_VAT = :eu_vat + AU_ABN = :au_abn + AU_ARN = :au_arn + BG_UIC = :bg_uic + BH_VAT = :bh_vat + BO_TIN = :bo_tin + BR_CNPJ = :br_cnpj + BR_CPF = :br_cpf + CA_BN = :ca_bn + CA_GST_HST = :ca_gst_hst + CA_PST_BC = :ca_pst_bc + CA_PST_MB = :ca_pst_mb + CA_PST_SK = :ca_pst_sk + CA_QST = :ca_qst + CH_VAT = :ch_vat + CL_TIN = :cl_tin + CN_TIN = :cn_tin + CO_NIT = :co_nit + CR_TIN = :cr_tin + DO_RCN = :do_rcn + EC_RUC = :ec_ruc + EG_TIN = :eg_tin + ES_CIF = :es_cif + EU_OSS_VAT = :eu_oss_vat + GB_VAT = :gb_vat + GE_VAT = :ge_vat + HK_BR = :hk_br + HU_TIN = :hu_tin + ID_NPWP = :id_npwp + IL_VAT = :il_vat + IN_GST = :in_gst + IS_VAT = :is_vat + JP_CN = :jp_cn + JP_RN = :jp_rn + JP_TRN = :jp_trn + KE_PIN = :ke_pin + KR_BRN = :kr_brn + KZ_BIN = :kz_bin + LI_UID = :li_uid + MX_RFC = :mx_rfc + MY_FRP = :my_frp + MY_ITN = :my_itn + MY_SST = :my_sst + NG_TIN = :ng_tin + NO_VAT = :no_vat + NO_VOEC = :no_voec + NZ_GST = :nz_gst + OM_VAT = :om_vat + PE_RUC = :pe_ruc + PH_TIN = :ph_tin + RO_TIN = :ro_tin + RS_PIB = :rs_pib + RU_INN = :ru_inn + RU_KPP = :ru_kpp + SA_VAT = :sa_vat + SG_GST = :sg_gst + SG_UEN = :sg_uen + SI_TIN = :si_tin + SV_NIT = :sv_nit + TH_VAT = :th_vat + TR_TIN = :tr_tin + TW_VAT = :tw_vat + UA_VAT = :ua_vat + US_EIN = :us_ein + UY_RUC = :uy_ruc + VE_RIF = :ve_rif + VN_TIN = :vn_tin + ZA_VAT = :za_vat + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/customer_delete_params.rb b/lib/orb/models/customer_delete_params.rb new file mode 100644 index 00000000..2e7f479e --- /dev/null +++ b/lib/orb/models/customer_delete_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class CustomerDeleteParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/customer_fetch_by_external_id_params.rb b/lib/orb/models/customer_fetch_by_external_id_params.rb new file mode 100644 index 00000000..a7ee2e17 --- /dev/null +++ b/lib/orb/models/customer_fetch_by_external_id_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class CustomerFetchByExternalIDParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/customer_fetch_params.rb b/lib/orb/models/customer_fetch_params.rb new file mode 100644 index 00000000..83417ff2 --- /dev/null +++ b/lib/orb/models/customer_fetch_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class CustomerFetchParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/customer_list_params.rb b/lib/orb/models/customer_list_params.rb new file mode 100644 index 00000000..f9c937bb --- /dev/null +++ b/lib/orb/models/customer_list_params.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +module Orb + module Models + class CustomerListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute created_at_gt + # + # @return [Time, nil] + optional :created_at_gt, Time, api_name: :"created_at[gt]", nil?: true + + # @!attribute created_at_gte + # + # @return [Time, nil] + optional :created_at_gte, Time, api_name: :"created_at[gte]", nil?: true + + # @!attribute created_at_lt + # + # @return [Time, nil] + optional :created_at_lt, Time, api_name: :"created_at[lt]", nil?: true + + # @!attribute created_at_lte + # + # @return [Time, nil] + optional :created_at_lte, Time, api_name: :"created_at[lte]", nil?: true + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!parse + # # @param created_at_gt [Time, nil] + # # @param created_at_gte [Time, nil] + # # @param created_at_lt [Time, nil] + # # @param created_at_lte [Time, nil] + # # @param cursor [String, nil] + # # @param limit [Integer] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # created_at_gt: nil, + # created_at_gte: nil, + # created_at_lt: nil, + # created_at_lte: nil, + # cursor: nil, + # limit: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rb b/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rb new file mode 100644 index 00000000..4aceb1ea --- /dev/null +++ b/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIDParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rb b/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rb new file mode 100644 index 00000000..01f0308e --- /dev/null +++ b/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class CustomerSyncPaymentMethodsFromGatewayParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/customer_update_by_external_id_params.rb b/lib/orb/models/customer_update_by_external_id_params.rb new file mode 100644 index 00000000..f6949924 --- /dev/null +++ b/lib/orb/models/customer_update_by_external_id_params.rb @@ -0,0 +1,940 @@ +# frozen_string_literal: true + +module Orb + module Models + class CustomerUpdateByExternalIDParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute accounting_sync_configuration + # + # @return [Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration, nil] + optional :accounting_sync_configuration, + -> { Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration }, + nil?: true + + # @!attribute additional_emails + # Additional email addresses for this customer. If populated, these email + # addresses will be CC'd for customer communications. + # + # @return [Array, nil] + optional :additional_emails, Orb::ArrayOf[String], nil?: true + + # @!attribute auto_collection + # Used to determine if invoices for this customer will automatically attempt to + # charge a saved payment method, if available. This parameter defaults to `True` + # when a payment provider is provided on customer creation. + # + # @return [Boolean, nil] + optional :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute billing_address + # + # @return [Orb::Models::CustomerUpdateByExternalIDParams::BillingAddress, nil] + optional :billing_address, + -> { Orb::Models::CustomerUpdateByExternalIDParams::BillingAddress }, + nil?: true + + # @!attribute currency + # An ISO 4217 currency string used for the customer's invoices and balance. If not + # set at creation time, will be set at subscription creation time. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute email + # A valid customer email, to be used for invoicing and notifications. + # + # @return [String, nil] + optional :email, String, nil?: true + + # @!attribute email_delivery + # + # @return [Boolean, nil] + optional :email_delivery, Orb::BooleanModel, nil?: true + + # @!attribute external_customer_id + # The external customer ID. This can only be set if empty and the customer has no + # past or current subscriptions. + # + # @return [String, nil] + optional :external_customer_id, String, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute name + # The full name of the customer + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute payment_provider + # This is used for creating charges or invoices in an external system via Orb. + # When not in test mode: + # + # - the connection must first be configured in the Orb webapp. + # - if the provider is an invoicing provider (`stripe_invoice`, `quickbooks`, + # `bill.com`, `netsuite`), any product mappings must first be configured with + # the Orb team. + # + # @return [Symbol, Orb::Models::CustomerUpdateByExternalIDParams::PaymentProvider, nil] + optional :payment_provider, + enum: -> { Orb::Models::CustomerUpdateByExternalIDParams::PaymentProvider }, + nil?: true + + # @!attribute payment_provider_id + # The ID of this customer in an external payments solution, such as Stripe. This + # is used for creating charges or invoices in the external system via Orb. + # + # @return [String, nil] + optional :payment_provider_id, String, nil?: true + + # @!attribute reporting_configuration + # + # @return [Orb::Models::CustomerUpdateByExternalIDParams::ReportingConfiguration, nil] + optional :reporting_configuration, + -> { Orb::Models::CustomerUpdateByExternalIDParams::ReportingConfiguration }, + nil?: true + + # @!attribute shipping_address + # + # @return [Orb::Models::CustomerUpdateByExternalIDParams::ShippingAddress, nil] + optional :shipping_address, + -> { Orb::Models::CustomerUpdateByExternalIDParams::ShippingAddress }, + nil?: true + + # @!attribute tax_configuration + # + # @return [Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewAvalaraTaxConfiguration, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewTaxJarConfiguration, nil] + optional :tax_configuration, + union: -> { Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration }, + nil?: true + + # @!attribute tax_id + # Tax IDs are commonly required to be displayed on customer invoices, which are + # added to the headers of invoices. + # + # ### Supported Tax ID Countries and Types + # + # | Country | Type | Description | + # | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # | Andorra | `ad_nrt` | Andorran NRT Number | + # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # | Austria | `eu_vat` | European VAT Number | + # | Bahrain | `bh_vat` | Bahraini VAT Number | + # | Belgium | `eu_vat` | European VAT Number | + # | Bolivia | `bo_tin` | Bolivian Tax ID | + # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # | Brazil | `br_cpf` | Brazilian CPF Number | + # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # | Bulgaria | `eu_vat` | European VAT Number | + # | Canada | `ca_bn` | Canadian BN | + # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # | Chile | `cl_tin` | Chilean TIN | + # | China | `cn_tin` | Chinese Tax ID | + # | Colombia | `co_nit` | Colombian NIT Number | + # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # | Croatia | `eu_vat` | European VAT Number | + # | Cyprus | `eu_vat` | European VAT Number | + # | Czech Republic | `eu_vat` | European VAT Number | + # | Denmark | `eu_vat` | European VAT Number | + # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # | Estonia | `eu_vat` | European VAT Number | + # | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # | Finland | `eu_vat` | European VAT Number | + # | France | `eu_vat` | European VAT Number | + # | Georgia | `ge_vat` | Georgian VAT | + # | Germany | `eu_vat` | European VAT Number | + # | Greece | `eu_vat` | European VAT Number | + # | Hong Kong | `hk_br` | Hong Kong BR Number | + # | Hungary | `eu_vat` | European VAT Number | + # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # | Iceland | `is_vat` | Icelandic VAT | + # | India | `in_gst` | Indian GST Number | + # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # | Ireland | `eu_vat` | European VAT Number | + # | Israel | `il_vat` | Israel VAT | + # | Italy | `eu_vat` | European VAT Number | + # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # | Latvia | `eu_vat` | European VAT Number | + # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # | Lithuania | `eu_vat` | European VAT Number | + # | Luxembourg | `eu_vat` | European VAT Number | + # | Malaysia | `my_frp` | Malaysian FRP Number | + # | Malaysia | `my_itn` | Malaysian ITN | + # | Malaysia | `my_sst` | Malaysian SST Number | + # | Malta | `eu_vat ` | European VAT Number | + # | Mexico | `mx_rfc` | Mexican RFC Number | + # | Netherlands | `eu_vat` | European VAT Number | + # | New Zealand | `nz_gst` | New Zealand GST Number | + # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # | Norway | `no_vat` | Norwegian VAT Number | + # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # | Oman | `om_vat` | Omani VAT Number | + # | Peru | `pe_ruc` | Peruvian RUC Number | + # | Philippines | `ph_tin ` | Philippines Tax Identification Number | + # | Poland | `eu_vat` | European VAT Number | + # | Portugal | `eu_vat` | European VAT Number | + # | Romania | `eu_vat` | European VAT Number | + # | Romania | `ro_tin` | Romanian Tax ID Number | + # | Russia | `ru_inn` | Russian INN | + # | Russia | `ru_kpp` | Russian KPP | + # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # | Serbia | `rs_pib` | Serbian PIB Number | + # | Singapore | `sg_gst` | Singaporean GST | + # | Singapore | `sg_uen` | Singaporean UEN | + # | Slovakia | `eu_vat` | European VAT Number | + # | Slovenia | `eu_vat` | European VAT Number | + # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # | South Africa | `za_vat` | South African VAT Number | + # | South Korea | `kr_brn` | Korean BRN | + # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # | Spain | `eu_vat` | European VAT Number | + # | Sweden | `eu_vat` | European VAT Number | + # | Switzerland | `ch_vat` | Switzerland VAT Number | + # | Taiwan | `tw_vat` | Taiwanese VAT | + # | Thailand | `th_vat` | Thai VAT | + # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # | Ukraine | `ua_vat` | Ukrainian VAT | + # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # | United States | `us_ein` | United States EIN | + # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # + # @return [Orb::Models::CustomerUpdateByExternalIDParams::TaxID, nil] + optional :tax_id, -> { Orb::Models::CustomerUpdateByExternalIDParams::TaxID }, nil?: true + + # @!parse + # # @param accounting_sync_configuration [Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration, nil] + # # @param additional_emails [Array, nil] + # # @param auto_collection [Boolean, nil] + # # @param billing_address [Orb::Models::CustomerUpdateByExternalIDParams::BillingAddress, nil] + # # @param currency [String, nil] + # # @param email [String, nil] + # # @param email_delivery [Boolean, nil] + # # @param external_customer_id [String, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param name [String, nil] + # # @param payment_provider [Symbol, Orb::Models::CustomerUpdateByExternalIDParams::PaymentProvider, nil] + # # @param payment_provider_id [String, nil] + # # @param reporting_configuration [Orb::Models::CustomerUpdateByExternalIDParams::ReportingConfiguration, nil] + # # @param shipping_address [Orb::Models::CustomerUpdateByExternalIDParams::ShippingAddress, nil] + # # @param tax_configuration [Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewAvalaraTaxConfiguration, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewTaxJarConfiguration, nil] + # # @param tax_id [Orb::Models::CustomerUpdateByExternalIDParams::TaxID, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # accounting_sync_configuration: nil, + # additional_emails: nil, + # auto_collection: nil, + # billing_address: nil, + # currency: nil, + # email: nil, + # email_delivery: nil, + # external_customer_id: nil, + # metadata: nil, + # name: nil, + # payment_provider: nil, + # payment_provider_id: nil, + # reporting_configuration: nil, + # shipping_address: nil, + # tax_configuration: nil, + # tax_id: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # accounting_sync_configuration => { + # accounting_providers: -> { Orb::ArrayOf[Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration::AccountingProvider] === _1 }, + # excluded: Orb::BooleanModel + # } + # ``` + class AccountingSyncConfiguration < Orb::BaseModel + # @!attribute accounting_providers + # + # @return [Array, nil] + optional :accounting_providers, + -> { + Orb::ArrayOf[Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration::AccountingProvider] + }, + nil?: true + + # @!attribute excluded + # + # @return [Boolean, nil] + optional :excluded, Orb::BooleanModel, nil?: true + + # @!parse + # # @param accounting_providers [Array, nil] + # # @param excluded [Boolean, nil] + # # + # def initialize(accounting_providers: nil, excluded: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # accounting_provider => { + # external_provider_id: String, + # provider_type: String + # } + # ``` + class AccountingProvider < Orb::BaseModel + # @!attribute external_provider_id + # + # @return [String] + required :external_provider_id, String + + # @!attribute provider_type + # + # @return [String] + required :provider_type, String + + # @!parse + # # @param external_provider_id [String] + # # @param provider_type [String] + # # + # def initialize(external_provider_id:, provider_type:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_address => { + # city: String, + # country: String, + # line1: String, + # line2: String, + # postal_code: String + # } + # ``` + class BillingAddress < Orb::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute line1 + # + # @return [String, nil] + optional :line1, String, nil?: true + + # @!attribute line2 + # + # @return [String, nil] + optional :line2, String, nil?: true + + # @!attribute postal_code + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!attribute state + # + # @return [String, nil] + optional :state, String, nil?: true + + # @!parse + # # @param city [String, nil] + # # @param country [String, nil] + # # @param line1 [String, nil] + # # @param line2 [String, nil] + # # @param postal_code [String, nil] + # # @param state [String, nil] + # # + # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # This is used for creating charges or invoices in an external system via Orb. + # When not in test mode: + # + # - the connection must first be configured in the Orb webapp. + # - if the provider is an invoicing provider (`stripe_invoice`, `quickbooks`, + # `bill.com`, `netsuite`), any product mappings must first be configured with + # the Orb team. + # + # @example + # ```ruby + # case payment_provider + # in :quickbooks + # # ... + # in :"bill.com" + # # ... + # in :stripe_charge + # # ... + # in :stripe_invoice + # # ... + # in :netsuite + # # ... + # end + # ``` + class PaymentProvider < Orb::Enum + QUICKBOOKS = :quickbooks + BILL_COM = :"bill.com" + STRIPE_CHARGE = :stripe_charge + STRIPE_INVOICE = :stripe_invoice + NETSUITE = :netsuite + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # reporting_configuration => { + # exempt: Orb::BooleanModel + # } + # ``` + class ReportingConfiguration < Orb::BaseModel + # @!attribute exempt + # + # @return [Boolean] + required :exempt, Orb::BooleanModel + + # @!parse + # # @param exempt [Boolean] + # # + # def initialize(exempt:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # shipping_address => { + # city: String, + # country: String, + # line1: String, + # line2: String, + # postal_code: String + # } + # ``` + class ShippingAddress < Orb::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute line1 + # + # @return [String, nil] + optional :line1, String, nil?: true + + # @!attribute line2 + # + # @return [String, nil] + optional :line2, String, nil?: true + + # @!attribute postal_code + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!attribute state + # + # @return [String, nil] + optional :state, String, nil?: true + + # @!parse + # # @param city [String, nil] + # # @param country [String, nil] + # # @param line1 [String, nil] + # # @param line2 [String, nil] + # # @param postal_code [String, nil] + # # @param state [String, nil] + # # + # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case tax_configuration + # in {tax_provider: "avalara", tax_exempt: Orb::BooleanModel, tax_exemption_code: String} + # # Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewAvalaraTaxConfiguration ... + # in {tax_provider: "taxjar", tax_exempt: Orb::BooleanModel} + # # Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewTaxJarConfiguration ... + # end + # ``` + # + # @example + # ```ruby + # case tax_configuration + # in Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewAvalaraTaxConfiguration + # # ... + # in Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewTaxJarConfiguration + # # ... + # end + # ``` + class TaxConfiguration < Orb::Union + discriminator :tax_provider + + variant :avalara, + -> { Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewAvalaraTaxConfiguration } + + variant :taxjar, + -> { Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewTaxJarConfiguration } + + # @example + # ```ruby + # new_avalara_tax_configuration => { + # tax_exempt: Orb::BooleanModel, + # tax_provider: :avalara, + # tax_exemption_code: String + # } + # ``` + class NewAvalaraTaxConfiguration < Orb::BaseModel + # @!attribute tax_exempt + # + # @return [Boolean] + required :tax_exempt, Orb::BooleanModel + + # @!attribute tax_provider + # + # @return [Symbol, :avalara] + required :tax_provider, const: :avalara + + # @!attribute tax_exemption_code + # + # @return [String, nil] + optional :tax_exemption_code, String, nil?: true + + # @!parse + # # @param tax_exempt [Boolean] + # # @param tax_exemption_code [String, nil] + # # @param tax_provider [Symbol, :avalara] + # # + # def initialize(tax_exempt:, tax_exemption_code: nil, tax_provider: :avalara, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_tax_jar_configuration => { + # tax_exempt: Orb::BooleanModel, + # tax_provider: :taxjar + # } + # ``` + class NewTaxJarConfiguration < Orb::BaseModel + # @!attribute tax_exempt + # + # @return [Boolean] + required :tax_exempt, Orb::BooleanModel + + # @!attribute tax_provider + # + # @return [Symbol, :taxjar] + required :tax_provider, const: :taxjar + + # @!parse + # # @param tax_exempt [Boolean] + # # @param tax_provider [Symbol, :taxjar] + # # + # def initialize(tax_exempt:, tax_provider: :taxjar, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # tax_id => { + # country: Orb::Models::CustomerUpdateByExternalIDParams::TaxID::Country, + # type: Orb::Models::CustomerUpdateByExternalIDParams::TaxID::Type, + # value: String + # } + # ``` + class TaxID < Orb::BaseModel + # @!attribute country + # + # @return [Symbol, Orb::Models::CustomerUpdateByExternalIDParams::TaxID::Country] + required :country, enum: -> { Orb::Models::CustomerUpdateByExternalIDParams::TaxID::Country } + + # @!attribute type + # + # @return [Symbol, Orb::Models::CustomerUpdateByExternalIDParams::TaxID::Type] + required :type, enum: -> { Orb::Models::CustomerUpdateByExternalIDParams::TaxID::Type } + + # @!attribute value + # + # @return [String] + required :value, String + + # @!parse + # # Tax IDs are commonly required to be displayed on customer invoices, which are + # # added to the headers of invoices. + # # + # # ### Supported Tax ID Countries and Types + # # + # # | Country | Type | Description | + # # | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # # | Andorra | `ad_nrt` | Andorran NRT Number | + # # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # # | Austria | `eu_vat` | European VAT Number | + # # | Bahrain | `bh_vat` | Bahraini VAT Number | + # # | Belgium | `eu_vat` | European VAT Number | + # # | Bolivia | `bo_tin` | Bolivian Tax ID | + # # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # # | Brazil | `br_cpf` | Brazilian CPF Number | + # # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # # | Bulgaria | `eu_vat` | European VAT Number | + # # | Canada | `ca_bn` | Canadian BN | + # # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # # | Chile | `cl_tin` | Chilean TIN | + # # | China | `cn_tin` | Chinese Tax ID | + # # | Colombia | `co_nit` | Colombian NIT Number | + # # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # # | Croatia | `eu_vat` | European VAT Number | + # # | Cyprus | `eu_vat` | European VAT Number | + # # | Czech Republic | `eu_vat` | European VAT Number | + # # | Denmark | `eu_vat` | European VAT Number | + # # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # # | Estonia | `eu_vat` | European VAT Number | + # # | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # # | Finland | `eu_vat` | European VAT Number | + # # | France | `eu_vat` | European VAT Number | + # # | Georgia | `ge_vat` | Georgian VAT | + # # | Germany | `eu_vat` | European VAT Number | + # # | Greece | `eu_vat` | European VAT Number | + # # | Hong Kong | `hk_br` | Hong Kong BR Number | + # # | Hungary | `eu_vat` | European VAT Number | + # # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # # | Iceland | `is_vat` | Icelandic VAT | + # # | India | `in_gst` | Indian GST Number | + # # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # # | Ireland | `eu_vat` | European VAT Number | + # # | Israel | `il_vat` | Israel VAT | + # # | Italy | `eu_vat` | European VAT Number | + # # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # # | Latvia | `eu_vat` | European VAT Number | + # # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # # | Lithuania | `eu_vat` | European VAT Number | + # # | Luxembourg | `eu_vat` | European VAT Number | + # # | Malaysia | `my_frp` | Malaysian FRP Number | + # # | Malaysia | `my_itn` | Malaysian ITN | + # # | Malaysia | `my_sst` | Malaysian SST Number | + # # | Malta | `eu_vat ` | European VAT Number | + # # | Mexico | `mx_rfc` | Mexican RFC Number | + # # | Netherlands | `eu_vat` | European VAT Number | + # # | New Zealand | `nz_gst` | New Zealand GST Number | + # # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # # | Norway | `no_vat` | Norwegian VAT Number | + # # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # # | Oman | `om_vat` | Omani VAT Number | + # # | Peru | `pe_ruc` | Peruvian RUC Number | + # # | Philippines | `ph_tin ` | Philippines Tax Identification Number | + # # | Poland | `eu_vat` | European VAT Number | + # # | Portugal | `eu_vat` | European VAT Number | + # # | Romania | `eu_vat` | European VAT Number | + # # | Romania | `ro_tin` | Romanian Tax ID Number | + # # | Russia | `ru_inn` | Russian INN | + # # | Russia | `ru_kpp` | Russian KPP | + # # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # # | Serbia | `rs_pib` | Serbian PIB Number | + # # | Singapore | `sg_gst` | Singaporean GST | + # # | Singapore | `sg_uen` | Singaporean UEN | + # # | Slovakia | `eu_vat` | European VAT Number | + # # | Slovenia | `eu_vat` | European VAT Number | + # # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # # | South Africa | `za_vat` | South African VAT Number | + # # | South Korea | `kr_brn` | Korean BRN | + # # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # # | Spain | `eu_vat` | European VAT Number | + # # | Sweden | `eu_vat` | European VAT Number | + # # | Switzerland | `ch_vat` | Switzerland VAT Number | + # # | Taiwan | `tw_vat` | Taiwanese VAT | + # # | Thailand | `th_vat` | Thai VAT | + # # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # # | Ukraine | `ua_vat` | Ukrainian VAT | + # # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # # | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + # # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # # | United States | `us_ein` | United States EIN | + # # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # # + # # @param country [Symbol, Orb::Models::CustomerUpdateByExternalIDParams::TaxID::Country] + # # @param type [Symbol, Orb::Models::CustomerUpdateByExternalIDParams::TaxID::Type] + # # @param value [String] + # # + # def initialize(country:, type:, value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case country + # in :AD + # # ... + # in :AE + # # ... + # in :AR + # # ... + # in :AT + # # ... + # in :AU + # # ... + # in ... + # #... + # end + # ``` + class Country < Orb::Enum + AD = :AD + AE = :AE + AR = :AR + AT = :AT + AU = :AU + BE = :BE + BG = :BG + BH = :BH + BO = :BO + BR = :BR + CA = :CA + CH = :CH + CL = :CL + CN = :CN + CO = :CO + CR = :CR + CY = :CY + CZ = :CZ + DE = :DE + DK = :DK + EE = :EE + DO = :DO + EC = :EC + EG = :EG + ES = :ES + EU = :EU + FI = :FI + FR = :FR + GB = :GB + GE = :GE + GR = :GR + HK = :HK + HR = :HR + HU = :HU + ID = :ID + IE = :IE + IL = :IL + IN = :IN + IS = :IS + IT = :IT + JP = :JP + KE = :KE + KR = :KR + KZ = :KZ + LI = :LI + LT = :LT + LU = :LU + LV = :LV + MT = :MT + MX = :MX + MY = :MY + NG = :NG + NL = :NL + NO = :NO + NZ = :NZ + OM = :OM + PE = :PE + PH = :PH + PL = :PL + PT = :PT + RO = :RO + RS = :RS + RU = :RU + SA = :SA + SE = :SE + SG = :SG + SI = :SI + SK = :SK + SV = :SV + TH = :TH + TR = :TR + TW = :TW + UA = :UA + US = :US + UY = :UY + VE = :VE + VN = :VN + ZA = :ZA + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # @example + # ```ruby + # case type + # in :ad_nrt + # # ... + # in :ae_trn + # # ... + # in :ar_cuit + # # ... + # in :eu_vat + # # ... + # in :au_abn + # # ... + # in ... + # #... + # end + # ``` + class Type < Orb::Enum + AD_NRT = :ad_nrt + AE_TRN = :ae_trn + AR_CUIT = :ar_cuit + EU_VAT = :eu_vat + AU_ABN = :au_abn + AU_ARN = :au_arn + BG_UIC = :bg_uic + BH_VAT = :bh_vat + BO_TIN = :bo_tin + BR_CNPJ = :br_cnpj + BR_CPF = :br_cpf + CA_BN = :ca_bn + CA_GST_HST = :ca_gst_hst + CA_PST_BC = :ca_pst_bc + CA_PST_MB = :ca_pst_mb + CA_PST_SK = :ca_pst_sk + CA_QST = :ca_qst + CH_VAT = :ch_vat + CL_TIN = :cl_tin + CN_TIN = :cn_tin + CO_NIT = :co_nit + CR_TIN = :cr_tin + DO_RCN = :do_rcn + EC_RUC = :ec_ruc + EG_TIN = :eg_tin + ES_CIF = :es_cif + EU_OSS_VAT = :eu_oss_vat + GB_VAT = :gb_vat + GE_VAT = :ge_vat + HK_BR = :hk_br + HU_TIN = :hu_tin + ID_NPWP = :id_npwp + IL_VAT = :il_vat + IN_GST = :in_gst + IS_VAT = :is_vat + JP_CN = :jp_cn + JP_RN = :jp_rn + JP_TRN = :jp_trn + KE_PIN = :ke_pin + KR_BRN = :kr_brn + KZ_BIN = :kz_bin + LI_UID = :li_uid + MX_RFC = :mx_rfc + MY_FRP = :my_frp + MY_ITN = :my_itn + MY_SST = :my_sst + NG_TIN = :ng_tin + NO_VAT = :no_vat + NO_VOEC = :no_voec + NZ_GST = :nz_gst + OM_VAT = :om_vat + PE_RUC = :pe_ruc + PH_TIN = :ph_tin + RO_TIN = :ro_tin + RS_PIB = :rs_pib + RU_INN = :ru_inn + RU_KPP = :ru_kpp + SA_VAT = :sa_vat + SG_GST = :sg_gst + SG_UEN = :sg_uen + SI_TIN = :si_tin + SV_NIT = :sv_nit + TH_VAT = :th_vat + TR_TIN = :tr_tin + TW_VAT = :tw_vat + UA_VAT = :ua_vat + US_EIN = :us_ein + UY_RUC = :uy_ruc + VE_RIF = :ve_rif + VN_TIN = :vn_tin + ZA_VAT = :za_vat + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/customer_update_params.rb b/lib/orb/models/customer_update_params.rb new file mode 100644 index 00000000..c41cf3b2 --- /dev/null +++ b/lib/orb/models/customer_update_params.rb @@ -0,0 +1,937 @@ +# frozen_string_literal: true + +module Orb + module Models + class CustomerUpdateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute accounting_sync_configuration + # + # @return [Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration, nil] + optional :accounting_sync_configuration, + -> { Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration }, + nil?: true + + # @!attribute additional_emails + # Additional email addresses for this customer. If populated, these email + # addresses will be CC'd for customer communications. + # + # @return [Array, nil] + optional :additional_emails, Orb::ArrayOf[String], nil?: true + + # @!attribute auto_collection + # Used to determine if invoices for this customer will automatically attempt to + # charge a saved payment method, if available. This parameter defaults to `True` + # when a payment provider is provided on customer creation. + # + # @return [Boolean, nil] + optional :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute billing_address + # + # @return [Orb::Models::CustomerUpdateParams::BillingAddress, nil] + optional :billing_address, -> { Orb::Models::CustomerUpdateParams::BillingAddress }, nil?: true + + # @!attribute currency + # An ISO 4217 currency string used for the customer's invoices and balance. If not + # set at creation time, will be set at subscription creation time. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute email + # A valid customer email, to be used for invoicing and notifications. + # + # @return [String, nil] + optional :email, String, nil?: true + + # @!attribute email_delivery + # + # @return [Boolean, nil] + optional :email_delivery, Orb::BooleanModel, nil?: true + + # @!attribute external_customer_id + # The external customer ID. This can only be set if empty and the customer has no + # past or current subscriptions. + # + # @return [String, nil] + optional :external_customer_id, String, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute name + # The full name of the customer + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute payment_provider + # This is used for creating charges or invoices in an external system via Orb. + # When not in test mode: + # + # - the connection must first be configured in the Orb webapp. + # - if the provider is an invoicing provider (`stripe_invoice`, `quickbooks`, + # `bill.com`, `netsuite`), any product mappings must first be configured with + # the Orb team. + # + # @return [Symbol, Orb::Models::CustomerUpdateParams::PaymentProvider, nil] + optional :payment_provider, enum: -> { Orb::Models::CustomerUpdateParams::PaymentProvider }, nil?: true + + # @!attribute payment_provider_id + # The ID of this customer in an external payments solution, such as Stripe. This + # is used for creating charges or invoices in the external system via Orb. + # + # @return [String, nil] + optional :payment_provider_id, String, nil?: true + + # @!attribute reporting_configuration + # + # @return [Orb::Models::CustomerUpdateParams::ReportingConfiguration, nil] + optional :reporting_configuration, + -> { Orb::Models::CustomerUpdateParams::ReportingConfiguration }, + nil?: true + + # @!attribute shipping_address + # + # @return [Orb::Models::CustomerUpdateParams::ShippingAddress, nil] + optional :shipping_address, -> { Orb::Models::CustomerUpdateParams::ShippingAddress }, nil?: true + + # @!attribute tax_configuration + # + # @return [Orb::Models::CustomerUpdateParams::TaxConfiguration::NewAvalaraTaxConfiguration, Orb::Models::CustomerUpdateParams::TaxConfiguration::NewTaxJarConfiguration, nil] + optional :tax_configuration, + union: -> { + Orb::Models::CustomerUpdateParams::TaxConfiguration + }, + nil?: true + + # @!attribute tax_id + # Tax IDs are commonly required to be displayed on customer invoices, which are + # added to the headers of invoices. + # + # ### Supported Tax ID Countries and Types + # + # | Country | Type | Description | + # | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # | Andorra | `ad_nrt` | Andorran NRT Number | + # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # | Austria | `eu_vat` | European VAT Number | + # | Bahrain | `bh_vat` | Bahraini VAT Number | + # | Belgium | `eu_vat` | European VAT Number | + # | Bolivia | `bo_tin` | Bolivian Tax ID | + # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # | Brazil | `br_cpf` | Brazilian CPF Number | + # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # | Bulgaria | `eu_vat` | European VAT Number | + # | Canada | `ca_bn` | Canadian BN | + # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # | Chile | `cl_tin` | Chilean TIN | + # | China | `cn_tin` | Chinese Tax ID | + # | Colombia | `co_nit` | Colombian NIT Number | + # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # | Croatia | `eu_vat` | European VAT Number | + # | Cyprus | `eu_vat` | European VAT Number | + # | Czech Republic | `eu_vat` | European VAT Number | + # | Denmark | `eu_vat` | European VAT Number | + # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # | Estonia | `eu_vat` | European VAT Number | + # | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # | Finland | `eu_vat` | European VAT Number | + # | France | `eu_vat` | European VAT Number | + # | Georgia | `ge_vat` | Georgian VAT | + # | Germany | `eu_vat` | European VAT Number | + # | Greece | `eu_vat` | European VAT Number | + # | Hong Kong | `hk_br` | Hong Kong BR Number | + # | Hungary | `eu_vat` | European VAT Number | + # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # | Iceland | `is_vat` | Icelandic VAT | + # | India | `in_gst` | Indian GST Number | + # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # | Ireland | `eu_vat` | European VAT Number | + # | Israel | `il_vat` | Israel VAT | + # | Italy | `eu_vat` | European VAT Number | + # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # | Latvia | `eu_vat` | European VAT Number | + # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # | Lithuania | `eu_vat` | European VAT Number | + # | Luxembourg | `eu_vat` | European VAT Number | + # | Malaysia | `my_frp` | Malaysian FRP Number | + # | Malaysia | `my_itn` | Malaysian ITN | + # | Malaysia | `my_sst` | Malaysian SST Number | + # | Malta | `eu_vat ` | European VAT Number | + # | Mexico | `mx_rfc` | Mexican RFC Number | + # | Netherlands | `eu_vat` | European VAT Number | + # | New Zealand | `nz_gst` | New Zealand GST Number | + # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # | Norway | `no_vat` | Norwegian VAT Number | + # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # | Oman | `om_vat` | Omani VAT Number | + # | Peru | `pe_ruc` | Peruvian RUC Number | + # | Philippines | `ph_tin ` | Philippines Tax Identification Number | + # | Poland | `eu_vat` | European VAT Number | + # | Portugal | `eu_vat` | European VAT Number | + # | Romania | `eu_vat` | European VAT Number | + # | Romania | `ro_tin` | Romanian Tax ID Number | + # | Russia | `ru_inn` | Russian INN | + # | Russia | `ru_kpp` | Russian KPP | + # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # | Serbia | `rs_pib` | Serbian PIB Number | + # | Singapore | `sg_gst` | Singaporean GST | + # | Singapore | `sg_uen` | Singaporean UEN | + # | Slovakia | `eu_vat` | European VAT Number | + # | Slovenia | `eu_vat` | European VAT Number | + # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # | South Africa | `za_vat` | South African VAT Number | + # | South Korea | `kr_brn` | Korean BRN | + # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # | Spain | `eu_vat` | European VAT Number | + # | Sweden | `eu_vat` | European VAT Number | + # | Switzerland | `ch_vat` | Switzerland VAT Number | + # | Taiwan | `tw_vat` | Taiwanese VAT | + # | Thailand | `th_vat` | Thai VAT | + # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # | Ukraine | `ua_vat` | Ukrainian VAT | + # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # | United States | `us_ein` | United States EIN | + # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # + # @return [Orb::Models::CustomerUpdateParams::TaxID, nil] + optional :tax_id, -> { Orb::Models::CustomerUpdateParams::TaxID }, nil?: true + + # @!parse + # # @param accounting_sync_configuration [Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration, nil] + # # @param additional_emails [Array, nil] + # # @param auto_collection [Boolean, nil] + # # @param billing_address [Orb::Models::CustomerUpdateParams::BillingAddress, nil] + # # @param currency [String, nil] + # # @param email [String, nil] + # # @param email_delivery [Boolean, nil] + # # @param external_customer_id [String, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param name [String, nil] + # # @param payment_provider [Symbol, Orb::Models::CustomerUpdateParams::PaymentProvider, nil] + # # @param payment_provider_id [String, nil] + # # @param reporting_configuration [Orb::Models::CustomerUpdateParams::ReportingConfiguration, nil] + # # @param shipping_address [Orb::Models::CustomerUpdateParams::ShippingAddress, nil] + # # @param tax_configuration [Orb::Models::CustomerUpdateParams::TaxConfiguration::NewAvalaraTaxConfiguration, Orb::Models::CustomerUpdateParams::TaxConfiguration::NewTaxJarConfiguration, nil] + # # @param tax_id [Orb::Models::CustomerUpdateParams::TaxID, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # accounting_sync_configuration: nil, + # additional_emails: nil, + # auto_collection: nil, + # billing_address: nil, + # currency: nil, + # email: nil, + # email_delivery: nil, + # external_customer_id: nil, + # metadata: nil, + # name: nil, + # payment_provider: nil, + # payment_provider_id: nil, + # reporting_configuration: nil, + # shipping_address: nil, + # tax_configuration: nil, + # tax_id: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # accounting_sync_configuration => { + # accounting_providers: -> { Orb::ArrayOf[Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration::AccountingProvider] === _1 }, + # excluded: Orb::BooleanModel + # } + # ``` + class AccountingSyncConfiguration < Orb::BaseModel + # @!attribute accounting_providers + # + # @return [Array, nil] + optional :accounting_providers, + -> { + Orb::ArrayOf[Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration::AccountingProvider] + }, + nil?: true + + # @!attribute excluded + # + # @return [Boolean, nil] + optional :excluded, Orb::BooleanModel, nil?: true + + # @!parse + # # @param accounting_providers [Array, nil] + # # @param excluded [Boolean, nil] + # # + # def initialize(accounting_providers: nil, excluded: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # accounting_provider => { + # external_provider_id: String, + # provider_type: String + # } + # ``` + class AccountingProvider < Orb::BaseModel + # @!attribute external_provider_id + # + # @return [String] + required :external_provider_id, String + + # @!attribute provider_type + # + # @return [String] + required :provider_type, String + + # @!parse + # # @param external_provider_id [String] + # # @param provider_type [String] + # # + # def initialize(external_provider_id:, provider_type:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_address => { + # city: String, + # country: String, + # line1: String, + # line2: String, + # postal_code: String + # } + # ``` + class BillingAddress < Orb::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute line1 + # + # @return [String, nil] + optional :line1, String, nil?: true + + # @!attribute line2 + # + # @return [String, nil] + optional :line2, String, nil?: true + + # @!attribute postal_code + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!attribute state + # + # @return [String, nil] + optional :state, String, nil?: true + + # @!parse + # # @param city [String, nil] + # # @param country [String, nil] + # # @param line1 [String, nil] + # # @param line2 [String, nil] + # # @param postal_code [String, nil] + # # @param state [String, nil] + # # + # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # This is used for creating charges or invoices in an external system via Orb. + # When not in test mode: + # + # - the connection must first be configured in the Orb webapp. + # - if the provider is an invoicing provider (`stripe_invoice`, `quickbooks`, + # `bill.com`, `netsuite`), any product mappings must first be configured with + # the Orb team. + # + # @example + # ```ruby + # case payment_provider + # in :quickbooks + # # ... + # in :"bill.com" + # # ... + # in :stripe_charge + # # ... + # in :stripe_invoice + # # ... + # in :netsuite + # # ... + # end + # ``` + class PaymentProvider < Orb::Enum + QUICKBOOKS = :quickbooks + BILL_COM = :"bill.com" + STRIPE_CHARGE = :stripe_charge + STRIPE_INVOICE = :stripe_invoice + NETSUITE = :netsuite + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # reporting_configuration => { + # exempt: Orb::BooleanModel + # } + # ``` + class ReportingConfiguration < Orb::BaseModel + # @!attribute exempt + # + # @return [Boolean] + required :exempt, Orb::BooleanModel + + # @!parse + # # @param exempt [Boolean] + # # + # def initialize(exempt:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # shipping_address => { + # city: String, + # country: String, + # line1: String, + # line2: String, + # postal_code: String + # } + # ``` + class ShippingAddress < Orb::BaseModel + # @!attribute city + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute line1 + # + # @return [String, nil] + optional :line1, String, nil?: true + + # @!attribute line2 + # + # @return [String, nil] + optional :line2, String, nil?: true + + # @!attribute postal_code + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!attribute state + # + # @return [String, nil] + optional :state, String, nil?: true + + # @!parse + # # @param city [String, nil] + # # @param country [String, nil] + # # @param line1 [String, nil] + # # @param line2 [String, nil] + # # @param postal_code [String, nil] + # # @param state [String, nil] + # # + # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case tax_configuration + # in {tax_provider: "avalara", tax_exempt: Orb::BooleanModel, tax_exemption_code: String} + # # Orb::Models::CustomerUpdateParams::TaxConfiguration::NewAvalaraTaxConfiguration ... + # in {tax_provider: "taxjar", tax_exempt: Orb::BooleanModel} + # # Orb::Models::CustomerUpdateParams::TaxConfiguration::NewTaxJarConfiguration ... + # end + # ``` + # + # @example + # ```ruby + # case tax_configuration + # in Orb::Models::CustomerUpdateParams::TaxConfiguration::NewAvalaraTaxConfiguration + # # ... + # in Orb::Models::CustomerUpdateParams::TaxConfiguration::NewTaxJarConfiguration + # # ... + # end + # ``` + class TaxConfiguration < Orb::Union + discriminator :tax_provider + + variant :avalara, + -> { + Orb::Models::CustomerUpdateParams::TaxConfiguration::NewAvalaraTaxConfiguration + } + + variant :taxjar, -> { Orb::Models::CustomerUpdateParams::TaxConfiguration::NewTaxJarConfiguration } + + # @example + # ```ruby + # new_avalara_tax_configuration => { + # tax_exempt: Orb::BooleanModel, + # tax_provider: :avalara, + # tax_exemption_code: String + # } + # ``` + class NewAvalaraTaxConfiguration < Orb::BaseModel + # @!attribute tax_exempt + # + # @return [Boolean] + required :tax_exempt, Orb::BooleanModel + + # @!attribute tax_provider + # + # @return [Symbol, :avalara] + required :tax_provider, const: :avalara + + # @!attribute tax_exemption_code + # + # @return [String, nil] + optional :tax_exemption_code, String, nil?: true + + # @!parse + # # @param tax_exempt [Boolean] + # # @param tax_exemption_code [String, nil] + # # @param tax_provider [Symbol, :avalara] + # # + # def initialize(tax_exempt:, tax_exemption_code: nil, tax_provider: :avalara, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_tax_jar_configuration => { + # tax_exempt: Orb::BooleanModel, + # tax_provider: :taxjar + # } + # ``` + class NewTaxJarConfiguration < Orb::BaseModel + # @!attribute tax_exempt + # + # @return [Boolean] + required :tax_exempt, Orb::BooleanModel + + # @!attribute tax_provider + # + # @return [Symbol, :taxjar] + required :tax_provider, const: :taxjar + + # @!parse + # # @param tax_exempt [Boolean] + # # @param tax_provider [Symbol, :taxjar] + # # + # def initialize(tax_exempt:, tax_provider: :taxjar, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # tax_id => { + # country: Orb::Models::CustomerUpdateParams::TaxID::Country, + # type: Orb::Models::CustomerUpdateParams::TaxID::Type, + # value: String + # } + # ``` + class TaxID < Orb::BaseModel + # @!attribute country + # + # @return [Symbol, Orb::Models::CustomerUpdateParams::TaxID::Country] + required :country, enum: -> { Orb::Models::CustomerUpdateParams::TaxID::Country } + + # @!attribute type + # + # @return [Symbol, Orb::Models::CustomerUpdateParams::TaxID::Type] + required :type, enum: -> { Orb::Models::CustomerUpdateParams::TaxID::Type } + + # @!attribute value + # + # @return [String] + required :value, String + + # @!parse + # # Tax IDs are commonly required to be displayed on customer invoices, which are + # # added to the headers of invoices. + # # + # # ### Supported Tax ID Countries and Types + # # + # # | Country | Type | Description | + # # | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # # | Andorra | `ad_nrt` | Andorran NRT Number | + # # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # # | Austria | `eu_vat` | European VAT Number | + # # | Bahrain | `bh_vat` | Bahraini VAT Number | + # # | Belgium | `eu_vat` | European VAT Number | + # # | Bolivia | `bo_tin` | Bolivian Tax ID | + # # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # # | Brazil | `br_cpf` | Brazilian CPF Number | + # # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # # | Bulgaria | `eu_vat` | European VAT Number | + # # | Canada | `ca_bn` | Canadian BN | + # # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # # | Chile | `cl_tin` | Chilean TIN | + # # | China | `cn_tin` | Chinese Tax ID | + # # | Colombia | `co_nit` | Colombian NIT Number | + # # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # # | Croatia | `eu_vat` | European VAT Number | + # # | Cyprus | `eu_vat` | European VAT Number | + # # | Czech Republic | `eu_vat` | European VAT Number | + # # | Denmark | `eu_vat` | European VAT Number | + # # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # # | Estonia | `eu_vat` | European VAT Number | + # # | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # # | Finland | `eu_vat` | European VAT Number | + # # | France | `eu_vat` | European VAT Number | + # # | Georgia | `ge_vat` | Georgian VAT | + # # | Germany | `eu_vat` | European VAT Number | + # # | Greece | `eu_vat` | European VAT Number | + # # | Hong Kong | `hk_br` | Hong Kong BR Number | + # # | Hungary | `eu_vat` | European VAT Number | + # # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # # | Iceland | `is_vat` | Icelandic VAT | + # # | India | `in_gst` | Indian GST Number | + # # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # # | Ireland | `eu_vat` | European VAT Number | + # # | Israel | `il_vat` | Israel VAT | + # # | Italy | `eu_vat` | European VAT Number | + # # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # # | Latvia | `eu_vat` | European VAT Number | + # # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # # | Lithuania | `eu_vat` | European VAT Number | + # # | Luxembourg | `eu_vat` | European VAT Number | + # # | Malaysia | `my_frp` | Malaysian FRP Number | + # # | Malaysia | `my_itn` | Malaysian ITN | + # # | Malaysia | `my_sst` | Malaysian SST Number | + # # | Malta | `eu_vat ` | European VAT Number | + # # | Mexico | `mx_rfc` | Mexican RFC Number | + # # | Netherlands | `eu_vat` | European VAT Number | + # # | New Zealand | `nz_gst` | New Zealand GST Number | + # # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # # | Norway | `no_vat` | Norwegian VAT Number | + # # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # # | Oman | `om_vat` | Omani VAT Number | + # # | Peru | `pe_ruc` | Peruvian RUC Number | + # # | Philippines | `ph_tin ` | Philippines Tax Identification Number | + # # | Poland | `eu_vat` | European VAT Number | + # # | Portugal | `eu_vat` | European VAT Number | + # # | Romania | `eu_vat` | European VAT Number | + # # | Romania | `ro_tin` | Romanian Tax ID Number | + # # | Russia | `ru_inn` | Russian INN | + # # | Russia | `ru_kpp` | Russian KPP | + # # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # # | Serbia | `rs_pib` | Serbian PIB Number | + # # | Singapore | `sg_gst` | Singaporean GST | + # # | Singapore | `sg_uen` | Singaporean UEN | + # # | Slovakia | `eu_vat` | European VAT Number | + # # | Slovenia | `eu_vat` | European VAT Number | + # # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # # | South Africa | `za_vat` | South African VAT Number | + # # | South Korea | `kr_brn` | Korean BRN | + # # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # # | Spain | `eu_vat` | European VAT Number | + # # | Sweden | `eu_vat` | European VAT Number | + # # | Switzerland | `ch_vat` | Switzerland VAT Number | + # # | Taiwan | `tw_vat` | Taiwanese VAT | + # # | Thailand | `th_vat` | Thai VAT | + # # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # # | Ukraine | `ua_vat` | Ukrainian VAT | + # # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # # | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + # # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # # | United States | `us_ein` | United States EIN | + # # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # # + # # @param country [Symbol, Orb::Models::CustomerUpdateParams::TaxID::Country] + # # @param type [Symbol, Orb::Models::CustomerUpdateParams::TaxID::Type] + # # @param value [String] + # # + # def initialize(country:, type:, value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case country + # in :AD + # # ... + # in :AE + # # ... + # in :AR + # # ... + # in :AT + # # ... + # in :AU + # # ... + # in ... + # #... + # end + # ``` + class Country < Orb::Enum + AD = :AD + AE = :AE + AR = :AR + AT = :AT + AU = :AU + BE = :BE + BG = :BG + BH = :BH + BO = :BO + BR = :BR + CA = :CA + CH = :CH + CL = :CL + CN = :CN + CO = :CO + CR = :CR + CY = :CY + CZ = :CZ + DE = :DE + DK = :DK + EE = :EE + DO = :DO + EC = :EC + EG = :EG + ES = :ES + EU = :EU + FI = :FI + FR = :FR + GB = :GB + GE = :GE + GR = :GR + HK = :HK + HR = :HR + HU = :HU + ID = :ID + IE = :IE + IL = :IL + IN = :IN + IS = :IS + IT = :IT + JP = :JP + KE = :KE + KR = :KR + KZ = :KZ + LI = :LI + LT = :LT + LU = :LU + LV = :LV + MT = :MT + MX = :MX + MY = :MY + NG = :NG + NL = :NL + NO = :NO + NZ = :NZ + OM = :OM + PE = :PE + PH = :PH + PL = :PL + PT = :PT + RO = :RO + RS = :RS + RU = :RU + SA = :SA + SE = :SE + SG = :SG + SI = :SI + SK = :SK + SV = :SV + TH = :TH + TR = :TR + TW = :TW + UA = :UA + US = :US + UY = :UY + VE = :VE + VN = :VN + ZA = :ZA + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # @example + # ```ruby + # case type + # in :ad_nrt + # # ... + # in :ae_trn + # # ... + # in :ar_cuit + # # ... + # in :eu_vat + # # ... + # in :au_abn + # # ... + # in ... + # #... + # end + # ``` + class Type < Orb::Enum + AD_NRT = :ad_nrt + AE_TRN = :ae_trn + AR_CUIT = :ar_cuit + EU_VAT = :eu_vat + AU_ABN = :au_abn + AU_ARN = :au_arn + BG_UIC = :bg_uic + BH_VAT = :bh_vat + BO_TIN = :bo_tin + BR_CNPJ = :br_cnpj + BR_CPF = :br_cpf + CA_BN = :ca_bn + CA_GST_HST = :ca_gst_hst + CA_PST_BC = :ca_pst_bc + CA_PST_MB = :ca_pst_mb + CA_PST_SK = :ca_pst_sk + CA_QST = :ca_qst + CH_VAT = :ch_vat + CL_TIN = :cl_tin + CN_TIN = :cn_tin + CO_NIT = :co_nit + CR_TIN = :cr_tin + DO_RCN = :do_rcn + EC_RUC = :ec_ruc + EG_TIN = :eg_tin + ES_CIF = :es_cif + EU_OSS_VAT = :eu_oss_vat + GB_VAT = :gb_vat + GE_VAT = :ge_vat + HK_BR = :hk_br + HU_TIN = :hu_tin + ID_NPWP = :id_npwp + IL_VAT = :il_vat + IN_GST = :in_gst + IS_VAT = :is_vat + JP_CN = :jp_cn + JP_RN = :jp_rn + JP_TRN = :jp_trn + KE_PIN = :ke_pin + KR_BRN = :kr_brn + KZ_BIN = :kz_bin + LI_UID = :li_uid + MX_RFC = :mx_rfc + MY_FRP = :my_frp + MY_ITN = :my_itn + MY_SST = :my_sst + NG_TIN = :ng_tin + NO_VAT = :no_vat + NO_VOEC = :no_voec + NZ_GST = :nz_gst + OM_VAT = :om_vat + PE_RUC = :pe_ruc + PH_TIN = :ph_tin + RO_TIN = :ro_tin + RS_PIB = :rs_pib + RU_INN = :ru_inn + RU_KPP = :ru_kpp + SA_VAT = :sa_vat + SG_GST = :sg_gst + SG_UEN = :sg_uen + SI_TIN = :si_tin + SV_NIT = :sv_nit + TH_VAT = :th_vat + TR_TIN = :tr_tin + TW_VAT = :tw_vat + UA_VAT = :ua_vat + US_EIN = :us_ein + UY_RUC = :uy_ruc + VE_RIF = :ve_rif + VN_TIN = :vn_tin + ZA_VAT = :za_vat + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/customers/balance_transaction_create_params.rb b/lib/orb/models/customers/balance_transaction_create_params.rb new file mode 100644 index 00000000..08c0c6c5 --- /dev/null +++ b/lib/orb/models/customers/balance_transaction_create_params.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + class BalanceTransactionCreateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute amount + # + # @return [String] + required :amount, String + + # @!attribute type + # + # @return [Symbol, Orb::Models::Customers::BalanceTransactionCreateParams::Type] + required :type, enum: -> { Orb::Models::Customers::BalanceTransactionCreateParams::Type } + + # @!attribute description + # An optional description that can be specified around this entry. + # + # @return [String, nil] + optional :description, String, nil?: true + + # @!parse + # # @param amount [String] + # # @param type [Symbol, Orb::Models::Customers::BalanceTransactionCreateParams::Type] + # # @param description [String, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(amount:, type:, description: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case type + # in :increment + # # ... + # in :decrement + # # ... + # end + # ``` + class Type < Orb::Enum + INCREMENT = :increment + DECREMENT = :decrement + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/customers/balance_transaction_create_response.rb b/lib/orb/models/customers/balance_transaction_create_response.rb new file mode 100644 index 00000000..f583a218 --- /dev/null +++ b/lib/orb/models/customers/balance_transaction_create_response.rb @@ -0,0 +1,216 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + # @example + # ```ruby + # balance_transaction_create_response => { + # id: String, + # action: Orb::Models::Customers::BalanceTransactionCreateResponse::Action, + # amount: String, + # created_at: Time, + # credit_note: Orb::Models::Customers::BalanceTransactionCreateResponse::CreditNote, + # **_ + # } + # ``` + class BalanceTransactionCreateResponse < Orb::BaseModel + # @!attribute id + # A unique id for this transaction. + # + # @return [String] + required :id, String + + # @!attribute action + # + # @return [Symbol, Orb::Models::Customers::BalanceTransactionCreateResponse::Action] + required :action, enum: -> { Orb::Models::Customers::BalanceTransactionCreateResponse::Action } + + # @!attribute amount + # The value of the amount changed in the transaction. + # + # @return [String] + required :amount, String + + # @!attribute created_at + # The creation time of this transaction. + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_note + # + # @return [Orb::Models::Customers::BalanceTransactionCreateResponse::CreditNote, nil] + required :credit_note, + -> { Orb::Models::Customers::BalanceTransactionCreateResponse::CreditNote }, + nil?: true + + # @!attribute description + # An optional description provided for manual customer balance adjustments. + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # The new value of the customer's balance prior to the transaction, in the + # customer's currency. + # + # @return [String] + required :ending_balance, String + + # @!attribute invoice + # + # @return [Orb::Models::Customers::BalanceTransactionCreateResponse::Invoice, nil] + required :invoice, + -> { + Orb::Models::Customers::BalanceTransactionCreateResponse::Invoice + }, + nil?: true + + # @!attribute starting_balance + # The original value of the customer's balance prior to the transaction, in the + # customer's currency. + # + # @return [String] + required :starting_balance, String + + # @!attribute type + # + # @return [Symbol, Orb::Models::Customers::BalanceTransactionCreateResponse::Type] + required :type, enum: -> { Orb::Models::Customers::BalanceTransactionCreateResponse::Type } + + # @!parse + # # @param id [String] + # # @param action [Symbol, Orb::Models::Customers::BalanceTransactionCreateResponse::Action] + # # @param amount [String] + # # @param created_at [Time] + # # @param credit_note [Orb::Models::Customers::BalanceTransactionCreateResponse::CreditNote, nil] + # # @param description [String, nil] + # # @param ending_balance [String] + # # @param invoice [Orb::Models::Customers::BalanceTransactionCreateResponse::Invoice, nil] + # # @param starting_balance [String] + # # @param type [Symbol, Orb::Models::Customers::BalanceTransactionCreateResponse::Type] + # # + # def initialize( + # id:, + # action:, + # amount:, + # created_at:, + # credit_note:, + # description:, + # ending_balance:, + # invoice:, + # starting_balance:, + # type:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case action + # in :applied_to_invoice + # # ... + # in :manual_adjustment + # # ... + # in :prorated_refund + # # ... + # in :revert_prorated_refund + # # ... + # in :return_from_voiding + # # ... + # in ... + # #... + # end + # ``` + class Action < Orb::Enum + APPLIED_TO_INVOICE = :applied_to_invoice + MANUAL_ADJUSTMENT = :manual_adjustment + PRORATED_REFUND = :prorated_refund + REVERT_PRORATED_REFUND = :revert_prorated_refund + RETURN_FROM_VOIDING = :return_from_voiding + CREDIT_NOTE_APPLIED = :credit_note_applied + CREDIT_NOTE_VOIDED = :credit_note_voided + OVERPAYMENT_REFUND = :overpayment_refund + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_note => { + # id: String + # } + # ``` + class CreditNote < Orb::BaseModel + # @!attribute id + # The id of the Credit note + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoice => { + # id: String + # } + # ``` + class Invoice < Orb::BaseModel + # @!attribute id + # The Invoice id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case type + # in :increment + # # ... + # in :decrement + # # ... + # end + # ``` + class Type < Orb::Enum + INCREMENT = :increment + DECREMENT = :decrement + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/customers/balance_transaction_list_params.rb b/lib/orb/models/customers/balance_transaction_list_params.rb new file mode 100644 index 00000000..2aa67898 --- /dev/null +++ b/lib/orb/models/customers/balance_transaction_list_params.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + class BalanceTransactionListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!attribute operation_time_gt + # + # @return [Time, nil] + optional :operation_time_gt, Time, api_name: :"operation_time[gt]", nil?: true + + # @!attribute operation_time_gte + # + # @return [Time, nil] + optional :operation_time_gte, Time, api_name: :"operation_time[gte]", nil?: true + + # @!attribute operation_time_lt + # + # @return [Time, nil] + optional :operation_time_lt, Time, api_name: :"operation_time[lt]", nil?: true + + # @!attribute operation_time_lte + # + # @return [Time, nil] + optional :operation_time_lte, Time, api_name: :"operation_time[lte]", nil?: true + + # @!parse + # # @param cursor [String, nil] + # # @param limit [Integer] + # # @param operation_time_gt [Time, nil] + # # @param operation_time_gte [Time, nil] + # # @param operation_time_lt [Time, nil] + # # @param operation_time_lte [Time, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # cursor: nil, + # limit: nil, + # operation_time_gt: nil, + # operation_time_gte: nil, + # operation_time_lt: nil, + # operation_time_lte: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/customers/balance_transaction_list_response.rb b/lib/orb/models/customers/balance_transaction_list_response.rb new file mode 100644 index 00000000..a724528a --- /dev/null +++ b/lib/orb/models/customers/balance_transaction_list_response.rb @@ -0,0 +1,212 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + # @example + # ```ruby + # balance_transaction_list_response => { + # id: String, + # action: Orb::Models::Customers::BalanceTransactionListResponse::Action, + # amount: String, + # created_at: Time, + # credit_note: Orb::Models::Customers::BalanceTransactionListResponse::CreditNote, + # **_ + # } + # ``` + class BalanceTransactionListResponse < Orb::BaseModel + # @!attribute id + # A unique id for this transaction. + # + # @return [String] + required :id, String + + # @!attribute action + # + # @return [Symbol, Orb::Models::Customers::BalanceTransactionListResponse::Action] + required :action, enum: -> { Orb::Models::Customers::BalanceTransactionListResponse::Action } + + # @!attribute amount + # The value of the amount changed in the transaction. + # + # @return [String] + required :amount, String + + # @!attribute created_at + # The creation time of this transaction. + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_note + # + # @return [Orb::Models::Customers::BalanceTransactionListResponse::CreditNote, nil] + required :credit_note, + -> { Orb::Models::Customers::BalanceTransactionListResponse::CreditNote }, + nil?: true + + # @!attribute description + # An optional description provided for manual customer balance adjustments. + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # The new value of the customer's balance prior to the transaction, in the + # customer's currency. + # + # @return [String] + required :ending_balance, String + + # @!attribute invoice + # + # @return [Orb::Models::Customers::BalanceTransactionListResponse::Invoice, nil] + required :invoice, -> { Orb::Models::Customers::BalanceTransactionListResponse::Invoice }, nil?: true + + # @!attribute starting_balance + # The original value of the customer's balance prior to the transaction, in the + # customer's currency. + # + # @return [String] + required :starting_balance, String + + # @!attribute type + # + # @return [Symbol, Orb::Models::Customers::BalanceTransactionListResponse::Type] + required :type, enum: -> { Orb::Models::Customers::BalanceTransactionListResponse::Type } + + # @!parse + # # @param id [String] + # # @param action [Symbol, Orb::Models::Customers::BalanceTransactionListResponse::Action] + # # @param amount [String] + # # @param created_at [Time] + # # @param credit_note [Orb::Models::Customers::BalanceTransactionListResponse::CreditNote, nil] + # # @param description [String, nil] + # # @param ending_balance [String] + # # @param invoice [Orb::Models::Customers::BalanceTransactionListResponse::Invoice, nil] + # # @param starting_balance [String] + # # @param type [Symbol, Orb::Models::Customers::BalanceTransactionListResponse::Type] + # # + # def initialize( + # id:, + # action:, + # amount:, + # created_at:, + # credit_note:, + # description:, + # ending_balance:, + # invoice:, + # starting_balance:, + # type:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case action + # in :applied_to_invoice + # # ... + # in :manual_adjustment + # # ... + # in :prorated_refund + # # ... + # in :revert_prorated_refund + # # ... + # in :return_from_voiding + # # ... + # in ... + # #... + # end + # ``` + class Action < Orb::Enum + APPLIED_TO_INVOICE = :applied_to_invoice + MANUAL_ADJUSTMENT = :manual_adjustment + PRORATED_REFUND = :prorated_refund + REVERT_PRORATED_REFUND = :revert_prorated_refund + RETURN_FROM_VOIDING = :return_from_voiding + CREDIT_NOTE_APPLIED = :credit_note_applied + CREDIT_NOTE_VOIDED = :credit_note_voided + OVERPAYMENT_REFUND = :overpayment_refund + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_note => { + # id: String + # } + # ``` + class CreditNote < Orb::BaseModel + # @!attribute id + # The id of the Credit note + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoice => { + # id: String + # } + # ``` + class Invoice < Orb::BaseModel + # @!attribute id + # The Invoice id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case type + # in :increment + # # ... + # in :decrement + # # ... + # end + # ``` + class Type < Orb::Enum + INCREMENT = :increment + DECREMENT = :decrement + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/customers/cost_list_by_external_id_params.rb b/lib/orb/models/customers/cost_list_by_external_id_params.rb new file mode 100644 index 00000000..7f4a7b48 --- /dev/null +++ b/lib/orb/models/customers/cost_list_by_external_id_params.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + class CostListByExternalIDParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute currency + # The currency or custom pricing unit to use. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute timeframe_end + # Costs returned are exclusive of `timeframe_end`. + # + # @return [Time, nil] + optional :timeframe_end, Time, nil?: true + + # @!attribute timeframe_start + # Costs returned are inclusive of `timeframe_start`. + # + # @return [Time, nil] + optional :timeframe_start, Time, nil?: true + + # @!attribute view_mode + # Controls whether Orb returns cumulative costs since the start of the billing + # period, or incremental day-by-day costs. If your customer has minimums or + # discounts, it's strongly recommended that you use the default cumulative + # behavior. + # + # @return [Symbol, Orb::Models::Customers::CostListByExternalIDParams::ViewMode, nil] + optional :view_mode, + enum: -> { + Orb::Models::Customers::CostListByExternalIDParams::ViewMode + }, + nil?: true + + # @!parse + # # @param currency [String, nil] + # # @param timeframe_end [Time, nil] + # # @param timeframe_start [Time, nil] + # # @param view_mode [Symbol, Orb::Models::Customers::CostListByExternalIDParams::ViewMode, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(currency: nil, timeframe_end: nil, timeframe_start: nil, view_mode: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # Controls whether Orb returns cumulative costs since the start of the billing + # period, or incremental day-by-day costs. If your customer has minimums or + # discounts, it's strongly recommended that you use the default cumulative + # behavior. + # + # @example + # ```ruby + # case view_mode + # in :periodic + # # ... + # in :cumulative + # # ... + # end + # ``` + class ViewMode < Orb::Enum + PERIODIC = :periodic + CUMULATIVE = :cumulative + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/customers/cost_list_by_external_id_response.rb b/lib/orb/models/customers/cost_list_by_external_id_response.rb new file mode 100644 index 00000000..391d25b3 --- /dev/null +++ b/lib/orb/models/customers/cost_list_by_external_id_response.rb @@ -0,0 +1,134 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + # @example + # ```ruby + # cost_list_by_external_id_response => { + # data: -> { Orb::ArrayOf[Orb::Models::Customers::CostListByExternalIDResponse::Data] === _1 } + # } + # ``` + class CostListByExternalIDResponse < Orb::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Orb::ArrayOf[Orb::Models::Customers::CostListByExternalIDResponse::Data] } + + # @!parse + # # @param data [Array] + # # + # def initialize(data:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # data => { + # per_price_costs: -> { Orb::ArrayOf[Orb::Models::Customers::CostListByExternalIDResponse::Data::PerPriceCost] === _1 }, + # subtotal: String, + # timeframe_end: Time, + # timeframe_start: Time, + # total: String + # } + # ``` + class Data < Orb::BaseModel + # @!attribute per_price_costs + # + # @return [Array] + required :per_price_costs, + -> { + Orb::ArrayOf[Orb::Models::Customers::CostListByExternalIDResponse::Data::PerPriceCost] + } + + # @!attribute subtotal + # Total costs for the timeframe, excluding any minimums and discounts. + # + # @return [String] + required :subtotal, String + + # @!attribute timeframe_end + # + # @return [Time] + required :timeframe_end, Time + + # @!attribute timeframe_start + # + # @return [Time] + required :timeframe_start, Time + + # @!attribute total + # Total costs for the timeframe, including any minimums and discounts. + # + # @return [String] + required :total, String + + # @!parse + # # @param per_price_costs [Array] + # # @param subtotal [String] + # # @param timeframe_end [Time] + # # @param timeframe_start [Time] + # # @param total [String] + # # + # def initialize(per_price_costs:, subtotal:, timeframe_end:, timeframe_start:, total:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # per_price_cost => { + # price: Orb::Models::Price, + # subtotal: String, + # total: String, + # quantity: Float + # } + # ``` + class PerPriceCost < Orb::BaseModel + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + required :price, union: -> { Orb::Models::Price } + + # @!attribute subtotal + # Price's contributions for the timeframe, excluding any minimums and discounts. + # + # @return [String] + required :subtotal, String + + # @!attribute total + # Price's contributions for the timeframe, including minimums and discounts. + # + # @return [String] + required :total, String + + # @!attribute quantity + # The price's quantity for the timeframe + # + # @return [Float, nil] + optional :quantity, Float, nil?: true + + # @!parse + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # # @param subtotal [String] + # # @param total [String] + # # @param quantity [Float, nil] + # # + # def initialize(price:, subtotal:, total:, quantity: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + end + end +end diff --git a/lib/orb/models/customers/cost_list_params.rb b/lib/orb/models/customers/cost_list_params.rb new file mode 100644 index 00000000..27c6c9ad --- /dev/null +++ b/lib/orb/models/customers/cost_list_params.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + class CostListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute currency + # The currency or custom pricing unit to use. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute timeframe_end + # Costs returned are exclusive of `timeframe_end`. + # + # @return [Time, nil] + optional :timeframe_end, Time, nil?: true + + # @!attribute timeframe_start + # Costs returned are inclusive of `timeframe_start`. + # + # @return [Time, nil] + optional :timeframe_start, Time, nil?: true + + # @!attribute view_mode + # Controls whether Orb returns cumulative costs since the start of the billing + # period, or incremental day-by-day costs. If your customer has minimums or + # discounts, it's strongly recommended that you use the default cumulative + # behavior. + # + # @return [Symbol, Orb::Models::Customers::CostListParams::ViewMode, nil] + optional :view_mode, enum: -> { Orb::Models::Customers::CostListParams::ViewMode }, nil?: true + + # @!parse + # # @param currency [String, nil] + # # @param timeframe_end [Time, nil] + # # @param timeframe_start [Time, nil] + # # @param view_mode [Symbol, Orb::Models::Customers::CostListParams::ViewMode, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(currency: nil, timeframe_end: nil, timeframe_start: nil, view_mode: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # Controls whether Orb returns cumulative costs since the start of the billing + # period, or incremental day-by-day costs. If your customer has minimums or + # discounts, it's strongly recommended that you use the default cumulative + # behavior. + # + # @example + # ```ruby + # case view_mode + # in :periodic + # # ... + # in :cumulative + # # ... + # end + # ``` + class ViewMode < Orb::Enum + PERIODIC = :periodic + CUMULATIVE = :cumulative + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/customers/cost_list_response.rb b/lib/orb/models/customers/cost_list_response.rb new file mode 100644 index 00000000..c74c1157 --- /dev/null +++ b/lib/orb/models/customers/cost_list_response.rb @@ -0,0 +1,132 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + # @example + # ```ruby + # cost_list_response => { + # data: -> { Orb::ArrayOf[Orb::Models::Customers::CostListResponse::Data] === _1 } + # } + # ``` + class CostListResponse < Orb::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Orb::ArrayOf[Orb::Models::Customers::CostListResponse::Data] } + + # @!parse + # # @param data [Array] + # # + # def initialize(data:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # data => { + # per_price_costs: -> { Orb::ArrayOf[Orb::Models::Customers::CostListResponse::Data::PerPriceCost] === _1 }, + # subtotal: String, + # timeframe_end: Time, + # timeframe_start: Time, + # total: String + # } + # ``` + class Data < Orb::BaseModel + # @!attribute per_price_costs + # + # @return [Array] + required :per_price_costs, + -> { Orb::ArrayOf[Orb::Models::Customers::CostListResponse::Data::PerPriceCost] } + + # @!attribute subtotal + # Total costs for the timeframe, excluding any minimums and discounts. + # + # @return [String] + required :subtotal, String + + # @!attribute timeframe_end + # + # @return [Time] + required :timeframe_end, Time + + # @!attribute timeframe_start + # + # @return [Time] + required :timeframe_start, Time + + # @!attribute total + # Total costs for the timeframe, including any minimums and discounts. + # + # @return [String] + required :total, String + + # @!parse + # # @param per_price_costs [Array] + # # @param subtotal [String] + # # @param timeframe_end [Time] + # # @param timeframe_start [Time] + # # @param total [String] + # # + # def initialize(per_price_costs:, subtotal:, timeframe_end:, timeframe_start:, total:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # per_price_cost => { + # price: Orb::Models::Price, + # subtotal: String, + # total: String, + # quantity: Float + # } + # ``` + class PerPriceCost < Orb::BaseModel + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + required :price, union: -> { Orb::Models::Price } + + # @!attribute subtotal + # Price's contributions for the timeframe, excluding any minimums and discounts. + # + # @return [String] + required :subtotal, String + + # @!attribute total + # Price's contributions for the timeframe, including minimums and discounts. + # + # @return [String] + required :total, String + + # @!attribute quantity + # The price's quantity for the timeframe + # + # @return [Float, nil] + optional :quantity, Float, nil?: true + + # @!parse + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # # @param subtotal [String] + # # @param total [String] + # # @param quantity [Float, nil] + # # + # def initialize(price:, subtotal:, total:, quantity: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + end + end +end diff --git a/lib/orb/models/customers/credit_list_by_external_id_params.rb b/lib/orb/models/customers/credit_list_by_external_id_params.rb new file mode 100644 index 00000000..39a89406 --- /dev/null +++ b/lib/orb/models/customers/credit_list_by_external_id_params.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + class CreditListByExternalIDParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute currency + # The ledger currency or custom pricing unit to use. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] include_all_blocks + # If set to True, all expired and depleted blocks, as well as active block will be + # returned. + # + # @return [Boolean, nil] + optional :include_all_blocks, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :include_all_blocks + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!parse + # # @param currency [String, nil] + # # @param cursor [String, nil] + # # @param include_all_blocks [Boolean] + # # @param limit [Integer] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(currency: nil, cursor: nil, include_all_blocks: nil, limit: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/customers/credit_list_by_external_id_response.rb b/lib/orb/models/customers/credit_list_by_external_id_response.rb new file mode 100644 index 00000000..c733318e --- /dev/null +++ b/lib/orb/models/customers/credit_list_by_external_id_response.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + # @example + # ```ruby + # credit_list_by_external_id_response => { + # id: String, + # balance: Float, + # effective_date: Time, + # expiry_date: Time, + # maximum_initial_balance: Float, + # **_ + # } + # ``` + class CreditListByExternalIDResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute balance + # + # @return [Float] + required :balance, Float + + # @!attribute effective_date + # + # @return [Time, nil] + required :effective_date, Time, nil?: true + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute maximum_initial_balance + # + # @return [Float, nil] + required :maximum_initial_balance, Float, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!attribute status + # + # @return [Symbol, Orb::Models::Customers::CreditListByExternalIDResponse::Status] + required :status, enum: -> { Orb::Models::Customers::CreditListByExternalIDResponse::Status } + + # @!parse + # # @param id [String] + # # @param balance [Float] + # # @param effective_date [Time, nil] + # # @param expiry_date [Time, nil] + # # @param maximum_initial_balance [Float, nil] + # # @param per_unit_cost_basis [String, nil] + # # @param status [Symbol, Orb::Models::Customers::CreditListByExternalIDResponse::Status] + # # + # def initialize(id:, balance:, effective_date:, expiry_date:, maximum_initial_balance:, per_unit_cost_basis:, status:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :pending_payment + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + PENDING_PAYMENT = :pending_payment + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/customers/credit_list_params.rb b/lib/orb/models/customers/credit_list_params.rb new file mode 100644 index 00000000..bc381506 --- /dev/null +++ b/lib/orb/models/customers/credit_list_params.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + class CreditListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute currency + # The ledger currency or custom pricing unit to use. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] include_all_blocks + # If set to True, all expired and depleted blocks, as well as active block will be + # returned. + # + # @return [Boolean, nil] + optional :include_all_blocks, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :include_all_blocks + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!parse + # # @param currency [String, nil] + # # @param cursor [String, nil] + # # @param include_all_blocks [Boolean] + # # @param limit [Integer] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(currency: nil, cursor: nil, include_all_blocks: nil, limit: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/customers/credit_list_response.rb b/lib/orb/models/customers/credit_list_response.rb new file mode 100644 index 00000000..bb0e5e48 --- /dev/null +++ b/lib/orb/models/customers/credit_list_response.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + # @example + # ```ruby + # credit_list_response => { + # id: String, + # balance: Float, + # effective_date: Time, + # expiry_date: Time, + # maximum_initial_balance: Float, + # **_ + # } + # ``` + class CreditListResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute balance + # + # @return [Float] + required :balance, Float + + # @!attribute effective_date + # + # @return [Time, nil] + required :effective_date, Time, nil?: true + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute maximum_initial_balance + # + # @return [Float, nil] + required :maximum_initial_balance, Float, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!attribute status + # + # @return [Symbol, Orb::Models::Customers::CreditListResponse::Status] + required :status, enum: -> { Orb::Models::Customers::CreditListResponse::Status } + + # @!parse + # # @param id [String] + # # @param balance [Float] + # # @param effective_date [Time, nil] + # # @param expiry_date [Time, nil] + # # @param maximum_initial_balance [Float, nil] + # # @param per_unit_cost_basis [String, nil] + # # @param status [Symbol, Orb::Models::Customers::CreditListResponse::Status] + # # + # def initialize(id:, balance:, effective_date:, expiry_date:, maximum_initial_balance:, per_unit_cost_basis:, status:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :pending_payment + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + PENDING_PAYMENT = :pending_payment + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb b/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb new file mode 100644 index 00000000..96cf8200 --- /dev/null +++ b/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb @@ -0,0 +1,246 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + class LedgerCreateEntryByExternalIDParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute amount + # The number of credits to effect. Note that this is required for increment, + # decrement or void operations. + # + # @return [Float] + required :amount, Float + + # @!attribute entry_type + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::EntryType] + required :entry_type, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::EntryType + } + + # @!attribute currency + # The currency or custom pricing unit to use for this ledger entry. If this is a + # real-world currency, it must match the customer's invoicing currency. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute description + # Optional metadata that can be specified when adding ledger results via the API. + # For example, this can be used to note an increment refers to trial credits, or + # for noting corrections as a result of an incident, etc. + # + # @return [String, nil] + optional :description, String, nil?: true + + # @!attribute effective_date + # An ISO 8601 format date that denotes when this credit balance should become + # available for use. + # + # @return [Time, nil] + optional :effective_date, Time, nil?: true + + # @!attribute expiry_date + # An ISO 8601 format date that identifies the origination credit block to expire + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute invoice_settings + # Passing `invoice_settings` automatically generates an invoice for the newly + # added credits. If `invoice_settings` is passed, you must specify + # per_unit_cost_basis, as the calculation of the invoice total is done on that + # basis. + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings, nil] + optional :invoice_settings, + -> { + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute per_unit_cost_basis + # Can only be specified when entry_type=increment. How much, in the customer's + # currency, a customer paid for a single credit in this block + # + # @return [String, nil] + optional :per_unit_cost_basis, String, nil?: true + + # @!attribute target_expiry_date + # A future date (specified in YYYY-MM-DD format) used for expiration change, + # denoting when credits transferred (as part of a partial block expiration) should + # expire. + # + # @return [Date] + required :target_expiry_date, Date + + # @!attribute block_id + # The ID of the block to reverse a decrement from. + # + # @return [String] + required :block_id, String + + # @!attribute void_reason + # Can only be specified when `entry_type=void`. The reason for the void. + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::VoidReason, nil] + optional :void_reason, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::VoidReason + }, + nil?: true + + # @!parse + # # @param amount [Float] + # # @param entry_type [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::EntryType] + # # @param expiry_date [Time, nil] + # # @param target_expiry_date [Date] + # # @param block_id [String] + # # @param currency [String, nil] + # # @param description [String, nil] + # # @param effective_date [Time, nil] + # # @param invoice_settings [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param per_unit_cost_basis [String, nil] + # # @param void_reason [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::VoidReason, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # amount:, + # entry_type:, + # expiry_date:, + # target_expiry_date:, + # block_id:, + # currency: nil, + # description: nil, + # effective_date: nil, + # invoice_settings: nil, + # metadata: nil, + # per_unit_cost_basis: nil, + # void_reason: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case entry_type + # in :amendment + # # ... + # end + # ``` + class EntryType < Orb::Enum + AMENDMENT = :amendment + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # invoice_settings => { + # auto_collection: Orb::BooleanModel, + # net_terms: Integer, + # memo: String, + # require_successful_payment: Orb::BooleanModel + # } + # ``` + class InvoiceSettings < Orb::BaseModel + # @!attribute auto_collection + # Whether the credits purchase invoice should auto collect with the customer's + # saved payment method. + # + # @return [Boolean] + required :auto_collection, Orb::BooleanModel + + # @!attribute net_terms + # The net terms determines the difference between the invoice date and the issue + # date for the invoice. If you intend the invoice to be due on issue, set this + # to 0. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute memo + # An optional memo to display on the invoice. + # + # @return [String, nil] + optional :memo, String, nil?: true + + # @!attribute [r] require_successful_payment + # If true, the new credit block will require that the corresponding invoice is + # paid before it can be drawn down from. + # + # @return [Boolean, nil] + optional :require_successful_payment, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :require_successful_payment + + # @!parse + # # Passing `invoice_settings` automatically generates an invoice for the newly + # # added credits. If `invoice_settings` is passed, you must specify + # # per_unit_cost_basis, as the calculation of the invoice total is done on that + # # basis. + # # + # # @param auto_collection [Boolean] + # # @param net_terms [Integer] + # # @param memo [String, nil] + # # @param require_successful_payment [Boolean] + # # + # def initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # Can only be specified when `entry_type=void`. The reason for the void. + # + # @example + # ```ruby + # case void_reason + # in :refund + # # ... + # end + # ``` + class VoidReason < Orb::Enum + REFUND = :refund + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rb b/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rb new file mode 100644 index 00000000..28ac93cb --- /dev/null +++ b/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rb @@ -0,0 +1,1590 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + # @abstract + # + # The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid + # credits within Orb. + # + # @example + # ```ruby + # case ledger_create_entry_by_external_id_response + # in {entry_type: "increment", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry ... + # in {entry_type: "decrement", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry ... + # in {entry_type: "expiration_change", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry ... + # in {entry_type: "credit_block_expiry", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry ... + # in {entry_type: "void", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry ... + # in {entry_type: "void_initiated", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry ... + # in {entry_type: "amendment", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry ... + # end + # ``` + # + # @example + # ```ruby + # case ledger_create_entry_by_external_id_response + # in Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry + # # ... + # end + # ``` + class LedgerCreateEntryByExternalIDResponse < Orb::Union + discriminator :entry_type + + variant :increment, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry } + + variant :decrement, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry } + + variant :expiration_change, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry } + + variant :credit_block_expiry, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry } + + variant :void, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry } + + variant :void_initiated, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry } + + variant :amendment, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry } + + # @example + # ```ruby + # increment_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class IncrementLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :increment] + required :entry_type, const: :increment + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param entry_type [Symbol, :increment] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # entry_type: :increment, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # decrement_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class DecrementLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :decrement] + required :entry_type, const: :decrement + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!attribute event_id + # + # @return [String, nil] + optional :event_id, String, nil?: true + + # @!attribute invoice_id + # + # @return [String, nil] + optional :invoice_id, String, nil?: true + + # @!attribute price_id + # + # @return [String, nil] + optional :price_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param event_id [String, nil] + # # @param invoice_id [String, nil] + # # @param price_id [String, nil] + # # @param entry_type [Symbol, :decrement] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # event_id: nil, + # invoice_id: nil, + # price_id: nil, + # entry_type: :decrement, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # expiration_change_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class ExpirationChangeLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :expiration_change] + required :entry_type, const: :expiration_change + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute new_block_expiry_date + # + # @return [Time, nil] + required :new_block_expiry_date, Time, nil?: true + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param new_block_expiry_date [Time, nil] + # # @param starting_balance [Float] + # # @param entry_type [Symbol, :expiration_change] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # new_block_expiry_date:, + # starting_balance:, + # entry_type: :expiration_change, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # credit_block_expiry_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class CreditBlockExpiryLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :credit_block_expiry] + required :entry_type, const: :credit_block_expiry + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param entry_type [Symbol, :credit_block_expiry] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # entry_type: :credit_block_expiry, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # void_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class VoidLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :void] + required :entry_type, const: :void + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!attribute void_amount + # + # @return [Float] + required :void_amount, Float + + # @!attribute void_reason + # + # @return [String, nil] + required :void_reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param void_amount [Float] + # # @param void_reason [String, nil] + # # @param entry_type [Symbol, :void] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # void_amount:, + # void_reason:, + # entry_type: :void, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # void_initiated_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class VoidInitiatedLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :void_initiated] + required :entry_type, const: :void_initiated + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute new_block_expiry_date + # + # @return [Time] + required :new_block_expiry_date, Time + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!attribute void_amount + # + # @return [Float] + required :void_amount, Float + + # @!attribute void_reason + # + # @return [String, nil] + required :void_reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param new_block_expiry_date [Time] + # # @param starting_balance [Float] + # # @param void_amount [Float] + # # @param void_reason [String, nil] + # # @param entry_type [Symbol, :void_initiated] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # new_block_expiry_date:, + # starting_balance:, + # void_amount:, + # void_reason:, + # entry_type: :void_initiated, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # amendment_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class AmendmentLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :amendment] + required :entry_type, const: :amendment + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param entry_type [Symbol, :amendment] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # entry_type: :amendment, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/ledger_create_entry_params.rb b/lib/orb/models/customers/credits/ledger_create_entry_params.rb new file mode 100644 index 00000000..fba8ebff --- /dev/null +++ b/lib/orb/models/customers/credits/ledger_create_entry_params.rb @@ -0,0 +1,242 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + class LedgerCreateEntryParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute amount + # The number of credits to effect. Note that this is required for increment, + # decrement or void operations. + # + # @return [Float] + required :amount, Float + + # @!attribute entry_type + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::EntryType] + required :entry_type, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryParams::EntryType + } + + # @!attribute currency + # The currency or custom pricing unit to use for this ledger entry. If this is a + # real-world currency, it must match the customer's invoicing currency. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute description + # Optional metadata that can be specified when adding ledger results via the API. + # For example, this can be used to note an increment refers to trial credits, or + # for noting corrections as a result of an incident, etc. + # + # @return [String, nil] + optional :description, String, nil?: true + + # @!attribute effective_date + # An ISO 8601 format date that denotes when this credit balance should become + # available for use. + # + # @return [Time, nil] + optional :effective_date, Time, nil?: true + + # @!attribute expiry_date + # An ISO 8601 format date that identifies the origination credit block to expire + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute invoice_settings + # Passing `invoice_settings` automatically generates an invoice for the newly + # added credits. If `invoice_settings` is passed, you must specify + # per_unit_cost_basis, as the calculation of the invoice total is done on that + # basis. + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings, nil] + optional :invoice_settings, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute per_unit_cost_basis + # Can only be specified when entry_type=increment. How much, in the customer's + # currency, a customer paid for a single credit in this block + # + # @return [String, nil] + optional :per_unit_cost_basis, String, nil?: true + + # @!attribute target_expiry_date + # A future date (specified in YYYY-MM-DD format) used for expiration change, + # denoting when credits transferred (as part of a partial block expiration) should + # expire. + # + # @return [Date] + required :target_expiry_date, Date + + # @!attribute block_id + # The ID of the block to reverse a decrement from. + # + # @return [String] + required :block_id, String + + # @!attribute void_reason + # Can only be specified when `entry_type=void`. The reason for the void. + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::VoidReason, nil] + optional :void_reason, + enum: -> { Orb::Models::Customers::Credits::LedgerCreateEntryParams::VoidReason }, + nil?: true + + # @!parse + # # @param amount [Float] + # # @param entry_type [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::EntryType] + # # @param expiry_date [Time, nil] + # # @param target_expiry_date [Date] + # # @param block_id [String] + # # @param currency [String, nil] + # # @param description [String, nil] + # # @param effective_date [Time, nil] + # # @param invoice_settings [Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param per_unit_cost_basis [String, nil] + # # @param void_reason [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::VoidReason, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # amount:, + # entry_type:, + # expiry_date:, + # target_expiry_date:, + # block_id:, + # currency: nil, + # description: nil, + # effective_date: nil, + # invoice_settings: nil, + # metadata: nil, + # per_unit_cost_basis: nil, + # void_reason: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case entry_type + # in :amendment + # # ... + # end + # ``` + class EntryType < Orb::Enum + AMENDMENT = :amendment + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # invoice_settings => { + # auto_collection: Orb::BooleanModel, + # net_terms: Integer, + # memo: String, + # require_successful_payment: Orb::BooleanModel + # } + # ``` + class InvoiceSettings < Orb::BaseModel + # @!attribute auto_collection + # Whether the credits purchase invoice should auto collect with the customer's + # saved payment method. + # + # @return [Boolean] + required :auto_collection, Orb::BooleanModel + + # @!attribute net_terms + # The net terms determines the difference between the invoice date and the issue + # date for the invoice. If you intend the invoice to be due on issue, set this + # to 0. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute memo + # An optional memo to display on the invoice. + # + # @return [String, nil] + optional :memo, String, nil?: true + + # @!attribute [r] require_successful_payment + # If true, the new credit block will require that the corresponding invoice is + # paid before it can be drawn down from. + # + # @return [Boolean, nil] + optional :require_successful_payment, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :require_successful_payment + + # @!parse + # # Passing `invoice_settings` automatically generates an invoice for the newly + # # added credits. If `invoice_settings` is passed, you must specify + # # per_unit_cost_basis, as the calculation of the invoice total is done on that + # # basis. + # # + # # @param auto_collection [Boolean] + # # @param net_terms [Integer] + # # @param memo [String, nil] + # # @param require_successful_payment [Boolean] + # # + # def initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # Can only be specified when `entry_type=void`. The reason for the void. + # + # @example + # ```ruby + # case void_reason + # in :refund + # # ... + # end + # ``` + class VoidReason < Orb::Enum + REFUND = :refund + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/ledger_create_entry_response.rb b/lib/orb/models/customers/credits/ledger_create_entry_response.rb new file mode 100644 index 00000000..188e437b --- /dev/null +++ b/lib/orb/models/customers/credits/ledger_create_entry_response.rb @@ -0,0 +1,1589 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + # @abstract + # + # The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid + # credits within Orb. + # + # @example + # ```ruby + # case ledger_create_entry_response + # in {entry_type: "increment", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry ... + # in {entry_type: "decrement", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry ... + # in {entry_type: "expiration_change", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry ... + # in {entry_type: "credit_block_expiry", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry ... + # in {entry_type: "void", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry ... + # in {entry_type: "void_initiated", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry ... + # in {entry_type: "amendment", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry ... + # end + # ``` + # + # @example + # ```ruby + # case ledger_create_entry_response + # in Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry + # # ... + # end + # ``` + class LedgerCreateEntryResponse < Orb::Union + discriminator :entry_type + + variant :increment, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry } + + variant :decrement, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry } + + variant :expiration_change, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry } + + variant :credit_block_expiry, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry } + + variant :void, -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry } + + variant :void_initiated, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry } + + variant :amendment, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry } + + # @example + # ```ruby + # increment_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class IncrementLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :increment] + required :entry_type, const: :increment + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param entry_type [Symbol, :increment] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # entry_type: :increment, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # decrement_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class DecrementLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :decrement] + required :entry_type, const: :decrement + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!attribute event_id + # + # @return [String, nil] + optional :event_id, String, nil?: true + + # @!attribute invoice_id + # + # @return [String, nil] + optional :invoice_id, String, nil?: true + + # @!attribute price_id + # + # @return [String, nil] + optional :price_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param event_id [String, nil] + # # @param invoice_id [String, nil] + # # @param price_id [String, nil] + # # @param entry_type [Symbol, :decrement] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # event_id: nil, + # invoice_id: nil, + # price_id: nil, + # entry_type: :decrement, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # expiration_change_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class ExpirationChangeLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :expiration_change] + required :entry_type, const: :expiration_change + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute new_block_expiry_date + # + # @return [Time, nil] + required :new_block_expiry_date, Time, nil?: true + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param new_block_expiry_date [Time, nil] + # # @param starting_balance [Float] + # # @param entry_type [Symbol, :expiration_change] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # new_block_expiry_date:, + # starting_balance:, + # entry_type: :expiration_change, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # credit_block_expiry_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class CreditBlockExpiryLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :credit_block_expiry] + required :entry_type, const: :credit_block_expiry + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param entry_type [Symbol, :credit_block_expiry] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # entry_type: :credit_block_expiry, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # void_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class VoidLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :void] + required :entry_type, const: :void + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!attribute void_amount + # + # @return [Float] + required :void_amount, Float + + # @!attribute void_reason + # + # @return [String, nil] + required :void_reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param void_amount [Float] + # # @param void_reason [String, nil] + # # @param entry_type [Symbol, :void] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # void_amount:, + # void_reason:, + # entry_type: :void, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # void_initiated_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class VoidInitiatedLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :void_initiated] + required :entry_type, const: :void_initiated + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute new_block_expiry_date + # + # @return [Time] + required :new_block_expiry_date, Time + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!attribute void_amount + # + # @return [Float] + required :void_amount, Float + + # @!attribute void_reason + # + # @return [String, nil] + required :void_reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param new_block_expiry_date [Time] + # # @param starting_balance [Float] + # # @param void_amount [Float] + # # @param void_reason [String, nil] + # # @param entry_type [Symbol, :void_initiated] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # new_block_expiry_date:, + # starting_balance:, + # void_amount:, + # void_reason:, + # entry_type: :void_initiated, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # amendment_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class AmendmentLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :amendment] + required :entry_type, const: :amendment + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param entry_type [Symbol, :amendment] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # entry_type: :amendment, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rb b/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rb new file mode 100644 index 00000000..ab9456c3 --- /dev/null +++ b/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rb @@ -0,0 +1,168 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + class LedgerListByExternalIDParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute created_at_gt + # + # @return [Time, nil] + optional :created_at_gt, Time, api_name: :"created_at[gt]", nil?: true + + # @!attribute created_at_gte + # + # @return [Time, nil] + optional :created_at_gte, Time, api_name: :"created_at[gte]", nil?: true + + # @!attribute created_at_lt + # + # @return [Time, nil] + optional :created_at_lt, Time, api_name: :"created_at[lt]", nil?: true + + # @!attribute created_at_lte + # + # @return [Time, nil] + optional :created_at_lte, Time, api_name: :"created_at[lte]", nil?: true + + # @!attribute currency + # The ledger currency or custom pricing unit to use. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDParams::EntryStatus, nil] + optional :entry_status, + enum: -> { Orb::Models::Customers::Credits::LedgerListByExternalIDParams::EntryStatus }, + nil?: true + + # @!attribute entry_type + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDParams::EntryType, nil] + optional :entry_type, + enum: -> { Orb::Models::Customers::Credits::LedgerListByExternalIDParams::EntryType }, + nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!attribute minimum_amount + # + # @return [String, nil] + optional :minimum_amount, String, nil?: true + + # @!parse + # # @param created_at_gt [Time, nil] + # # @param created_at_gte [Time, nil] + # # @param created_at_lt [Time, nil] + # # @param created_at_lte [Time, nil] + # # @param currency [String, nil] + # # @param cursor [String, nil] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDParams::EntryStatus, nil] + # # @param entry_type [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDParams::EntryType, nil] + # # @param limit [Integer] + # # @param minimum_amount [String, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # created_at_gt: nil, + # created_at_gte: nil, + # created_at_lt: nil, + # created_at_lte: nil, + # currency: nil, + # cursor: nil, + # entry_status: nil, + # entry_type: nil, + # limit: nil, + # minimum_amount: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # @example + # ```ruby + # case entry_type + # in :increment + # # ... + # in :decrement + # # ... + # in :expiration_change + # # ... + # in :credit_block_expiry + # # ... + # in :void + # # ... + # in ... + # #... + # end + # ``` + class EntryType < Orb::Enum + INCREMENT = :increment + DECREMENT = :decrement + EXPIRATION_CHANGE = :expiration_change + CREDIT_BLOCK_EXPIRY = :credit_block_expiry + VOID = :void + VOID_INITIATED = :void_initiated + AMENDMENT = :amendment + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rb b/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rb new file mode 100644 index 00000000..f80675bd --- /dev/null +++ b/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rb @@ -0,0 +1,1592 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + # @abstract + # + # The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid + # credits within Orb. + # + # @example + # ```ruby + # case ledger_list_by_external_id_response + # in {entry_type: "increment", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry ... + # in {entry_type: "decrement", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry ... + # in {entry_type: "expiration_change", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry ... + # in {entry_type: "credit_block_expiry", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry ... + # in {entry_type: "void", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry ... + # in {entry_type: "void_initiated", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry ... + # in {entry_type: "amendment", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry ... + # end + # ``` + # + # @example + # ```ruby + # case ledger_list_by_external_id_response + # in Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry + # # ... + # end + # ``` + class LedgerListByExternalIDResponse < Orb::Union + discriminator :entry_type + + variant :increment, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry } + + variant :decrement, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry } + + variant :expiration_change, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry } + + variant :credit_block_expiry, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry } + + variant :void, + -> { + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry + } + + variant :void_initiated, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry } + + variant :amendment, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry } + + # @example + # ```ruby + # increment_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class IncrementLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :increment] + required :entry_type, const: :increment + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param entry_type [Symbol, :increment] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # entry_type: :increment, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # decrement_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class DecrementLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :decrement] + required :entry_type, const: :decrement + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!attribute event_id + # + # @return [String, nil] + optional :event_id, String, nil?: true + + # @!attribute invoice_id + # + # @return [String, nil] + optional :invoice_id, String, nil?: true + + # @!attribute price_id + # + # @return [String, nil] + optional :price_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param event_id [String, nil] + # # @param invoice_id [String, nil] + # # @param price_id [String, nil] + # # @param entry_type [Symbol, :decrement] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # event_id: nil, + # invoice_id: nil, + # price_id: nil, + # entry_type: :decrement, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # expiration_change_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class ExpirationChangeLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :expiration_change] + required :entry_type, const: :expiration_change + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute new_block_expiry_date + # + # @return [Time, nil] + required :new_block_expiry_date, Time, nil?: true + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param new_block_expiry_date [Time, nil] + # # @param starting_balance [Float] + # # @param entry_type [Symbol, :expiration_change] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # new_block_expiry_date:, + # starting_balance:, + # entry_type: :expiration_change, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # credit_block_expiry_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class CreditBlockExpiryLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :credit_block_expiry] + required :entry_type, const: :credit_block_expiry + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param entry_type [Symbol, :credit_block_expiry] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # entry_type: :credit_block_expiry, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # void_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class VoidLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :void] + required :entry_type, const: :void + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!attribute void_amount + # + # @return [Float] + required :void_amount, Float + + # @!attribute void_reason + # + # @return [String, nil] + required :void_reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param void_amount [Float] + # # @param void_reason [String, nil] + # # @param entry_type [Symbol, :void] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # void_amount:, + # void_reason:, + # entry_type: :void, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # void_initiated_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class VoidInitiatedLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :void_initiated] + required :entry_type, const: :void_initiated + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute new_block_expiry_date + # + # @return [Time] + required :new_block_expiry_date, Time + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!attribute void_amount + # + # @return [Float] + required :void_amount, Float + + # @!attribute void_reason + # + # @return [String, nil] + required :void_reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param new_block_expiry_date [Time] + # # @param starting_balance [Float] + # # @param void_amount [Float] + # # @param void_reason [String, nil] + # # @param entry_type [Symbol, :void_initiated] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # new_block_expiry_date:, + # starting_balance:, + # void_amount:, + # void_reason:, + # entry_type: :void_initiated, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # amendment_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class AmendmentLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :amendment] + required :entry_type, const: :amendment + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param entry_type [Symbol, :amendment] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # entry_type: :amendment, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/ledger_list_params.rb b/lib/orb/models/customers/credits/ledger_list_params.rb new file mode 100644 index 00000000..d0115486 --- /dev/null +++ b/lib/orb/models/customers/credits/ledger_list_params.rb @@ -0,0 +1,168 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + class LedgerListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute created_at_gt + # + # @return [Time, nil] + optional :created_at_gt, Time, api_name: :"created_at[gt]", nil?: true + + # @!attribute created_at_gte + # + # @return [Time, nil] + optional :created_at_gte, Time, api_name: :"created_at[gte]", nil?: true + + # @!attribute created_at_lt + # + # @return [Time, nil] + optional :created_at_lt, Time, api_name: :"created_at[lt]", nil?: true + + # @!attribute created_at_lte + # + # @return [Time, nil] + optional :created_at_lte, Time, api_name: :"created_at[lte]", nil?: true + + # @!attribute currency + # The ledger currency or custom pricing unit to use. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListParams::EntryStatus, nil] + optional :entry_status, + enum: -> { Orb::Models::Customers::Credits::LedgerListParams::EntryStatus }, + nil?: true + + # @!attribute entry_type + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListParams::EntryType, nil] + optional :entry_type, + enum: -> { Orb::Models::Customers::Credits::LedgerListParams::EntryType }, + nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!attribute minimum_amount + # + # @return [String, nil] + optional :minimum_amount, String, nil?: true + + # @!parse + # # @param created_at_gt [Time, nil] + # # @param created_at_gte [Time, nil] + # # @param created_at_lt [Time, nil] + # # @param created_at_lte [Time, nil] + # # @param currency [String, nil] + # # @param cursor [String, nil] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerListParams::EntryStatus, nil] + # # @param entry_type [Symbol, Orb::Models::Customers::Credits::LedgerListParams::EntryType, nil] + # # @param limit [Integer] + # # @param minimum_amount [String, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # created_at_gt: nil, + # created_at_gte: nil, + # created_at_lt: nil, + # created_at_lte: nil, + # currency: nil, + # cursor: nil, + # entry_status: nil, + # entry_type: nil, + # limit: nil, + # minimum_amount: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # @example + # ```ruby + # case entry_type + # in :increment + # # ... + # in :decrement + # # ... + # in :expiration_change + # # ... + # in :credit_block_expiry + # # ... + # in :void + # # ... + # in ... + # #... + # end + # ``` + class EntryType < Orb::Enum + INCREMENT = :increment + DECREMENT = :decrement + EXPIRATION_CHANGE = :expiration_change + CREDIT_BLOCK_EXPIRY = :credit_block_expiry + VOID = :void + VOID_INITIATED = :void_initiated + AMENDMENT = :amendment + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/ledger_list_response.rb b/lib/orb/models/customers/credits/ledger_list_response.rb new file mode 100644 index 00000000..3a6b14d5 --- /dev/null +++ b/lib/orb/models/customers/credits/ledger_list_response.rb @@ -0,0 +1,1588 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + # @abstract + # + # The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid + # credits within Orb. + # + # @example + # ```ruby + # case ledger_list_response + # in {entry_type: "increment", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry ... + # in {entry_type: "decrement", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry ... + # in {entry_type: "expiration_change", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry ... + # in {entry_type: "credit_block_expiry", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry ... + # in {entry_type: "void", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry ... + # in {entry_type: "void_initiated", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry ... + # in {entry_type: "amendment", id: String, amount: Float, created_at: Time} + # # Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry ... + # end + # ``` + # + # @example + # ```ruby + # case ledger_list_response + # in Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry + # # ... + # in Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry + # # ... + # end + # ``` + class LedgerListResponse < Orb::Union + discriminator :entry_type + + variant :increment, -> { Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry } + + variant :decrement, -> { Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry } + + variant :expiration_change, + -> { Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry } + + variant :credit_block_expiry, + -> { Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry } + + variant :void, -> { Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry } + + variant :void_initiated, + -> { Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry } + + variant :amendment, -> { Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry } + + # @example + # ```ruby + # increment_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class IncrementLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :increment] + required :entry_type, const: :increment + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param entry_type [Symbol, :increment] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # entry_type: :increment, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # decrement_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class DecrementLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :decrement] + required :entry_type, const: :decrement + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!attribute event_id + # + # @return [String, nil] + optional :event_id, String, nil?: true + + # @!attribute invoice_id + # + # @return [String, nil] + optional :invoice_id, String, nil?: true + + # @!attribute price_id + # + # @return [String, nil] + optional :price_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param event_id [String, nil] + # # @param invoice_id [String, nil] + # # @param price_id [String, nil] + # # @param entry_type [Symbol, :decrement] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # event_id: nil, + # invoice_id: nil, + # price_id: nil, + # entry_type: :decrement, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # expiration_change_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class ExpirationChangeLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :expiration_change] + required :entry_type, const: :expiration_change + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute new_block_expiry_date + # + # @return [Time, nil] + required :new_block_expiry_date, Time, nil?: true + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param new_block_expiry_date [Time, nil] + # # @param starting_balance [Float] + # # @param entry_type [Symbol, :expiration_change] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # new_block_expiry_date:, + # starting_balance:, + # entry_type: :expiration_change, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # credit_block_expiry_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class CreditBlockExpiryLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :credit_block_expiry] + required :entry_type, const: :credit_block_expiry + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param entry_type [Symbol, :credit_block_expiry] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # entry_type: :credit_block_expiry, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # void_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class VoidLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::Customer] + required :customer, + -> { + Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::Customer + } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :void] + required :entry_type, const: :void + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!attribute void_amount + # + # @return [Float] + required :void_amount, Float + + # @!attribute void_reason + # + # @return [String, nil] + required :void_reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param void_amount [Float] + # # @param void_reason [String, nil] + # # @param entry_type [Symbol, :void] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # void_amount:, + # void_reason:, + # entry_type: :void, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # void_initiated_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class VoidInitiatedLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :void_initiated] + required :entry_type, const: :void_initiated + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute new_block_expiry_date + # + # @return [Time] + required :new_block_expiry_date, Time + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!attribute void_amount + # + # @return [Float] + required :void_amount, Float + + # @!attribute void_reason + # + # @return [String, nil] + required :void_reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param new_block_expiry_date [Time] + # # @param starting_balance [Float] + # # @param void_amount [Float] + # # @param void_reason [String, nil] + # # @param entry_type [Symbol, :void_initiated] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # new_block_expiry_date:, + # starting_balance:, + # void_amount:, + # void_reason:, + # entry_type: :void_initiated, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # amendment_ledger_entry => { + # id: String, + # amount: Float, + # created_at: Time, + # credit_block: Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::CreditBlock, + # currency: String, + # **_ + # } + # ``` + class AmendmentLedgerEntry < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # + # @return [Float] + required :amount, Float + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_block + # + # @return [Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::CreditBlock] + required :credit_block, + -> { Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::CreditBlock } + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::Customer] + required :customer, + -> { Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::Customer } + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # + # @return [Float] + required :ending_balance, Float + + # @!attribute entry_status + # + # @return [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::EntryStatus] + required :entry_status, + enum: -> { + Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::EntryStatus + } + + # @!attribute entry_type + # + # @return [Symbol, :amendment] + required :entry_type, const: :amendment + + # @!attribute ledger_sequence_number + # + # @return [Integer] + required :ledger_sequence_number, Integer + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute starting_balance + # + # @return [Float] + required :starting_balance, Float + + # @!parse + # # @param id [String] + # # @param amount [Float] + # # @param created_at [Time] + # # @param credit_block [Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::CreditBlock] + # # @param currency [String] + # # @param customer [Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::Customer] + # # @param description [String, nil] + # # @param ending_balance [Float] + # # @param entry_status [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::EntryStatus] + # # @param ledger_sequence_number [Integer] + # # @param metadata [Hash{Symbol=>String}] + # # @param starting_balance [Float] + # # @param entry_type [Symbol, :amendment] + # # + # def initialize( + # id:, + # amount:, + # created_at:, + # credit_block:, + # currency:, + # customer:, + # description:, + # ending_balance:, + # entry_status:, + # ledger_sequence_number:, + # metadata:, + # starting_balance:, + # entry_type: :amendment, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # credit_block => { + # id: String, + # expiry_date: Time, + # per_unit_cost_basis: String + # } + # ``` + class CreditBlock < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expiry_date + # + # @return [Time, nil] + required :expiry_date, Time, nil?: true + + # @!attribute per_unit_cost_basis + # + # @return [String, nil] + required :per_unit_cost_basis, String, nil?: true + + # @!parse + # # @param id [String] + # # @param expiry_date [Time, nil] + # # @param per_unit_cost_basis [String, nil] + # # + # def initialize(id:, expiry_date:, per_unit_cost_basis:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case entry_status + # in :committed + # # ... + # in :pending + # # ... + # end + # ``` + class EntryStatus < Orb::Enum + COMMITTED = :committed + PENDING = :pending + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb b/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb new file mode 100644 index 00000000..bd112f79 --- /dev/null +++ b/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb @@ -0,0 +1,171 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + class TopUpCreateByExternalIDParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute amount + # The amount to increment when the threshold is reached. + # + # @return [String] + required :amount, String + + # @!attribute currency + # The currency or custom pricing unit to use for this top-up. If this is a + # real-world currency, it must match the customer's invoicing currency. + # + # @return [String] + required :currency, String + + # @!attribute invoice_settings + # Settings for invoices generated by triggered top-ups. + # + # @return [Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::InvoiceSettings] + required :invoice_settings, + -> { Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::InvoiceSettings } + + # @!attribute per_unit_cost_basis + # How much, in the customer's currency, to charge for each unit. + # + # @return [String] + required :per_unit_cost_basis, String + + # @!attribute threshold + # The threshold at which to trigger the top-up. If the balance is at or below this + # threshold, the top-up will be triggered. + # + # @return [String] + required :threshold, String + + # @!attribute expires_after + # The number of days or months after which the top-up expires. If unspecified, it + # does not expire. + # + # @return [Integer, nil] + optional :expires_after, Integer, nil?: true + + # @!attribute expires_after_unit + # The unit of expires_after. + # + # @return [Symbol, Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::ExpiresAfterUnit, nil] + optional :expires_after_unit, + enum: -> { + Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::ExpiresAfterUnit + }, + nil?: true + + # @!parse + # # @param amount [String] + # # @param currency [String] + # # @param invoice_settings [Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::InvoiceSettings] + # # @param per_unit_cost_basis [String] + # # @param threshold [String] + # # @param expires_after [Integer, nil] + # # @param expires_after_unit [Symbol, Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::ExpiresAfterUnit, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # amount:, + # currency:, + # invoice_settings:, + # per_unit_cost_basis:, + # threshold:, + # expires_after: nil, + # expires_after_unit: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # invoice_settings => { + # auto_collection: Orb::BooleanModel, + # net_terms: Integer, + # memo: String, + # require_successful_payment: Orb::BooleanModel + # } + # ``` + class InvoiceSettings < Orb::BaseModel + # @!attribute auto_collection + # Whether the credits purchase invoice should auto collect with the customer's + # saved payment method. + # + # @return [Boolean] + required :auto_collection, Orb::BooleanModel + + # @!attribute net_terms + # The net terms determines the difference between the invoice date and the issue + # date for the invoice. If you intend the invoice to be due on issue, set this + # to 0. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute memo + # An optional memo to display on the invoice. + # + # @return [String, nil] + optional :memo, String, nil?: true + + # @!attribute [r] require_successful_payment + # If true, new credit blocks created by this top-up will require that the + # corresponding invoice is paid before they can be drawn down from. + # + # @return [Boolean, nil] + optional :require_successful_payment, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :require_successful_payment + + # @!parse + # # Settings for invoices generated by triggered top-ups. + # # + # # @param auto_collection [Boolean] + # # @param net_terms [Integer] + # # @param memo [String, nil] + # # @param require_successful_payment [Boolean] + # # + # def initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # The unit of expires_after. + # + # @example + # ```ruby + # case expires_after_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class ExpiresAfterUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rb b/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rb new file mode 100644 index 00000000..41a341fa --- /dev/null +++ b/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rb @@ -0,0 +1,183 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + # @example + # ```ruby + # top_up_create_by_external_id_response => { + # id: String, + # amount: String, + # currency: String, + # invoice_settings: Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::InvoiceSettings, + # per_unit_cost_basis: String, + # **_ + # } + # ``` + class TopUpCreateByExternalIDResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # The amount to increment when the threshold is reached. + # + # @return [String] + required :amount, String + + # @!attribute currency + # The currency or custom pricing unit to use for this top-up. If this is a + # real-world currency, it must match the customer's invoicing currency. + # + # @return [String] + required :currency, String + + # @!attribute invoice_settings + # Settings for invoices generated by triggered top-ups. + # + # @return [Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::InvoiceSettings] + required :invoice_settings, + -> { Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::InvoiceSettings } + + # @!attribute per_unit_cost_basis + # How much, in the customer's currency, to charge for each unit. + # + # @return [String] + required :per_unit_cost_basis, String + + # @!attribute threshold + # The threshold at which to trigger the top-up. If the balance is at or below this + # threshold, the top-up will be triggered. + # + # @return [String] + required :threshold, String + + # @!attribute expires_after + # The number of days or months after which the top-up expires. If unspecified, it + # does not expire. + # + # @return [Integer, nil] + optional :expires_after, Integer, nil?: true + + # @!attribute expires_after_unit + # The unit of expires_after. + # + # @return [Symbol, Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::ExpiresAfterUnit, nil] + optional :expires_after_unit, + enum: -> { + Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::ExpiresAfterUnit + }, + nil?: true + + # @!parse + # # @param id [String] + # # @param amount [String] + # # @param currency [String] + # # @param invoice_settings [Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::InvoiceSettings] + # # @param per_unit_cost_basis [String] + # # @param threshold [String] + # # @param expires_after [Integer, nil] + # # @param expires_after_unit [Symbol, Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::ExpiresAfterUnit, nil] + # # + # def initialize( + # id:, + # amount:, + # currency:, + # invoice_settings:, + # per_unit_cost_basis:, + # threshold:, + # expires_after: nil, + # expires_after_unit: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # invoice_settings => { + # auto_collection: Orb::BooleanModel, + # net_terms: Integer, + # memo: String, + # require_successful_payment: Orb::BooleanModel + # } + # ``` + class InvoiceSettings < Orb::BaseModel + # @!attribute auto_collection + # Whether the credits purchase invoice should auto collect with the customer's + # saved payment method. + # + # @return [Boolean] + required :auto_collection, Orb::BooleanModel + + # @!attribute net_terms + # The net terms determines the difference between the invoice date and the issue + # date for the invoice. If you intend the invoice to be due on issue, set this + # to 0. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute memo + # An optional memo to display on the invoice. + # + # @return [String, nil] + optional :memo, String, nil?: true + + # @!attribute [r] require_successful_payment + # If true, new credit blocks created by this top-up will require that the + # corresponding invoice is paid before they can be drawn down from. + # + # @return [Boolean, nil] + optional :require_successful_payment, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :require_successful_payment + + # @!parse + # # Settings for invoices generated by triggered top-ups. + # # + # # @param auto_collection [Boolean] + # # @param net_terms [Integer] + # # @param memo [String, nil] + # # @param require_successful_payment [Boolean] + # # + # def initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # The unit of expires_after. + # + # @example + # ```ruby + # case expires_after_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class ExpiresAfterUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/top_up_create_params.rb b/lib/orb/models/customers/credits/top_up_create_params.rb new file mode 100644 index 00000000..18bd2a95 --- /dev/null +++ b/lib/orb/models/customers/credits/top_up_create_params.rb @@ -0,0 +1,171 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + class TopUpCreateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute amount + # The amount to increment when the threshold is reached. + # + # @return [String] + required :amount, String + + # @!attribute currency + # The currency or custom pricing unit to use for this top-up. If this is a + # real-world currency, it must match the customer's invoicing currency. + # + # @return [String] + required :currency, String + + # @!attribute invoice_settings + # Settings for invoices generated by triggered top-ups. + # + # @return [Orb::Models::Customers::Credits::TopUpCreateParams::InvoiceSettings] + required :invoice_settings, + -> { + Orb::Models::Customers::Credits::TopUpCreateParams::InvoiceSettings + } + + # @!attribute per_unit_cost_basis + # How much, in the customer's currency, to charge for each unit. + # + # @return [String] + required :per_unit_cost_basis, String + + # @!attribute threshold + # The threshold at which to trigger the top-up. If the balance is at or below this + # threshold, the top-up will be triggered. + # + # @return [String] + required :threshold, String + + # @!attribute expires_after + # The number of days or months after which the top-up expires. If unspecified, it + # does not expire. + # + # @return [Integer, nil] + optional :expires_after, Integer, nil?: true + + # @!attribute expires_after_unit + # The unit of expires_after. + # + # @return [Symbol, Orb::Models::Customers::Credits::TopUpCreateParams::ExpiresAfterUnit, nil] + optional :expires_after_unit, + enum: -> { Orb::Models::Customers::Credits::TopUpCreateParams::ExpiresAfterUnit }, + nil?: true + + # @!parse + # # @param amount [String] + # # @param currency [String] + # # @param invoice_settings [Orb::Models::Customers::Credits::TopUpCreateParams::InvoiceSettings] + # # @param per_unit_cost_basis [String] + # # @param threshold [String] + # # @param expires_after [Integer, nil] + # # @param expires_after_unit [Symbol, Orb::Models::Customers::Credits::TopUpCreateParams::ExpiresAfterUnit, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # amount:, + # currency:, + # invoice_settings:, + # per_unit_cost_basis:, + # threshold:, + # expires_after: nil, + # expires_after_unit: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # invoice_settings => { + # auto_collection: Orb::BooleanModel, + # net_terms: Integer, + # memo: String, + # require_successful_payment: Orb::BooleanModel + # } + # ``` + class InvoiceSettings < Orb::BaseModel + # @!attribute auto_collection + # Whether the credits purchase invoice should auto collect with the customer's + # saved payment method. + # + # @return [Boolean] + required :auto_collection, Orb::BooleanModel + + # @!attribute net_terms + # The net terms determines the difference between the invoice date and the issue + # date for the invoice. If you intend the invoice to be due on issue, set this + # to 0. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute memo + # An optional memo to display on the invoice. + # + # @return [String, nil] + optional :memo, String, nil?: true + + # @!attribute [r] require_successful_payment + # If true, new credit blocks created by this top-up will require that the + # corresponding invoice is paid before they can be drawn down from. + # + # @return [Boolean, nil] + optional :require_successful_payment, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :require_successful_payment + + # @!parse + # # Settings for invoices generated by triggered top-ups. + # # + # # @param auto_collection [Boolean] + # # @param net_terms [Integer] + # # @param memo [String, nil] + # # @param require_successful_payment [Boolean] + # # + # def initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # The unit of expires_after. + # + # @example + # ```ruby + # case expires_after_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class ExpiresAfterUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/top_up_create_response.rb b/lib/orb/models/customers/credits/top_up_create_response.rb new file mode 100644 index 00000000..660a6a66 --- /dev/null +++ b/lib/orb/models/customers/credits/top_up_create_response.rb @@ -0,0 +1,183 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + # @example + # ```ruby + # top_up_create_response => { + # id: String, + # amount: String, + # currency: String, + # invoice_settings: Orb::Models::Customers::Credits::TopUpCreateResponse::InvoiceSettings, + # per_unit_cost_basis: String, + # **_ + # } + # ``` + class TopUpCreateResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # The amount to increment when the threshold is reached. + # + # @return [String] + required :amount, String + + # @!attribute currency + # The currency or custom pricing unit to use for this top-up. If this is a + # real-world currency, it must match the customer's invoicing currency. + # + # @return [String] + required :currency, String + + # @!attribute invoice_settings + # Settings for invoices generated by triggered top-ups. + # + # @return [Orb::Models::Customers::Credits::TopUpCreateResponse::InvoiceSettings] + required :invoice_settings, + -> { + Orb::Models::Customers::Credits::TopUpCreateResponse::InvoiceSettings + } + + # @!attribute per_unit_cost_basis + # How much, in the customer's currency, to charge for each unit. + # + # @return [String] + required :per_unit_cost_basis, String + + # @!attribute threshold + # The threshold at which to trigger the top-up. If the balance is at or below this + # threshold, the top-up will be triggered. + # + # @return [String] + required :threshold, String + + # @!attribute expires_after + # The number of days or months after which the top-up expires. If unspecified, it + # does not expire. + # + # @return [Integer, nil] + optional :expires_after, Integer, nil?: true + + # @!attribute expires_after_unit + # The unit of expires_after. + # + # @return [Symbol, Orb::Models::Customers::Credits::TopUpCreateResponse::ExpiresAfterUnit, nil] + optional :expires_after_unit, + enum: -> { Orb::Models::Customers::Credits::TopUpCreateResponse::ExpiresAfterUnit }, + nil?: true + + # @!parse + # # @param id [String] + # # @param amount [String] + # # @param currency [String] + # # @param invoice_settings [Orb::Models::Customers::Credits::TopUpCreateResponse::InvoiceSettings] + # # @param per_unit_cost_basis [String] + # # @param threshold [String] + # # @param expires_after [Integer, nil] + # # @param expires_after_unit [Symbol, Orb::Models::Customers::Credits::TopUpCreateResponse::ExpiresAfterUnit, nil] + # # + # def initialize( + # id:, + # amount:, + # currency:, + # invoice_settings:, + # per_unit_cost_basis:, + # threshold:, + # expires_after: nil, + # expires_after_unit: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # invoice_settings => { + # auto_collection: Orb::BooleanModel, + # net_terms: Integer, + # memo: String, + # require_successful_payment: Orb::BooleanModel + # } + # ``` + class InvoiceSettings < Orb::BaseModel + # @!attribute auto_collection + # Whether the credits purchase invoice should auto collect with the customer's + # saved payment method. + # + # @return [Boolean] + required :auto_collection, Orb::BooleanModel + + # @!attribute net_terms + # The net terms determines the difference between the invoice date and the issue + # date for the invoice. If you intend the invoice to be due on issue, set this + # to 0. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute memo + # An optional memo to display on the invoice. + # + # @return [String, nil] + optional :memo, String, nil?: true + + # @!attribute [r] require_successful_payment + # If true, new credit blocks created by this top-up will require that the + # corresponding invoice is paid before they can be drawn down from. + # + # @return [Boolean, nil] + optional :require_successful_payment, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :require_successful_payment + + # @!parse + # # Settings for invoices generated by triggered top-ups. + # # + # # @param auto_collection [Boolean] + # # @param net_terms [Integer] + # # @param memo [String, nil] + # # @param require_successful_payment [Boolean] + # # + # def initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # The unit of expires_after. + # + # @example + # ```ruby + # case expires_after_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class ExpiresAfterUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rb b/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rb new file mode 100644 index 00000000..484f85fe --- /dev/null +++ b/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + class TopUpDeleteByExternalIDParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute external_customer_id + # + # @return [String] + required :external_customer_id, String + + # @!parse + # # @param external_customer_id [String] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(external_customer_id:, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/top_up_delete_params.rb b/lib/orb/models/customers/credits/top_up_delete_params.rb new file mode 100644 index 00000000..70d7edc9 --- /dev/null +++ b/lib/orb/models/customers/credits/top_up_delete_params.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + class TopUpDeleteParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute customer_id + # + # @return [String] + required :customer_id, String + + # @!parse + # # @param customer_id [String] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(customer_id:, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rb b/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rb new file mode 100644 index 00000000..f767b827 --- /dev/null +++ b/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + class TopUpListByExternalIDParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!parse + # # @param cursor [String, nil] + # # @param limit [Integer] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(cursor: nil, limit: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rb b/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rb new file mode 100644 index 00000000..1c250982 --- /dev/null +++ b/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rb @@ -0,0 +1,183 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + # @example + # ```ruby + # top_up_list_by_external_id_response => { + # id: String, + # amount: String, + # currency: String, + # invoice_settings: Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::InvoiceSettings, + # per_unit_cost_basis: String, + # **_ + # } + # ``` + class TopUpListByExternalIDResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # The amount to increment when the threshold is reached. + # + # @return [String] + required :amount, String + + # @!attribute currency + # The currency or custom pricing unit to use for this top-up. If this is a + # real-world currency, it must match the customer's invoicing currency. + # + # @return [String] + required :currency, String + + # @!attribute invoice_settings + # Settings for invoices generated by triggered top-ups. + # + # @return [Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::InvoiceSettings] + required :invoice_settings, + -> { Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::InvoiceSettings } + + # @!attribute per_unit_cost_basis + # How much, in the customer's currency, to charge for each unit. + # + # @return [String] + required :per_unit_cost_basis, String + + # @!attribute threshold + # The threshold at which to trigger the top-up. If the balance is at or below this + # threshold, the top-up will be triggered. + # + # @return [String] + required :threshold, String + + # @!attribute expires_after + # The number of days or months after which the top-up expires. If unspecified, it + # does not expire. + # + # @return [Integer, nil] + optional :expires_after, Integer, nil?: true + + # @!attribute expires_after_unit + # The unit of expires_after. + # + # @return [Symbol, Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::ExpiresAfterUnit, nil] + optional :expires_after_unit, + enum: -> { + Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::ExpiresAfterUnit + }, + nil?: true + + # @!parse + # # @param id [String] + # # @param amount [String] + # # @param currency [String] + # # @param invoice_settings [Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::InvoiceSettings] + # # @param per_unit_cost_basis [String] + # # @param threshold [String] + # # @param expires_after [Integer, nil] + # # @param expires_after_unit [Symbol, Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::ExpiresAfterUnit, nil] + # # + # def initialize( + # id:, + # amount:, + # currency:, + # invoice_settings:, + # per_unit_cost_basis:, + # threshold:, + # expires_after: nil, + # expires_after_unit: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # invoice_settings => { + # auto_collection: Orb::BooleanModel, + # net_terms: Integer, + # memo: String, + # require_successful_payment: Orb::BooleanModel + # } + # ``` + class InvoiceSettings < Orb::BaseModel + # @!attribute auto_collection + # Whether the credits purchase invoice should auto collect with the customer's + # saved payment method. + # + # @return [Boolean] + required :auto_collection, Orb::BooleanModel + + # @!attribute net_terms + # The net terms determines the difference between the invoice date and the issue + # date for the invoice. If you intend the invoice to be due on issue, set this + # to 0. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute memo + # An optional memo to display on the invoice. + # + # @return [String, nil] + optional :memo, String, nil?: true + + # @!attribute [r] require_successful_payment + # If true, new credit blocks created by this top-up will require that the + # corresponding invoice is paid before they can be drawn down from. + # + # @return [Boolean, nil] + optional :require_successful_payment, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :require_successful_payment + + # @!parse + # # Settings for invoices generated by triggered top-ups. + # # + # # @param auto_collection [Boolean] + # # @param net_terms [Integer] + # # @param memo [String, nil] + # # @param require_successful_payment [Boolean] + # # + # def initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # The unit of expires_after. + # + # @example + # ```ruby + # case expires_after_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class ExpiresAfterUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/top_up_list_params.rb b/lib/orb/models/customers/credits/top_up_list_params.rb new file mode 100644 index 00000000..839bdfef --- /dev/null +++ b/lib/orb/models/customers/credits/top_up_list_params.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + class TopUpListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!parse + # # @param cursor [String, nil] + # # @param limit [Integer] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(cursor: nil, limit: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + end +end diff --git a/lib/orb/models/customers/credits/top_up_list_response.rb b/lib/orb/models/customers/credits/top_up_list_response.rb new file mode 100644 index 00000000..f43cb91c --- /dev/null +++ b/lib/orb/models/customers/credits/top_up_list_response.rb @@ -0,0 +1,183 @@ +# frozen_string_literal: true + +module Orb + module Models + module Customers + module Credits + # @example + # ```ruby + # top_up_list_response => { + # id: String, + # amount: String, + # currency: String, + # invoice_settings: Orb::Models::Customers::Credits::TopUpListResponse::InvoiceSettings, + # per_unit_cost_basis: String, + # **_ + # } + # ``` + class TopUpListResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # The amount to increment when the threshold is reached. + # + # @return [String] + required :amount, String + + # @!attribute currency + # The currency or custom pricing unit to use for this top-up. If this is a + # real-world currency, it must match the customer's invoicing currency. + # + # @return [String] + required :currency, String + + # @!attribute invoice_settings + # Settings for invoices generated by triggered top-ups. + # + # @return [Orb::Models::Customers::Credits::TopUpListResponse::InvoiceSettings] + required :invoice_settings, + -> { + Orb::Models::Customers::Credits::TopUpListResponse::InvoiceSettings + } + + # @!attribute per_unit_cost_basis + # How much, in the customer's currency, to charge for each unit. + # + # @return [String] + required :per_unit_cost_basis, String + + # @!attribute threshold + # The threshold at which to trigger the top-up. If the balance is at or below this + # threshold, the top-up will be triggered. + # + # @return [String] + required :threshold, String + + # @!attribute expires_after + # The number of days or months after which the top-up expires. If unspecified, it + # does not expire. + # + # @return [Integer, nil] + optional :expires_after, Integer, nil?: true + + # @!attribute expires_after_unit + # The unit of expires_after. + # + # @return [Symbol, Orb::Models::Customers::Credits::TopUpListResponse::ExpiresAfterUnit, nil] + optional :expires_after_unit, + enum: -> { Orb::Models::Customers::Credits::TopUpListResponse::ExpiresAfterUnit }, + nil?: true + + # @!parse + # # @param id [String] + # # @param amount [String] + # # @param currency [String] + # # @param invoice_settings [Orb::Models::Customers::Credits::TopUpListResponse::InvoiceSettings] + # # @param per_unit_cost_basis [String] + # # @param threshold [String] + # # @param expires_after [Integer, nil] + # # @param expires_after_unit [Symbol, Orb::Models::Customers::Credits::TopUpListResponse::ExpiresAfterUnit, nil] + # # + # def initialize( + # id:, + # amount:, + # currency:, + # invoice_settings:, + # per_unit_cost_basis:, + # threshold:, + # expires_after: nil, + # expires_after_unit: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # invoice_settings => { + # auto_collection: Orb::BooleanModel, + # net_terms: Integer, + # memo: String, + # require_successful_payment: Orb::BooleanModel + # } + # ``` + class InvoiceSettings < Orb::BaseModel + # @!attribute auto_collection + # Whether the credits purchase invoice should auto collect with the customer's + # saved payment method. + # + # @return [Boolean] + required :auto_collection, Orb::BooleanModel + + # @!attribute net_terms + # The net terms determines the difference between the invoice date and the issue + # date for the invoice. If you intend the invoice to be due on issue, set this + # to 0. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute memo + # An optional memo to display on the invoice. + # + # @return [String, nil] + optional :memo, String, nil?: true + + # @!attribute [r] require_successful_payment + # If true, new credit blocks created by this top-up will require that the + # corresponding invoice is paid before they can be drawn down from. + # + # @return [Boolean, nil] + optional :require_successful_payment, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :require_successful_payment + + # @!parse + # # Settings for invoices generated by triggered top-ups. + # # + # # @param auto_collection [Boolean] + # # @param net_terms [Integer] + # # @param memo [String, nil] + # # @param require_successful_payment [Boolean] + # # + # def initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # The unit of expires_after. + # + # @example + # ```ruby + # case expires_after_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class ExpiresAfterUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/orb/models/dimensional_price_group.rb b/lib/orb/models/dimensional_price_group.rb new file mode 100644 index 00000000..e2c44c3d --- /dev/null +++ b/lib/orb/models/dimensional_price_group.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # dimensional_price_group => { + # id: String, + # billable_metric_id: String, + # dimensions: -> { Orb::ArrayOf[String] === _1 }, + # external_dimensional_price_group_id: String, + # metadata: -> { Orb::HashOf[String] === _1 } + # } + # ``` + class DimensionalPriceGroup < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric_id + # The billable metric associated with this dimensional price group. All prices + # associated with this dimensional price group will be computed using this + # billable metric. + # + # @return [String] + required :billable_metric_id, String + + # @!attribute dimensions + # The dimensions that this dimensional price group is defined over + # + # @return [Array] + required :dimensions, Orb::ArrayOf[String] + + # @!attribute external_dimensional_price_group_id + # An alias for the dimensional price group + # + # @return [String, nil] + required :external_dimensional_price_group_id, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute name + # The name of the dimensional price group + # + # @return [String] + required :name, String + + # @!parse + # # A dimensional price group is used to partition the result of a billable metric + # # by a set of dimensions. Prices in a price group must specify the parition used + # # to derive their usage. + # # + # # @param id [String] + # # @param billable_metric_id [String] + # # @param dimensions [Array] + # # @param external_dimensional_price_group_id [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param name [String] + # # + # def initialize(id:, billable_metric_id:, dimensions:, external_dimensional_price_group_id:, metadata:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/dimensional_price_group_create_params.rb b/lib/orb/models/dimensional_price_group_create_params.rb new file mode 100644 index 00000000..f685da9b --- /dev/null +++ b/lib/orb/models/dimensional_price_group_create_params.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +module Orb + module Models + class DimensionalPriceGroupCreateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute billable_metric_id + # + # @return [String] + required :billable_metric_id, String + + # @!attribute dimensions + # The set of keys (in order) used to disambiguate prices in the group. + # + # @return [Array] + required :dimensions, Orb::ArrayOf[String] + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute external_dimensional_price_group_id + # + # @return [String, nil] + optional :external_dimensional_price_group_id, String, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param billable_metric_id [String] + # # @param dimensions [Array] + # # @param name [String] + # # @param external_dimensional_price_group_id [String, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # billable_metric_id:, + # dimensions:, + # name:, + # external_dimensional_price_group_id: nil, + # metadata: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/dimensional_price_group_list_params.rb b/lib/orb/models/dimensional_price_group_list_params.rb new file mode 100644 index 00000000..28098ccd --- /dev/null +++ b/lib/orb/models/dimensional_price_group_list_params.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Orb + module Models + class DimensionalPriceGroupListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!parse + # # @param cursor [String, nil] + # # @param limit [Integer] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(cursor: nil, limit: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/dimensional_price_group_retrieve_params.rb b/lib/orb/models/dimensional_price_group_retrieve_params.rb new file mode 100644 index 00000000..71e40f64 --- /dev/null +++ b/lib/orb/models/dimensional_price_group_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class DimensionalPriceGroupRetrieveParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/dimensional_price_groups.rb b/lib/orb/models/dimensional_price_groups.rb new file mode 100644 index 00000000..f3ca638e --- /dev/null +++ b/lib/orb/models/dimensional_price_groups.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # dimensional_price_groups_api => { + # data: -> { Orb::ArrayOf[Orb::Models::DimensionalPriceGroup] === _1 }, + # pagination_metadata: Orb::Models::PaginationMetadata + # } + # ``` + class DimensionalPriceGroupsAPI < Orb::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Orb::ArrayOf[Orb::Models::DimensionalPriceGroup] } + + # @!attribute pagination_metadata + # + # @return [Orb::Models::PaginationMetadata] + required :pagination_metadata, -> { Orb::Models::PaginationMetadata } + + # @!parse + # # @param data [Array] + # # @param pagination_metadata [Orb::Models::PaginationMetadata] + # # + # def initialize(data:, pagination_metadata:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rb b/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rb new file mode 100644 index 00000000..11b2fe97 --- /dev/null +++ b/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Orb + module Models + module DimensionalPriceGroups + class ExternalDimensionalPriceGroupIDRetrieveParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/discount.rb b/lib/orb/models/discount.rb new file mode 100644 index 00000000..9b67b575 --- /dev/null +++ b/lib/orb/models/discount.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +module Orb + module Models + # @abstract + # + # @example + # ```ruby + # case discount + # in {discount_type: "percentage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, percentage_discount: Float, reason: String} + # # Orb::Models::PercentageDiscount ... + # in {discount_type: "trial", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, reason: String, trial_amount_discount: String} + # # Orb::Models::TrialDiscount ... + # in {discount_type: "usage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, usage_discount: Float, reason: String} + # # Orb::Models::Discount::UsageDiscount ... + # in {discount_type: "amount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, reason: String} + # # Orb::Models::AmountDiscount ... + # end + # ``` + # + # @example + # ```ruby + # case discount + # in Orb::Models::PercentageDiscount + # # ... + # in Orb::Models::TrialDiscount + # # ... + # in Orb::Models::Discount::UsageDiscount + # # ... + # in Orb::Models::AmountDiscount + # # ... + # end + # ``` + class Discount < Orb::Union + discriminator :discount_type + + variant :percentage, -> { Orb::Models::PercentageDiscount } + + variant :trial, -> { Orb::Models::TrialDiscount } + + variant :usage, -> { Orb::Models::Discount::UsageDiscount } + + variant :amount, -> { Orb::Models::AmountDiscount } + + # @example + # ```ruby + # usage_discount => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :usage, + # usage_discount: Float, + # reason: String + # } + # ``` + class UsageDiscount < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this discount applies to. For plan/plan phase discounts, + # this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :usage] + required :discount_type, const: :usage + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for + # + # @return [Float] + required :usage_discount, Float + + # @!attribute reason + # + # @return [String, nil] + optional :reason, String, nil?: true + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param usage_discount [Float] + # # @param reason [String, nil] + # # @param discount_type [Symbol, :usage] + # # + # def initialize(applies_to_price_ids:, usage_discount:, reason: nil, discount_type: :usage, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/evaluate_price_group.rb b/lib/orb/models/evaluate_price_group.rb new file mode 100644 index 00000000..88f95b7a --- /dev/null +++ b/lib/orb/models/evaluate_price_group.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # evaluate_price_group => { + # amount: String, + # grouping_values: -> { Orb::ArrayOf[union: Orb::Models::EvaluatePriceGroup::GroupingValue] === _1 }, + # quantity: Float + # } + # ``` + class EvaluatePriceGroup < Orb::BaseModel + # @!attribute amount + # The price's output for the group + # + # @return [String] + required :amount, String + + # @!attribute grouping_values + # The values for the group in the order specified by `grouping_keys` + # + # @return [Array] + required :grouping_values, -> { Orb::ArrayOf[union: Orb::Models::EvaluatePriceGroup::GroupingValue] } + + # @!attribute quantity + # The price's usage quantity for the group + # + # @return [Float] + required :quantity, Float + + # @!parse + # # @param amount [String] + # # @param grouping_values [Array] + # # @param quantity [Float] + # # + # def initialize(amount:, grouping_values:, quantity:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case grouping_value + # in String + # # ... + # in Float + # # ... + # in Orb::BooleanModel + # # ... + # end + # ``` + class GroupingValue < Orb::Union + variant String + + variant Float + + variant Orb::BooleanModel + end + end + end +end diff --git a/lib/orb/models/event_deprecate_params.rb b/lib/orb/models/event_deprecate_params.rb new file mode 100644 index 00000000..54adb02b --- /dev/null +++ b/lib/orb/models/event_deprecate_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class EventDeprecateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/event_deprecate_response.rb b/lib/orb/models/event_deprecate_response.rb index b98ad8c1..c5e1b117 100644 --- a/lib/orb/models/event_deprecate_response.rb +++ b/lib/orb/models/event_deprecate_response.rb @@ -1,9 +1,26 @@ -require "orb/model" +# frozen_string_literal: true + module Orb module Models - class EventDeprecateResponse < Orb::Model - # @!attribute [rw] deprecated + # @example + # ```ruby + # event_deprecate_response => { + # deprecated: String + # } + # ``` + class EventDeprecateResponse < Orb::BaseModel + # @!attribute deprecated + # event_id of the deprecated event, if successfully updated + # + # @return [String] required :deprecated, String + + # @!parse + # # @param deprecated [String] + # # + # def initialize(deprecated:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end end end diff --git a/lib/orb/models/event_ingest_params.rb b/lib/orb/models/event_ingest_params.rb new file mode 100644 index 00000000..e508a6f9 --- /dev/null +++ b/lib/orb/models/event_ingest_params.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +module Orb + module Models + class EventIngestParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute events + # + # @return [Array] + required :events, -> { Orb::ArrayOf[Orb::Models::EventIngestParams::Event] } + + # @!attribute backfill_id + # If this ingestion request is part of a backfill, this parameter ties the + # ingested events to the backfill + # + # @return [String, nil] + optional :backfill_id, String, nil?: true + + # @!attribute [r] debug + # Flag to enable additional debug information in the endpoint response + # + # @return [Boolean, nil] + optional :debug, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :debug + + # @!parse + # # @param events [Array] + # # @param backfill_id [String, nil] + # # @param debug [Boolean] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(events:, backfill_id: nil, debug: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # event => { + # event_name: String, + # idempotency_key: String, + # properties: Orb::Unknown, + # timestamp: Time, + # customer_id: String + # } + # ``` + class Event < Orb::BaseModel + # @!attribute event_name + # A name to meaningfully identify the action or event type. + # + # @return [String] + required :event_name, String + + # @!attribute idempotency_key + # A unique value, generated by the client, that is used to de-duplicate events. + # Exactly one event with a given idempotency key will be ingested, which allows + # for safe request retries. + # + # @return [String] + required :idempotency_key, String + + # @!attribute properties + # A dictionary of custom properties. Values in this dictionary must be numeric, + # boolean, or strings. Nested dictionaries are disallowed. + # + # @return [Object] + required :properties, Orb::Unknown + + # @!attribute timestamp + # An ISO 8601 format date with no timezone offset (i.e. UTC). This should + # represent the time that usage was recorded, and is particularly important to + # attribute usage to a given billing period. + # + # @return [Time] + required :timestamp, Time + + # @!attribute customer_id + # The Orb Customer identifier + # + # @return [String, nil] + optional :customer_id, String, nil?: true + + # @!attribute external_customer_id + # An alias for the Orb customer, whose mapping is specified when creating the + # customer + # + # @return [String, nil] + optional :external_customer_id, String, nil?: true + + # @!parse + # # @param event_name [String] + # # @param idempotency_key [String] + # # @param properties [Object] + # # @param timestamp [Time] + # # @param customer_id [String, nil] + # # @param external_customer_id [String, nil] + # # + # def initialize(event_name:, idempotency_key:, properties:, timestamp:, customer_id: nil, external_customer_id: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/event_ingest_response.rb b/lib/orb/models/event_ingest_response.rb index 6076bb20..42ed412f 100644 --- a/lib/orb/models/event_ingest_response.rb +++ b/lib/orb/models/event_ingest_response.rb @@ -1,23 +1,96 @@ -require "orb/model" +# frozen_string_literal: true + module Orb module Models - class EventIngestResponse < Orb::Model - class ValidationFailed < Orb::Model - # @!attribute [rw] idempotency_key + # @example + # ```ruby + # event_ingest_response => { + # validation_failed: -> { Orb::ArrayOf[Orb::Models::EventIngestResponse::ValidationFailed] === _1 }, + # debug: Orb::Models::EventIngestResponse::Debug + # } + # ``` + class EventIngestResponse < Orb::BaseModel + # @!attribute validation_failed + # Contains all failing validation events. In the case of a 200, this array will + # always be empty. This field will always be present. + # + # @return [Array] + required :validation_failed, -> { Orb::ArrayOf[Orb::Models::EventIngestResponse::ValidationFailed] } + + # @!attribute debug + # Optional debug information (only present when debug=true is passed to the + # endpoint). Contains ingested and duplicate event idempotency keys. + # + # @return [Orb::Models::EventIngestResponse::Debug, nil] + optional :debug, -> { Orb::Models::EventIngestResponse::Debug }, nil?: true + + # @!parse + # # @param validation_failed [Array] + # # @param debug [Orb::Models::EventIngestResponse::Debug, nil] + # # + # def initialize(validation_failed:, debug: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # validation_failed => { + # idempotency_key: String, + # validation_errors: -> { Orb::ArrayOf[String] === _1 } + # } + # ``` + class ValidationFailed < Orb::BaseModel + # @!attribute idempotency_key + # The passed idempotency_key corresponding to the validation_errors + # + # @return [String] required :idempotency_key, String - # @!attribute [rw] validation_errors - required :validation_errors, Orb::ArrayOf.new(String) + + # @!attribute validation_errors + # An array of strings corresponding to validation failures for this + # idempotency_key. + # + # @return [Array] + required :validation_errors, Orb::ArrayOf[String] + + # @!parse + # # @param idempotency_key [String] + # # @param validation_errors [Array] + # # + # def initialize(idempotency_key:, validation_errors:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class Debug < Orb::Model - # @!attribute [rw] duplicate - required :duplicate, Orb::ArrayOf.new(String) - # @!attribute [rw] ingested - required :ingested, Orb::ArrayOf.new(String) + + # @example + # ```ruby + # debug => { + # duplicate: -> { Orb::ArrayOf[String] === _1 }, + # ingested: -> { Orb::ArrayOf[String] === _1 } + # } + # ``` + class Debug < Orb::BaseModel + # @!attribute duplicate + # + # @return [Array] + required :duplicate, Orb::ArrayOf[String] + + # @!attribute ingested + # + # @return [Array] + required :ingested, Orb::ArrayOf[String] + + # @!parse + # # Optional debug information (only present when debug=true is passed to the + # # endpoint). Contains ingested and duplicate event idempotency keys. + # # + # # @param duplicate [Array] + # # @param ingested [Array] + # # + # def initialize(duplicate:, ingested:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - # @!attribute [rw] validation_failed - required :validation_failed, Orb::ArrayOf.new(ValidationFailed) - # @!attribute [rw] debug - optional :debug, Debug end end end diff --git a/lib/orb/models/event_search_params.rb b/lib/orb/models/event_search_params.rb new file mode 100644 index 00000000..ff7139fa --- /dev/null +++ b/lib/orb/models/event_search_params.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Orb + module Models + class EventSearchParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute event_ids + # This is an explicit array of IDs to filter by. Note that an event's ID is the + # idempotency_key that was originally used for ingestion, and this only supports + # events that have not been amended. Values in this array will be treated case + # sensitively. + # + # @return [Array] + required :event_ids, Orb::ArrayOf[String] + + # @!attribute timeframe_end + # The end of the timeframe, exclusive, in which to search events. If not + # specified, the current time is used. + # + # @return [Time, nil] + optional :timeframe_end, Time, nil?: true + + # @!attribute timeframe_start + # The start of the timeframe, inclusive, in which to search events. If not + # specified, the one week ago is used. + # + # @return [Time, nil] + optional :timeframe_start, Time, nil?: true + + # @!parse + # # @param event_ids [Array] + # # @param timeframe_end [Time, nil] + # # @param timeframe_start [Time, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(event_ids:, timeframe_end: nil, timeframe_start: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/event_search_response.rb b/lib/orb/models/event_search_response.rb index 8fc13335..6a5d1e4e 100644 --- a/lib/orb/models/event_search_response.rb +++ b/lib/orb/models/event_search_response.rb @@ -1,23 +1,103 @@ -require "orb/model" +# frozen_string_literal: true + module Orb module Models - class EventSearchResponse < Orb::Model - class Data < Orb::Model - # @!attribute [rw] id + # @example + # ```ruby + # event_search_response => { + # data: -> { Orb::ArrayOf[Orb::Models::EventSearchResponse::Data] === _1 } + # } + # ``` + class EventSearchResponse < Orb::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Orb::ArrayOf[Orb::Models::EventSearchResponse::Data] } + + # @!parse + # # @param data [Array] + # # + # def initialize(data:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # data => { + # id: String, + # customer_id: String, + # deprecated: Orb::BooleanModel, + # event_name: String, + # external_customer_id: String, + # **_ + # } + # ``` + class Data < Orb::BaseModel + # @!attribute id + # A unique value, generated by the client, that is used to de-duplicate events. + # Exactly one event with a given idempotency key will be ingested, which allows + # for safe request retries. + # + # @return [String] required :id, String - # @!attribute [rw] customer_id - required :customer_id, String - # @!attribute [rw] event_name + + # @!attribute customer_id + # The Orb Customer identifier + # + # @return [String, nil] + required :customer_id, String, nil?: true + + # @!attribute deprecated + # A boolean indicating whether the event is currently deprecated. + # + # @return [Boolean] + required :deprecated, Orb::BooleanModel + + # @!attribute event_name + # A name to meaningfully identify the action or event type. + # + # @return [String] required :event_name, String - # @!attribute [rw] external_customer_id - required :external_customer_id, String - # @!attribute [rw] properties + + # @!attribute external_customer_id + # An alias for the Orb customer, whose mapping is specified when creating the + # customer + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!attribute properties + # A dictionary of custom properties. Values in this dictionary must be numeric, + # boolean, or strings. Nested dictionaries are disallowed. + # + # @return [Object] required :properties, Orb::Unknown - # @!attribute [rw] timestamp - required :timestamp, String + + # @!attribute timestamp + # An ISO 8601 format date with no timezone offset (i.e. UTC). This should + # represent the time that usage was recorded, and is particularly important to + # attribute usage to a given billing period. + # + # @return [Time] + required :timestamp, Time + + # @!parse + # # The [Event](/core-concepts#event) resource represents a usage event that has + # # been created for a customer. Events are the core of Orb's usage-based billing + # # model, and are used to calculate the usage charges for a given billing period. + # # + # # @param id [String] + # # @param customer_id [String, nil] + # # @param deprecated [Boolean] + # # @param event_name [String] + # # @param external_customer_id [String, nil] + # # @param properties [Object] + # # @param timestamp [Time] + # # + # def initialize(id:, customer_id:, deprecated:, event_name:, external_customer_id:, properties:, timestamp:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - # @!attribute [rw] data - required :data, Orb::ArrayOf.new(Data) end end end diff --git a/lib/orb/models/event_update_params.rb b/lib/orb/models/event_update_params.rb new file mode 100644 index 00000000..93fc13da --- /dev/null +++ b/lib/orb/models/event_update_params.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module Orb + module Models + class EventUpdateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute event_name + # A name to meaningfully identify the action or event type. + # + # @return [String] + required :event_name, String + + # @!attribute properties + # A dictionary of custom properties. Values in this dictionary must be numeric, + # boolean, or strings. Nested dictionaries are disallowed. + # + # @return [Object] + required :properties, Orb::Unknown + + # @!attribute timestamp + # An ISO 8601 format date with no timezone offset (i.e. UTC). This should + # represent the time that usage was recorded, and is particularly important to + # attribute usage to a given billing period. + # + # @return [Time] + required :timestamp, Time + + # @!attribute customer_id + # The Orb Customer identifier + # + # @return [String, nil] + optional :customer_id, String, nil?: true + + # @!attribute external_customer_id + # An alias for the Orb customer, whose mapping is specified when creating the + # customer + # + # @return [String, nil] + optional :external_customer_id, String, nil?: true + + # @!parse + # # @param event_name [String] + # # @param properties [Object] + # # @param timestamp [Time] + # # @param customer_id [String, nil] + # # @param external_customer_id [String, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(event_name:, properties:, timestamp:, customer_id: nil, external_customer_id: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/event_update_response.rb b/lib/orb/models/event_update_response.rb index 264edada..ab3056e1 100644 --- a/lib/orb/models/event_update_response.rb +++ b/lib/orb/models/event_update_response.rb @@ -1,9 +1,26 @@ -require "orb/model" +# frozen_string_literal: true + module Orb module Models - class EventUpdateResponse < Orb::Model - # @!attribute [rw] amended + # @example + # ```ruby + # event_update_response => { + # amended: String + # } + # ``` + class EventUpdateResponse < Orb::BaseModel + # @!attribute amended + # event_id of the amended event, if successfully ingested + # + # @return [String] required :amended, String + + # @!parse + # # @param amended [String] + # # + # def initialize(amended:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end end end diff --git a/lib/orb/models/events/backfill_close_params.rb b/lib/orb/models/events/backfill_close_params.rb new file mode 100644 index 00000000..d0c7beb1 --- /dev/null +++ b/lib/orb/models/events/backfill_close_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Orb + module Models + module Events + class BackfillCloseParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/events/backfill_close_response.rb b/lib/orb/models/events/backfill_close_response.rb new file mode 100644 index 00000000..5a36d105 --- /dev/null +++ b/lib/orb/models/events/backfill_close_response.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +module Orb + module Models + module Events + # @example + # ```ruby + # backfill_close_response => { + # id: String, + # close_time: Time, + # created_at: Time, + # customer_id: String, + # events_ingested: Integer, + # **_ + # } + # ``` + class BackfillCloseResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute close_time + # If in the future, the time at which the backfill will automatically close. If in + # the past, the time at which the backfill was closed. + # + # @return [Time, nil] + required :close_time, Time, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute customer_id + # The Orb-generated ID of the customer to which this backfill is scoped. If + # `null`, this backfill is scoped to all customers. + # + # @return [String, nil] + required :customer_id, String, nil?: true + + # @!attribute events_ingested + # The number of events ingested in this backfill. + # + # @return [Integer] + required :events_ingested, Integer + + # @!attribute reverted_at + # The time at which this backfill was reverted. + # + # @return [Time, nil] + required :reverted_at, Time, nil?: true + + # @!attribute status + # The status of the backfill. + # + # @return [Symbol, Orb::Models::Events::BackfillCloseResponse::Status] + required :status, enum: -> { Orb::Models::Events::BackfillCloseResponse::Status } + + # @!attribute timeframe_end + # + # @return [Time] + required :timeframe_end, Time + + # @!attribute timeframe_start + # + # @return [Time] + required :timeframe_start, Time + + # @!attribute deprecation_filter + # A boolean + # [computed property](/extensibility/advanced-metrics#computed-properties) used to + # filter the set of events to deprecate + # + # @return [String, nil] + optional :deprecation_filter, String, nil?: true + + # @!parse + # # A backfill represents an update to historical usage data, adding or replacing + # # events in a timeframe. + # # + # # @param id [String] + # # @param close_time [Time, nil] + # # @param created_at [Time] + # # @param customer_id [String, nil] + # # @param events_ingested [Integer] + # # @param reverted_at [Time, nil] + # # @param status [Symbol, Orb::Models::Events::BackfillCloseResponse::Status] + # # @param timeframe_end [Time] + # # @param timeframe_start [Time] + # # @param deprecation_filter [String, nil] + # # + # def initialize( + # id:, + # close_time:, + # created_at:, + # customer_id:, + # events_ingested:, + # reverted_at:, + # status:, + # timeframe_end:, + # timeframe_start:, + # deprecation_filter: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The status of the backfill. + # + # @example + # ```ruby + # case status + # in :pending + # # ... + # in :reflected + # # ... + # in :pending_revert + # # ... + # in :reverted + # # ... + # end + # ``` + class Status < Orb::Enum + PENDING = :pending + REFLECTED = :reflected + PENDING_REVERT = :pending_revert + REVERTED = :reverted + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/events/backfill_create_params.rb b/lib/orb/models/events/backfill_create_params.rb new file mode 100644 index 00000000..e7ea0494 --- /dev/null +++ b/lib/orb/models/events/backfill_create_params.rb @@ -0,0 +1,92 @@ +# frozen_string_literal: true + +module Orb + module Models + module Events + class BackfillCreateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute timeframe_end + # The (exclusive) end of the usage timeframe affected by this backfill. + # + # @return [Time] + required :timeframe_end, Time + + # @!attribute timeframe_start + # The (inclusive) start of the usage timeframe affected by this backfill. + # + # @return [Time] + required :timeframe_start, Time + + # @!attribute close_time + # The time at which no more events will be accepted for this backfill. The + # backfill will automatically begin reflecting throughout Orb at the close time. + # If not specified, it will default to 1 day after the creation of the backfill. + # + # @return [Time, nil] + optional :close_time, Time, nil?: true + + # @!attribute customer_id + # The Orb-generated ID of the customer to which this backfill is scoped. Omitting + # this field will scope the backfill to all customers. + # + # @return [String, nil] + optional :customer_id, String, nil?: true + + # @!attribute deprecation_filter + # A boolean + # [computed property](/extensibility/advanced-metrics#computed-properties) used to + # filter the set of events to deprecate + # + # @return [String, nil] + optional :deprecation_filter, String, nil?: true + + # @!attribute external_customer_id + # The external customer ID of the customer to which this backfill is scoped. + # Omitting this field will scope the backfill to all customers. + # + # @return [String, nil] + optional :external_customer_id, String, nil?: true + + # @!attribute [r] replace_existing_events + # If true, replaces all existing events in the timeframe with the newly ingested + # events. If false, adds the newly ingested events to the existing events. + # + # @return [Boolean, nil] + optional :replace_existing_events, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :replace_existing_events + + # @!parse + # # @param timeframe_end [Time] + # # @param timeframe_start [Time] + # # @param close_time [Time, nil] + # # @param customer_id [String, nil] + # # @param deprecation_filter [String, nil] + # # @param external_customer_id [String, nil] + # # @param replace_existing_events [Boolean] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # timeframe_end:, + # timeframe_start:, + # close_time: nil, + # customer_id: nil, + # deprecation_filter: nil, + # external_customer_id: nil, + # replace_existing_events: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/events/backfill_create_response.rb b/lib/orb/models/events/backfill_create_response.rb new file mode 100644 index 00000000..7bc67a70 --- /dev/null +++ b/lib/orb/models/events/backfill_create_response.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +module Orb + module Models + module Events + # @example + # ```ruby + # backfill_create_response => { + # id: String, + # close_time: Time, + # created_at: Time, + # customer_id: String, + # events_ingested: Integer, + # **_ + # } + # ``` + class BackfillCreateResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute close_time + # If in the future, the time at which the backfill will automatically close. If in + # the past, the time at which the backfill was closed. + # + # @return [Time, nil] + required :close_time, Time, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute customer_id + # The Orb-generated ID of the customer to which this backfill is scoped. If + # `null`, this backfill is scoped to all customers. + # + # @return [String, nil] + required :customer_id, String, nil?: true + + # @!attribute events_ingested + # The number of events ingested in this backfill. + # + # @return [Integer] + required :events_ingested, Integer + + # @!attribute reverted_at + # The time at which this backfill was reverted. + # + # @return [Time, nil] + required :reverted_at, Time, nil?: true + + # @!attribute status + # The status of the backfill. + # + # @return [Symbol, Orb::Models::Events::BackfillCreateResponse::Status] + required :status, enum: -> { Orb::Models::Events::BackfillCreateResponse::Status } + + # @!attribute timeframe_end + # + # @return [Time] + required :timeframe_end, Time + + # @!attribute timeframe_start + # + # @return [Time] + required :timeframe_start, Time + + # @!attribute deprecation_filter + # A boolean + # [computed property](/extensibility/advanced-metrics#computed-properties) used to + # filter the set of events to deprecate + # + # @return [String, nil] + optional :deprecation_filter, String, nil?: true + + # @!parse + # # A backfill represents an update to historical usage data, adding or replacing + # # events in a timeframe. + # # + # # @param id [String] + # # @param close_time [Time, nil] + # # @param created_at [Time] + # # @param customer_id [String, nil] + # # @param events_ingested [Integer] + # # @param reverted_at [Time, nil] + # # @param status [Symbol, Orb::Models::Events::BackfillCreateResponse::Status] + # # @param timeframe_end [Time] + # # @param timeframe_start [Time] + # # @param deprecation_filter [String, nil] + # # + # def initialize( + # id:, + # close_time:, + # created_at:, + # customer_id:, + # events_ingested:, + # reverted_at:, + # status:, + # timeframe_end:, + # timeframe_start:, + # deprecation_filter: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The status of the backfill. + # + # @example + # ```ruby + # case status + # in :pending + # # ... + # in :reflected + # # ... + # in :pending_revert + # # ... + # in :reverted + # # ... + # end + # ``` + class Status < Orb::Enum + PENDING = :pending + REFLECTED = :reflected + PENDING_REVERT = :pending_revert + REVERTED = :reverted + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/events/backfill_fetch_params.rb b/lib/orb/models/events/backfill_fetch_params.rb new file mode 100644 index 00000000..22782154 --- /dev/null +++ b/lib/orb/models/events/backfill_fetch_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Orb + module Models + module Events + class BackfillFetchParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/events/backfill_fetch_response.rb b/lib/orb/models/events/backfill_fetch_response.rb new file mode 100644 index 00000000..f280666e --- /dev/null +++ b/lib/orb/models/events/backfill_fetch_response.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +module Orb + module Models + module Events + # @example + # ```ruby + # backfill_fetch_response => { + # id: String, + # close_time: Time, + # created_at: Time, + # customer_id: String, + # events_ingested: Integer, + # **_ + # } + # ``` + class BackfillFetchResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute close_time + # If in the future, the time at which the backfill will automatically close. If in + # the past, the time at which the backfill was closed. + # + # @return [Time, nil] + required :close_time, Time, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute customer_id + # The Orb-generated ID of the customer to which this backfill is scoped. If + # `null`, this backfill is scoped to all customers. + # + # @return [String, nil] + required :customer_id, String, nil?: true + + # @!attribute events_ingested + # The number of events ingested in this backfill. + # + # @return [Integer] + required :events_ingested, Integer + + # @!attribute reverted_at + # The time at which this backfill was reverted. + # + # @return [Time, nil] + required :reverted_at, Time, nil?: true + + # @!attribute status + # The status of the backfill. + # + # @return [Symbol, Orb::Models::Events::BackfillFetchResponse::Status] + required :status, enum: -> { Orb::Models::Events::BackfillFetchResponse::Status } + + # @!attribute timeframe_end + # + # @return [Time] + required :timeframe_end, Time + + # @!attribute timeframe_start + # + # @return [Time] + required :timeframe_start, Time + + # @!attribute deprecation_filter + # A boolean + # [computed property](/extensibility/advanced-metrics#computed-properties) used to + # filter the set of events to deprecate + # + # @return [String, nil] + optional :deprecation_filter, String, nil?: true + + # @!parse + # # A backfill represents an update to historical usage data, adding or replacing + # # events in a timeframe. + # # + # # @param id [String] + # # @param close_time [Time, nil] + # # @param created_at [Time] + # # @param customer_id [String, nil] + # # @param events_ingested [Integer] + # # @param reverted_at [Time, nil] + # # @param status [Symbol, Orb::Models::Events::BackfillFetchResponse::Status] + # # @param timeframe_end [Time] + # # @param timeframe_start [Time] + # # @param deprecation_filter [String, nil] + # # + # def initialize( + # id:, + # close_time:, + # created_at:, + # customer_id:, + # events_ingested:, + # reverted_at:, + # status:, + # timeframe_end:, + # timeframe_start:, + # deprecation_filter: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The status of the backfill. + # + # @example + # ```ruby + # case status + # in :pending + # # ... + # in :reflected + # # ... + # in :pending_revert + # # ... + # in :reverted + # # ... + # end + # ``` + class Status < Orb::Enum + PENDING = :pending + REFLECTED = :reflected + PENDING_REVERT = :pending_revert + REVERTED = :reverted + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/events/backfill_list_params.rb b/lib/orb/models/events/backfill_list_params.rb new file mode 100644 index 00000000..99fd84c5 --- /dev/null +++ b/lib/orb/models/events/backfill_list_params.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Orb + module Models + module Events + class BackfillListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!parse + # # @param cursor [String, nil] + # # @param limit [Integer] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(cursor: nil, limit: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/events/backfill_list_response.rb b/lib/orb/models/events/backfill_list_response.rb new file mode 100644 index 00000000..ef14a1eb --- /dev/null +++ b/lib/orb/models/events/backfill_list_response.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +module Orb + module Models + module Events + # @example + # ```ruby + # backfill_list_response => { + # id: String, + # close_time: Time, + # created_at: Time, + # customer_id: String, + # events_ingested: Integer, + # **_ + # } + # ``` + class BackfillListResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute close_time + # If in the future, the time at which the backfill will automatically close. If in + # the past, the time at which the backfill was closed. + # + # @return [Time, nil] + required :close_time, Time, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute customer_id + # The Orb-generated ID of the customer to which this backfill is scoped. If + # `null`, this backfill is scoped to all customers. + # + # @return [String, nil] + required :customer_id, String, nil?: true + + # @!attribute events_ingested + # The number of events ingested in this backfill. + # + # @return [Integer] + required :events_ingested, Integer + + # @!attribute reverted_at + # The time at which this backfill was reverted. + # + # @return [Time, nil] + required :reverted_at, Time, nil?: true + + # @!attribute status + # The status of the backfill. + # + # @return [Symbol, Orb::Models::Events::BackfillListResponse::Status] + required :status, enum: -> { Orb::Models::Events::BackfillListResponse::Status } + + # @!attribute timeframe_end + # + # @return [Time] + required :timeframe_end, Time + + # @!attribute timeframe_start + # + # @return [Time] + required :timeframe_start, Time + + # @!attribute deprecation_filter + # A boolean + # [computed property](/extensibility/advanced-metrics#computed-properties) used to + # filter the set of events to deprecate + # + # @return [String, nil] + optional :deprecation_filter, String, nil?: true + + # @!parse + # # A backfill represents an update to historical usage data, adding or replacing + # # events in a timeframe. + # # + # # @param id [String] + # # @param close_time [Time, nil] + # # @param created_at [Time] + # # @param customer_id [String, nil] + # # @param events_ingested [Integer] + # # @param reverted_at [Time, nil] + # # @param status [Symbol, Orb::Models::Events::BackfillListResponse::Status] + # # @param timeframe_end [Time] + # # @param timeframe_start [Time] + # # @param deprecation_filter [String, nil] + # # + # def initialize( + # id:, + # close_time:, + # created_at:, + # customer_id:, + # events_ingested:, + # reverted_at:, + # status:, + # timeframe_end:, + # timeframe_start:, + # deprecation_filter: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The status of the backfill. + # + # @example + # ```ruby + # case status + # in :pending + # # ... + # in :reflected + # # ... + # in :pending_revert + # # ... + # in :reverted + # # ... + # end + # ``` + class Status < Orb::Enum + PENDING = :pending + REFLECTED = :reflected + PENDING_REVERT = :pending_revert + REVERTED = :reverted + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/events/backfill_revert_params.rb b/lib/orb/models/events/backfill_revert_params.rb new file mode 100644 index 00000000..86bfec9c --- /dev/null +++ b/lib/orb/models/events/backfill_revert_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Orb + module Models + module Events + class BackfillRevertParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/events/backfill_revert_response.rb b/lib/orb/models/events/backfill_revert_response.rb new file mode 100644 index 00000000..f5e21288 --- /dev/null +++ b/lib/orb/models/events/backfill_revert_response.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +module Orb + module Models + module Events + # @example + # ```ruby + # backfill_revert_response => { + # id: String, + # close_time: Time, + # created_at: Time, + # customer_id: String, + # events_ingested: Integer, + # **_ + # } + # ``` + class BackfillRevertResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute close_time + # If in the future, the time at which the backfill will automatically close. If in + # the past, the time at which the backfill was closed. + # + # @return [Time, nil] + required :close_time, Time, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute customer_id + # The Orb-generated ID of the customer to which this backfill is scoped. If + # `null`, this backfill is scoped to all customers. + # + # @return [String, nil] + required :customer_id, String, nil?: true + + # @!attribute events_ingested + # The number of events ingested in this backfill. + # + # @return [Integer] + required :events_ingested, Integer + + # @!attribute reverted_at + # The time at which this backfill was reverted. + # + # @return [Time, nil] + required :reverted_at, Time, nil?: true + + # @!attribute status + # The status of the backfill. + # + # @return [Symbol, Orb::Models::Events::BackfillRevertResponse::Status] + required :status, enum: -> { Orb::Models::Events::BackfillRevertResponse::Status } + + # @!attribute timeframe_end + # + # @return [Time] + required :timeframe_end, Time + + # @!attribute timeframe_start + # + # @return [Time] + required :timeframe_start, Time + + # @!attribute deprecation_filter + # A boolean + # [computed property](/extensibility/advanced-metrics#computed-properties) used to + # filter the set of events to deprecate + # + # @return [String, nil] + optional :deprecation_filter, String, nil?: true + + # @!parse + # # A backfill represents an update to historical usage data, adding or replacing + # # events in a timeframe. + # # + # # @param id [String] + # # @param close_time [Time, nil] + # # @param created_at [Time] + # # @param customer_id [String, nil] + # # @param events_ingested [Integer] + # # @param reverted_at [Time, nil] + # # @param status [Symbol, Orb::Models::Events::BackfillRevertResponse::Status] + # # @param timeframe_end [Time] + # # @param timeframe_start [Time] + # # @param deprecation_filter [String, nil] + # # + # def initialize( + # id:, + # close_time:, + # created_at:, + # customer_id:, + # events_ingested:, + # reverted_at:, + # status:, + # timeframe_end:, + # timeframe_start:, + # deprecation_filter: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The status of the backfill. + # + # @example + # ```ruby + # case status + # in :pending + # # ... + # in :reflected + # # ... + # in :pending_revert + # # ... + # in :reverted + # # ... + # end + # ``` + class Status < Orb::Enum + PENDING = :pending + REFLECTED = :reflected + PENDING_REVERT = :pending_revert + REVERTED = :reverted + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/events/event_volumes.rb b/lib/orb/models/events/event_volumes.rb new file mode 100644 index 00000000..a65cf9b1 --- /dev/null +++ b/lib/orb/models/events/event_volumes.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +module Orb + module Models + module Events + # @example + # ```ruby + # event_volumes => { + # data: -> { Orb::ArrayOf[Orb::Models::Events::EventVolumes::Data] === _1 } + # } + # ``` + class EventVolumes < Orb::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Orb::ArrayOf[Orb::Models::Events::EventVolumes::Data] } + + # @!parse + # # @param data [Array] + # # + # def initialize(data:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # data => { + # count: Integer, + # timeframe_end: Time, + # timeframe_start: Time + # } + # ``` + class Data < Orb::BaseModel + # @!attribute count + # The number of events ingested with a timestamp between the timeframe + # + # @return [Integer] + required :count, Integer + + # @!attribute timeframe_end + # + # @return [Time] + required :timeframe_end, Time + + # @!attribute timeframe_start + # + # @return [Time] + required :timeframe_start, Time + + # @!parse + # # An EventVolume contains the event volume ingested in an hourly window. The + # # timestamp used for the aggregation is the `timestamp` datetime field on events. + # # + # # @param count [Integer] + # # @param timeframe_end [Time] + # # @param timeframe_start [Time] + # # + # def initialize(count:, timeframe_end:, timeframe_start:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + EventVolumes = Events::EventVolumes + end +end diff --git a/lib/orb/models/events/volume_list_params.rb b/lib/orb/models/events/volume_list_params.rb new file mode 100644 index 00000000..54c5df07 --- /dev/null +++ b/lib/orb/models/events/volume_list_params.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +module Orb + module Models + module Events + class VolumeListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute timeframe_start + # The start of the timeframe, inclusive, in which to return event volume. All + # datetime values are converted to UTC time. If the specified time isn't + # hour-aligned, the response includes the event volume count for the hour the time + # falls in. + # + # @return [Time] + required :timeframe_start, Time + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!attribute [r] timeframe_end + # The end of the timeframe, exclusive, in which to return event volume. If not + # specified, the current time is used. All datetime values are converted to UTC + # time.If the specified time isn't hour-aligned, the response includes the event + # volumecount for the hour the time falls in. + # + # @return [Time, nil] + optional :timeframe_end, Time + + # @!parse + # # @return [Time] + # attr_writer :timeframe_end + + # @!parse + # # @param timeframe_start [Time] + # # @param cursor [String, nil] + # # @param limit [Integer] + # # @param timeframe_end [Time] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(timeframe_start:, cursor: nil, limit: nil, timeframe_end: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/invoice.rb b/lib/orb/models/invoice.rb index e008b900..cb2617ef 100644 --- a/lib/orb/models/invoice.rb +++ b/lib/orb/models/invoice.rb @@ -1,382 +1,2594 @@ -require "orb/model" +# frozen_string_literal: true + module Orb module Models - class Invoice < Orb::Model - class AutoCollection < Orb::Model - # @!attribute [rw] enabled - required :enabled, Orb::BooleanModel - # @!attribute [rw] next_attempt_at - required :next_attempt_at, String - # @!attribute [rw] previously_attempted_at - required :previously_attempted_at, String + # @example + # ```ruby + # invoice => { + # id: String, + # amount_due: String, + # auto_collection: Orb::Models::Invoice::AutoCollection, + # billing_address: Orb::Models::Invoice::BillingAddress, + # created_at: Time, + # **_ + # } + # ``` + class Invoice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount_due + # This is the final amount required to be charged to the customer and reflects the + # application of the customer balance to the `total` of the invoice. + # + # @return [String] + required :amount_due, String + + # @!attribute auto_collection + # + # @return [Orb::Models::Invoice::AutoCollection] + required :auto_collection, -> { Orb::Models::Invoice::AutoCollection } + + # @!attribute billing_address + # + # @return [Orb::Models::Invoice::BillingAddress, nil] + required :billing_address, -> { Orb::Models::Invoice::BillingAddress }, nil?: true + + # @!attribute created_at + # The creation time of the resource in Orb. + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_notes + # A list of credit notes associated with the invoice + # + # @return [Array] + required :credit_notes, -> { Orb::ArrayOf[Orb::Models::Invoice::CreditNote] } + + # @!attribute currency + # An ISO 4217 currency string or `credits` + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::Invoice::Customer] + required :customer, -> { Orb::Models::Invoice::Customer } + + # @!attribute customer_balance_transactions + # + # @return [Array] + required :customer_balance_transactions, + -> { Orb::ArrayOf[Orb::Models::Invoice::CustomerBalanceTransaction] } + + # @!attribute customer_tax_id + # Tax IDs are commonly required to be displayed on customer invoices, which are + # added to the headers of invoices. + # + # ### Supported Tax ID Countries and Types + # + # | Country | Type | Description | + # | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # | Andorra | `ad_nrt` | Andorran NRT Number | + # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # | Austria | `eu_vat` | European VAT Number | + # | Bahrain | `bh_vat` | Bahraini VAT Number | + # | Belgium | `eu_vat` | European VAT Number | + # | Bolivia | `bo_tin` | Bolivian Tax ID | + # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # | Brazil | `br_cpf` | Brazilian CPF Number | + # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # | Bulgaria | `eu_vat` | European VAT Number | + # | Canada | `ca_bn` | Canadian BN | + # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # | Chile | `cl_tin` | Chilean TIN | + # | China | `cn_tin` | Chinese Tax ID | + # | Colombia | `co_nit` | Colombian NIT Number | + # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # | Croatia | `eu_vat` | European VAT Number | + # | Cyprus | `eu_vat` | European VAT Number | + # | Czech Republic | `eu_vat` | European VAT Number | + # | Denmark | `eu_vat` | European VAT Number | + # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # | Estonia | `eu_vat` | European VAT Number | + # | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # | Finland | `eu_vat` | European VAT Number | + # | France | `eu_vat` | European VAT Number | + # | Georgia | `ge_vat` | Georgian VAT | + # | Germany | `eu_vat` | European VAT Number | + # | Greece | `eu_vat` | European VAT Number | + # | Hong Kong | `hk_br` | Hong Kong BR Number | + # | Hungary | `eu_vat` | European VAT Number | + # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # | Iceland | `is_vat` | Icelandic VAT | + # | India | `in_gst` | Indian GST Number | + # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # | Ireland | `eu_vat` | European VAT Number | + # | Israel | `il_vat` | Israel VAT | + # | Italy | `eu_vat` | European VAT Number | + # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # | Latvia | `eu_vat` | European VAT Number | + # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # | Lithuania | `eu_vat` | European VAT Number | + # | Luxembourg | `eu_vat` | European VAT Number | + # | Malaysia | `my_frp` | Malaysian FRP Number | + # | Malaysia | `my_itn` | Malaysian ITN | + # | Malaysia | `my_sst` | Malaysian SST Number | + # | Malta | `eu_vat ` | European VAT Number | + # | Mexico | `mx_rfc` | Mexican RFC Number | + # | Netherlands | `eu_vat` | European VAT Number | + # | New Zealand | `nz_gst` | New Zealand GST Number | + # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # | Norway | `no_vat` | Norwegian VAT Number | + # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # | Oman | `om_vat` | Omani VAT Number | + # | Peru | `pe_ruc` | Peruvian RUC Number | + # | Philippines | `ph_tin ` | Philippines Tax Identification Number | + # | Poland | `eu_vat` | European VAT Number | + # | Portugal | `eu_vat` | European VAT Number | + # | Romania | `eu_vat` | European VAT Number | + # | Romania | `ro_tin` | Romanian Tax ID Number | + # | Russia | `ru_inn` | Russian INN | + # | Russia | `ru_kpp` | Russian KPP | + # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # | Serbia | `rs_pib` | Serbian PIB Number | + # | Singapore | `sg_gst` | Singaporean GST | + # | Singapore | `sg_uen` | Singaporean UEN | + # | Slovakia | `eu_vat` | European VAT Number | + # | Slovenia | `eu_vat` | European VAT Number | + # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # | South Africa | `za_vat` | South African VAT Number | + # | South Korea | `kr_brn` | Korean BRN | + # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # | Spain | `eu_vat` | European VAT Number | + # | Sweden | `eu_vat` | European VAT Number | + # | Switzerland | `ch_vat` | Switzerland VAT Number | + # | Taiwan | `tw_vat` | Taiwanese VAT | + # | Thailand | `th_vat` | Thai VAT | + # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # | Ukraine | `ua_vat` | Ukrainian VAT | + # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # | United States | `us_ein` | United States EIN | + # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # + # @return [Orb::Models::Invoice::CustomerTaxID, nil] + required :customer_tax_id, -> { Orb::Models::Invoice::CustomerTaxID }, nil?: true + + # @!attribute discount + # This field is deprecated in favor of `discounts`. If a `discounts` list is + # provided, the first discount in the list will be returned. If the list is empty, + # `None` will be returned. + # + # @return [Object] + required :discount, Orb::Unknown + + # @!attribute discounts + # + # @return [Array] + required :discounts, -> { Orb::ArrayOf[union: Orb::Models::InvoiceLevelDiscount] } + + # @!attribute due_date + # When the invoice payment is due. The due date is null if the invoice is not yet + # finalized. + # + # @return [Time, nil] + required :due_date, Time, nil?: true + + # @!attribute eligible_to_issue_at + # If the invoice has a status of `draft`, this will be the time that the invoice + # will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is + # true, the invoice will automatically begin issuing at this time. + # + # @return [Time, nil] + required :eligible_to_issue_at, Time, nil?: true + + # @!attribute hosted_invoice_url + # A URL for the customer-facing invoice portal. This URL expires 30 days after the + # invoice's due date, or 60 days after being re-generated through the UI. + # + # @return [String, nil] + required :hosted_invoice_url, String, nil?: true + + # @!attribute invoice_date + # The scheduled date of the invoice + # + # @return [Time] + required :invoice_date, Time + + # @!attribute invoice_number + # Automatically generated invoice number to help track and reconcile invoices. + # Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per + # account or customer. + # + # @return [String] + required :invoice_number, String + + # @!attribute invoice_pdf + # The link to download the PDF representation of the `Invoice`. + # + # @return [String, nil] + required :invoice_pdf, String, nil?: true + + # @!attribute invoice_source + # + # @return [Symbol, Orb::Models::Invoice::InvoiceSource] + required :invoice_source, enum: -> { Orb::Models::Invoice::InvoiceSource } + + # @!attribute issue_failed_at + # If the invoice failed to issue, this will be the last time it failed to issue + # (even if it is now in a different state.) + # + # @return [Time, nil] + required :issue_failed_at, Time, nil?: true + + # @!attribute issued_at + # If the invoice has been issued, this will be the time it transitioned to + # `issued` (even if it is now in a different state.) + # + # @return [Time, nil] + required :issued_at, Time, nil?: true + + # @!attribute line_items + # The breakdown of prices in this invoice. + # + # @return [Array] + required :line_items, -> { Orb::ArrayOf[Orb::Models::Invoice::LineItem] } + + # @!attribute maximum + # + # @return [Orb::Models::Invoice::Maximum, nil] + required :maximum, -> { Orb::Models::Invoice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute memo + # Free-form text which is available on the invoice PDF and the Orb invoice portal. + # + # @return [String, nil] + required :memo, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Invoice::Minimum, nil] + required :minimum, -> { Orb::Models::Invoice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute paid_at + # If the invoice has a status of `paid`, this gives a timestamp when the invoice + # was paid. + # + # @return [Time, nil] + required :paid_at, Time, nil?: true + + # @!attribute payment_attempts + # A list of payment attempts associated with the invoice + # + # @return [Array] + required :payment_attempts, -> { Orb::ArrayOf[Orb::Models::Invoice::PaymentAttempt] } + + # @!attribute payment_failed_at + # If payment was attempted on this invoice but failed, this will be the time of + # the most recent attempt. + # + # @return [Time, nil] + required :payment_failed_at, Time, nil?: true + + # @!attribute payment_started_at + # If payment was attempted on this invoice, this will be the start time of the + # most recent attempt. This field is especially useful for delayed-notification + # payment mechanisms (like bank transfers), where payment can take 3 days or more. + # + # @return [Time, nil] + required :payment_started_at, Time, nil?: true + + # @!attribute scheduled_issue_at + # If the invoice is in draft, this timestamp will reflect when the invoice is + # scheduled to be issued. + # + # @return [Time, nil] + required :scheduled_issue_at, Time, nil?: true + + # @!attribute shipping_address + # + # @return [Orb::Models::Invoice::ShippingAddress, nil] + required :shipping_address, -> { Orb::Models::Invoice::ShippingAddress }, nil?: true + + # @!attribute status + # + # @return [Symbol, Orb::Models::Invoice::Status] + required :status, enum: -> { Orb::Models::Invoice::Status } + + # @!attribute subscription + # + # @return [Orb::Models::Invoice::Subscription, nil] + required :subscription, -> { Orb::Models::Invoice::Subscription }, nil?: true + + # @!attribute subtotal + # The total before any discounts and minimums are applied. + # + # @return [String] + required :subtotal, String + + # @!attribute sync_failed_at + # If the invoice failed to sync, this will be the last time an external invoicing + # provider sync was attempted. This field will always be `null` for invoices using + # Orb Invoicing. + # + # @return [Time, nil] + required :sync_failed_at, Time, nil?: true + + # @!attribute total + # The total after any minimums and discounts have been applied. + # + # @return [String] + required :total, String + + # @!attribute voided_at + # If the invoice has a status of `void`, this gives a timestamp when the invoice + # was voided. + # + # @return [Time, nil] + required :voided_at, Time, nil?: true + + # @!attribute will_auto_issue + # This is true if the invoice will be automatically issued in the future, and + # false otherwise. + # + # @return [Boolean] + required :will_auto_issue, Orb::BooleanModel + + # @!parse + # # An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, + # # representing the request for payment for a single subscription. This includes a + # # set of line items, which correspond to prices in the subscription's plan and can + # # represent fixed recurring fees or usage-based fees. They are generated at the + # # end of a billing period, or as the result of an action, such as a cancellation. + # # + # # @param id [String] + # # @param amount_due [String] + # # @param auto_collection [Orb::Models::Invoice::AutoCollection] + # # @param billing_address [Orb::Models::Invoice::BillingAddress, nil] + # # @param created_at [Time] + # # @param credit_notes [Array] + # # @param currency [String] + # # @param customer [Orb::Models::Invoice::Customer] + # # @param customer_balance_transactions [Array] + # # @param customer_tax_id [Orb::Models::Invoice::CustomerTaxID, nil] + # # @param discount [Object] + # # @param discounts [Array] + # # @param due_date [Time, nil] + # # @param eligible_to_issue_at [Time, nil] + # # @param hosted_invoice_url [String, nil] + # # @param invoice_date [Time] + # # @param invoice_number [String] + # # @param invoice_pdf [String, nil] + # # @param invoice_source [Symbol, Orb::Models::Invoice::InvoiceSource] + # # @param issue_failed_at [Time, nil] + # # @param issued_at [Time, nil] + # # @param line_items [Array] + # # @param maximum [Orb::Models::Invoice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param memo [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Invoice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param paid_at [Time, nil] + # # @param payment_attempts [Array] + # # @param payment_failed_at [Time, nil] + # # @param payment_started_at [Time, nil] + # # @param scheduled_issue_at [Time, nil] + # # @param shipping_address [Orb::Models::Invoice::ShippingAddress, nil] + # # @param status [Symbol, Orb::Models::Invoice::Status] + # # @param subscription [Orb::Models::Invoice::Subscription, nil] + # # @param subtotal [String] + # # @param sync_failed_at [Time, nil] + # # @param total [String] + # # @param voided_at [Time, nil] + # # @param will_auto_issue [Boolean] + # # + # def initialize( + # id:, + # amount_due:, + # auto_collection:, + # billing_address:, + # created_at:, + # credit_notes:, + # currency:, + # customer:, + # customer_balance_transactions:, + # customer_tax_id:, + # discount:, + # discounts:, + # due_date:, + # eligible_to_issue_at:, + # hosted_invoice_url:, + # invoice_date:, + # invoice_number:, + # invoice_pdf:, + # invoice_source:, + # issue_failed_at:, + # issued_at:, + # line_items:, + # maximum:, + # maximum_amount:, + # memo:, + # metadata:, + # minimum:, + # minimum_amount:, + # paid_at:, + # payment_attempts:, + # payment_failed_at:, + # payment_started_at:, + # scheduled_issue_at:, + # shipping_address:, + # status:, + # subscription:, + # subtotal:, + # sync_failed_at:, + # total:, + # voided_at:, + # will_auto_issue:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # auto_collection => { + # enabled: Orb::BooleanModel, + # next_attempt_at: Time, + # num_attempts: Integer, + # previously_attempted_at: Time + # } + # ``` + class AutoCollection < Orb::BaseModel + # @!attribute enabled + # True only if auto-collection is enabled for this invoice. + # + # @return [Boolean, nil] + required :enabled, Orb::BooleanModel, nil?: true + + # @!attribute next_attempt_at + # If the invoice is scheduled for auto-collection, this field will reflect when + # the next attempt will occur. If dunning has been exhausted, or auto-collection + # is not enabled for this invoice, this field will be `null`. + # + # @return [Time, nil] + required :next_attempt_at, Time, nil?: true + + # @!attribute num_attempts + # Number of auto-collection payment attempts. + # + # @return [Integer, nil] + required :num_attempts, Integer, nil?: true + + # @!attribute previously_attempted_at + # If Orb has ever attempted payment auto-collection for this invoice, this field + # will reflect when that attempt occurred. In conjunction with `next_attempt_at`, + # this can be used to tell whether the invoice is currently in dunning (that is, + # `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or + # if dunning has been exhausted (`previously_attempted_at` is non-null, but + # `next_attempt_time` is null). + # + # @return [Time, nil] + required :previously_attempted_at, Time, nil?: true + + # @!parse + # # @param enabled [Boolean, nil] + # # @param next_attempt_at [Time, nil] + # # @param num_attempts [Integer, nil] + # # @param previously_attempted_at [Time, nil] + # # + # def initialize(enabled:, next_attempt_at:, num_attempts:, previously_attempted_at:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class BillingAddress < Orb::Model - # @!attribute [rw] city - required :city, String - # @!attribute [rw] country - required :country, String - # @!attribute [rw] line1 - required :line1, String - # @!attribute [rw] line2 - required :line2, String - # @!attribute [rw] postal_code - required :postal_code, String - # @!attribute [rw] state - required :state, String + + # @example + # ```ruby + # billing_address => { + # city: String, + # country: String, + # line1: String, + # line2: String, + # postal_code: String + # } + # ``` + class BillingAddress < Orb::BaseModel + # @!attribute city + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute line1 + # + # @return [String, nil] + required :line1, String, nil?: true + + # @!attribute line2 + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute postal_code + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # + # @return [String, nil] + required :state, String, nil?: true + + # @!parse + # # @param city [String, nil] + # # @param country [String, nil] + # # @param line1 [String, nil] + # # @param line2 [String, nil] + # # @param postal_code [String, nil] + # # @param state [String, nil] + # # + # def initialize(city:, country:, line1:, line2:, postal_code:, state:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class CreditNotes < Orb::Model - # @!attribute [rw] id + + # @example + # ```ruby + # credit_note => { + # id: String, + # credit_note_number: String, + # memo: String, + # reason: String, + # total: String, + # **_ + # } + # ``` + class CreditNote < Orb::BaseModel + # @!attribute id + # + # @return [String] required :id, String - # @!attribute [rw] credit_note_number + + # @!attribute credit_note_number + # + # @return [String] required :credit_note_number, String - # @!attribute [rw] reason + + # @!attribute memo + # An optional memo supplied on the credit note. + # + # @return [String, nil] + required :memo, String, nil?: true + + # @!attribute reason + # + # @return [String] required :reason, String - # @!attribute [rw] total + + # @!attribute total + # + # @return [String] required :total, String - # @!attribute [rw] type + + # @!attribute type + # + # @return [String] required :type, String - # @!attribute [rw] voided_at - required :voided_at, String + + # @!attribute voided_at + # If the credit note has a status of `void`, this gives a timestamp when the + # credit note was voided. + # + # @return [Time, nil] + required :voided_at, Time, nil?: true + + # @!parse + # # @param id [String] + # # @param credit_note_number [String] + # # @param memo [String, nil] + # # @param reason [String] + # # @param total [String] + # # @param type [String] + # # @param voided_at [Time, nil] + # # + # def initialize(id:, credit_note_number:, memo:, reason:, total:, type:, voided_at:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class Customer < Orb::Model - # @!attribute [rw] id + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] required :id, String - # @!attribute [rw] external_customer_id - required :external_customer_id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class CustomerBalanceTransactions < Orb::Model - class CreditNote < Orb::Model - # @!attribute [rw] id - required :id, String - end - class Invoice < Orb::Model - # @!attribute [rw] id - required :id, String - end - # @!attribute [rw] id + + # @example + # ```ruby + # customer_balance_transaction => { + # id: String, + # action: Orb::Models::Invoice::CustomerBalanceTransaction::Action, + # amount: String, + # created_at: Time, + # credit_note: Orb::Models::Invoice::CustomerBalanceTransaction::CreditNote, + # **_ + # } + # ``` + class CustomerBalanceTransaction < Orb::BaseModel + # @!attribute id + # A unique id for this transaction. + # + # @return [String] required :id, String - # @!attribute [rw] action - required :action, - Orb::Enum.new( - [ - :"applied_to_invoice", - :"manual_adjustment", - :"prorated_refund", - :"revert_prorated_refund", - :"return_from_voiding", - :"credit_note_applied", - :"credit_note_voided", - :"overpayment_refund" - ] - ) - # @!attribute [rw] amount + + # @!attribute action + # + # @return [Symbol, Orb::Models::Invoice::CustomerBalanceTransaction::Action] + required :action, enum: -> { Orb::Models::Invoice::CustomerBalanceTransaction::Action } + + # @!attribute amount + # The value of the amount changed in the transaction. + # + # @return [String] required :amount, String - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] credit_note - required :credit_note, CreditNote - # @!attribute [rw] description - required :description, String - # @!attribute [rw] ending_balance + + # @!attribute created_at + # The creation time of this transaction. + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_note + # + # @return [Orb::Models::Invoice::CustomerBalanceTransaction::CreditNote, nil] + required :credit_note, -> { Orb::Models::Invoice::CustomerBalanceTransaction::CreditNote }, nil?: true + + # @!attribute description + # An optional description provided for manual customer balance adjustments. + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # The new value of the customer's balance prior to the transaction, in the + # customer's currency. + # + # @return [String] required :ending_balance, String - # @!attribute [rw] invoice - required :invoice, Invoice - # @!attribute [rw] starting_balance + + # @!attribute invoice + # + # @return [Orb::Models::Invoice::CustomerBalanceTransaction::Invoice, nil] + required :invoice, -> { Orb::Models::Invoice::CustomerBalanceTransaction::Invoice }, nil?: true + + # @!attribute starting_balance + # The original value of the customer's balance prior to the transaction, in the + # customer's currency. + # + # @return [String] required :starting_balance, String - # @!attribute [rw] type - required :type, Orb::Enum.new([:"increment", :"decrement"]) + + # @!attribute type + # + # @return [Symbol, Orb::Models::Invoice::CustomerBalanceTransaction::Type] + required :type, enum: -> { Orb::Models::Invoice::CustomerBalanceTransaction::Type } + + # @!parse + # # @param id [String] + # # @param action [Symbol, Orb::Models::Invoice::CustomerBalanceTransaction::Action] + # # @param amount [String] + # # @param created_at [Time] + # # @param credit_note [Orb::Models::Invoice::CustomerBalanceTransaction::CreditNote, nil] + # # @param description [String, nil] + # # @param ending_balance [String] + # # @param invoice [Orb::Models::Invoice::CustomerBalanceTransaction::Invoice, nil] + # # @param starting_balance [String] + # # @param type [Symbol, Orb::Models::Invoice::CustomerBalanceTransaction::Type] + # # + # def initialize( + # id:, + # action:, + # amount:, + # created_at:, + # credit_note:, + # description:, + # ending_balance:, + # invoice:, + # starting_balance:, + # type:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case action + # in :applied_to_invoice + # # ... + # in :manual_adjustment + # # ... + # in :prorated_refund + # # ... + # in :revert_prorated_refund + # # ... + # in :return_from_voiding + # # ... + # in ... + # #... + # end + # ``` + class Action < Orb::Enum + APPLIED_TO_INVOICE = :applied_to_invoice + MANUAL_ADJUSTMENT = :manual_adjustment + PRORATED_REFUND = :prorated_refund + REVERT_PRORATED_REFUND = :revert_prorated_refund + RETURN_FROM_VOIDING = :return_from_voiding + CREDIT_NOTE_APPLIED = :credit_note_applied + CREDIT_NOTE_VOIDED = :credit_note_voided + OVERPAYMENT_REFUND = :overpayment_refund + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_note => { + # id: String + # } + # ``` + class CreditNote < Orb::BaseModel + # @!attribute id + # The id of the Credit note + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoice => { + # id: String + # } + # ``` + class Invoice < Orb::BaseModel + # @!attribute id + # The Invoice id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case type + # in :increment + # # ... + # in :decrement + # # ... + # end + # ``` + class Type < Orb::Enum + INCREMENT = :increment + DECREMENT = :decrement + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end end - class CustomerTaxID < Orb::Model - # @!attribute [rw] country - required :country, - Orb::Enum.new( - [ - :"AE", - :"AT", - :"AU", - :"BE", - :"BG", - :"BR", - :"CA", - :"CH", - :"CL", - :"CY", - :"CZ", - :"DE", - :"DK", - :"EE", - :"EG", - :"ES", - :"EU", - :"FI", - :"FR", - :"GB", - :"GE", - :"GR", - :"HK", - :"HR", - :"HU", - :"ID", - :"IE", - :"IL", - :"IN", - :"IS", - :"IT", - :"JP", - :"KE", - :"KR", - :"LI", - :"LT", - :"LU", - :"LV", - :"MT", - :"MX", - :"MY", - :"NL", - :"NO", - :"NZ", - :"PH", - :"PL", - :"PT", - :"RO", - :"RU", - :"SA", - :"SE", - :"SG", - :"SI", - :"SK", - :"TH", - :"TR", - :"TW", - :"UA", - :"US", - :"ZA" - ] - ) - # @!attribute [rw] type - required :type, - Orb::Enum.new( - [ - :"ae_trn", - :"eu_vat", - :"au_abn", - :"au_arn", - :"bg_uic", - :"br_cnpj", - :"br_cpf", - :"ca_bn", - :"ca_gst_hst", - :"ca_pst_bc", - :"ca_pst_mb", - :"ca_pst_sk", - :"ca_qst", - :"ch_vat", - :"cl_tin", - :"eg_tin", - :"es_cif", - :"eu_oss_vat", - :"gb_vat", - :"ge_vat", - :"hk_br", - :"hu_tin", - :"id_npwp", - :"il_vat", - :"in_gst", - :"is_vat", - :"jp_cn", - :"jp_rn", - :"jp_trn", - :"ke_pin", - :"kr_brn", - :"li_uid", - :"mx_rfc", - :"my_frp", - :"my_itn", - :"my_sst", - :"no_vat", - :"nz_gst", - :"ph_tin", - :"ru_inn", - :"ru_kpp", - :"sa_vat", - :"sg_gst", - :"sg_uen", - :"si_tin", - :"th_vat", - :"tr_tin", - :"tw_vat", - :"ua_vat", - :"us_ein", - :"za_vat" - ] - ) - # @!attribute [rw] value + + # @example + # ```ruby + # customer_tax_id => { + # country: Orb::Models::Invoice::CustomerTaxID::Country, + # type: Orb::Models::Invoice::CustomerTaxID::Type, + # value: String + # } + # ``` + class CustomerTaxID < Orb::BaseModel + # @!attribute country + # + # @return [Symbol, Orb::Models::Invoice::CustomerTaxID::Country] + required :country, enum: -> { Orb::Models::Invoice::CustomerTaxID::Country } + + # @!attribute type + # + # @return [Symbol, Orb::Models::Invoice::CustomerTaxID::Type] + required :type, enum: -> { Orb::Models::Invoice::CustomerTaxID::Type } + + # @!attribute value + # + # @return [String] required :value, String + + # @!parse + # # Tax IDs are commonly required to be displayed on customer invoices, which are + # # added to the headers of invoices. + # # + # # ### Supported Tax ID Countries and Types + # # + # # | Country | Type | Description | + # # | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # # | Andorra | `ad_nrt` | Andorran NRT Number | + # # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # # | Austria | `eu_vat` | European VAT Number | + # # | Bahrain | `bh_vat` | Bahraini VAT Number | + # # | Belgium | `eu_vat` | European VAT Number | + # # | Bolivia | `bo_tin` | Bolivian Tax ID | + # # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # # | Brazil | `br_cpf` | Brazilian CPF Number | + # # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # # | Bulgaria | `eu_vat` | European VAT Number | + # # | Canada | `ca_bn` | Canadian BN | + # # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # # | Chile | `cl_tin` | Chilean TIN | + # # | China | `cn_tin` | Chinese Tax ID | + # # | Colombia | `co_nit` | Colombian NIT Number | + # # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # # | Croatia | `eu_vat` | European VAT Number | + # # | Cyprus | `eu_vat` | European VAT Number | + # # | Czech Republic | `eu_vat` | European VAT Number | + # # | Denmark | `eu_vat` | European VAT Number | + # # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # # | Estonia | `eu_vat` | European VAT Number | + # # | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # # | Finland | `eu_vat` | European VAT Number | + # # | France | `eu_vat` | European VAT Number | + # # | Georgia | `ge_vat` | Georgian VAT | + # # | Germany | `eu_vat` | European VAT Number | + # # | Greece | `eu_vat` | European VAT Number | + # # | Hong Kong | `hk_br` | Hong Kong BR Number | + # # | Hungary | `eu_vat` | European VAT Number | + # # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # # | Iceland | `is_vat` | Icelandic VAT | + # # | India | `in_gst` | Indian GST Number | + # # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # # | Ireland | `eu_vat` | European VAT Number | + # # | Israel | `il_vat` | Israel VAT | + # # | Italy | `eu_vat` | European VAT Number | + # # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # # | Latvia | `eu_vat` | European VAT Number | + # # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # # | Lithuania | `eu_vat` | European VAT Number | + # # | Luxembourg | `eu_vat` | European VAT Number | + # # | Malaysia | `my_frp` | Malaysian FRP Number | + # # | Malaysia | `my_itn` | Malaysian ITN | + # # | Malaysia | `my_sst` | Malaysian SST Number | + # # | Malta | `eu_vat ` | European VAT Number | + # # | Mexico | `mx_rfc` | Mexican RFC Number | + # # | Netherlands | `eu_vat` | European VAT Number | + # # | New Zealand | `nz_gst` | New Zealand GST Number | + # # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # # | Norway | `no_vat` | Norwegian VAT Number | + # # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # # | Oman | `om_vat` | Omani VAT Number | + # # | Peru | `pe_ruc` | Peruvian RUC Number | + # # | Philippines | `ph_tin ` | Philippines Tax Identification Number | + # # | Poland | `eu_vat` | European VAT Number | + # # | Portugal | `eu_vat` | European VAT Number | + # # | Romania | `eu_vat` | European VAT Number | + # # | Romania | `ro_tin` | Romanian Tax ID Number | + # # | Russia | `ru_inn` | Russian INN | + # # | Russia | `ru_kpp` | Russian KPP | + # # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # # | Serbia | `rs_pib` | Serbian PIB Number | + # # | Singapore | `sg_gst` | Singaporean GST | + # # | Singapore | `sg_uen` | Singaporean UEN | + # # | Slovakia | `eu_vat` | European VAT Number | + # # | Slovenia | `eu_vat` | European VAT Number | + # # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # # | South Africa | `za_vat` | South African VAT Number | + # # | South Korea | `kr_brn` | Korean BRN | + # # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # # | Spain | `eu_vat` | European VAT Number | + # # | Sweden | `eu_vat` | European VAT Number | + # # | Switzerland | `ch_vat` | Switzerland VAT Number | + # # | Taiwan | `tw_vat` | Taiwanese VAT | + # # | Thailand | `th_vat` | Thai VAT | + # # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # # | Ukraine | `ua_vat` | Ukrainian VAT | + # # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # # | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + # # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # # | United States | `us_ein` | United States EIN | + # # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # # + # # @param country [Symbol, Orb::Models::Invoice::CustomerTaxID::Country] + # # @param type [Symbol, Orb::Models::Invoice::CustomerTaxID::Type] + # # @param value [String] + # # + # def initialize(country:, type:, value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case country + # in :AD + # # ... + # in :AE + # # ... + # in :AR + # # ... + # in :AT + # # ... + # in :AU + # # ... + # in ... + # #... + # end + # ``` + class Country < Orb::Enum + AD = :AD + AE = :AE + AR = :AR + AT = :AT + AU = :AU + BE = :BE + BG = :BG + BH = :BH + BO = :BO + BR = :BR + CA = :CA + CH = :CH + CL = :CL + CN = :CN + CO = :CO + CR = :CR + CY = :CY + CZ = :CZ + DE = :DE + DK = :DK + EE = :EE + DO = :DO + EC = :EC + EG = :EG + ES = :ES + EU = :EU + FI = :FI + FR = :FR + GB = :GB + GE = :GE + GR = :GR + HK = :HK + HR = :HR + HU = :HU + ID = :ID + IE = :IE + IL = :IL + IN = :IN + IS = :IS + IT = :IT + JP = :JP + KE = :KE + KR = :KR + KZ = :KZ + LI = :LI + LT = :LT + LU = :LU + LV = :LV + MT = :MT + MX = :MX + MY = :MY + NG = :NG + NL = :NL + NO = :NO + NZ = :NZ + OM = :OM + PE = :PE + PH = :PH + PL = :PL + PT = :PT + RO = :RO + RS = :RS + RU = :RU + SA = :SA + SE = :SE + SG = :SG + SI = :SI + SK = :SK + SV = :SV + TH = :TH + TR = :TR + TW = :TW + UA = :UA + US = :US + UY = :UY + VE = :VE + VN = :VN + ZA = :ZA + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # @example + # ```ruby + # case type + # in :ad_nrt + # # ... + # in :ae_trn + # # ... + # in :ar_cuit + # # ... + # in :eu_vat + # # ... + # in :au_abn + # # ... + # in ... + # #... + # end + # ``` + class Type < Orb::Enum + AD_NRT = :ad_nrt + AE_TRN = :ae_trn + AR_CUIT = :ar_cuit + EU_VAT = :eu_vat + AU_ABN = :au_abn + AU_ARN = :au_arn + BG_UIC = :bg_uic + BH_VAT = :bh_vat + BO_TIN = :bo_tin + BR_CNPJ = :br_cnpj + BR_CPF = :br_cpf + CA_BN = :ca_bn + CA_GST_HST = :ca_gst_hst + CA_PST_BC = :ca_pst_bc + CA_PST_MB = :ca_pst_mb + CA_PST_SK = :ca_pst_sk + CA_QST = :ca_qst + CH_VAT = :ch_vat + CL_TIN = :cl_tin + CN_TIN = :cn_tin + CO_NIT = :co_nit + CR_TIN = :cr_tin + DO_RCN = :do_rcn + EC_RUC = :ec_ruc + EG_TIN = :eg_tin + ES_CIF = :es_cif + EU_OSS_VAT = :eu_oss_vat + GB_VAT = :gb_vat + GE_VAT = :ge_vat + HK_BR = :hk_br + HU_TIN = :hu_tin + ID_NPWP = :id_npwp + IL_VAT = :il_vat + IN_GST = :in_gst + IS_VAT = :is_vat + JP_CN = :jp_cn + JP_RN = :jp_rn + JP_TRN = :jp_trn + KE_PIN = :ke_pin + KR_BRN = :kr_brn + KZ_BIN = :kz_bin + LI_UID = :li_uid + MX_RFC = :mx_rfc + MY_FRP = :my_frp + MY_ITN = :my_itn + MY_SST = :my_sst + NG_TIN = :ng_tin + NO_VAT = :no_vat + NO_VOEC = :no_voec + NZ_GST = :nz_gst + OM_VAT = :om_vat + PE_RUC = :pe_ruc + PH_TIN = :ph_tin + RO_TIN = :ro_tin + RS_PIB = :rs_pib + RU_INN = :ru_inn + RU_KPP = :ru_kpp + SA_VAT = :sa_vat + SG_GST = :sg_gst + SG_UEN = :sg_uen + SI_TIN = :si_tin + SV_NIT = :sv_nit + TH_VAT = :th_vat + TR_TIN = :tr_tin + TW_VAT = :tw_vat + UA_VAT = :ua_vat + US_EIN = :us_ein + UY_RUC = :uy_ruc + VE_RIF = :ve_rif + VN_TIN = :vn_tin + ZA_VAT = :za_vat + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end end - class LineItems < Orb::Model - class Maximum < Orb::Model - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] maximum_amount + + # @abstract + # + # @example + # ```ruby + # case invoice_source + # in :subscription + # # ... + # in :partial + # # ... + # in :one_off + # # ... + # end + # ``` + class InvoiceSource < Orb::Enum + SUBSCRIPTION = :subscription + PARTIAL = :partial + ONE_OFF = :one_off + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # line_item => { + # id: String, + # adjusted_subtotal: String, + # adjustments: -> { Orb::ArrayOf[union: Orb::Models::Invoice::LineItem::Adjustment] === _1 }, + # amount: String, + # credits_applied: String, + # **_ + # } + # ``` + class LineItem < Orb::BaseModel + # @!attribute id + # A unique ID for this line item. + # + # @return [String] + required :id, String + + # @!attribute adjusted_subtotal + # The line amount after any adjustments, before overage conversion, credits and + # partial invoicing. + # + # @return [String] + required :adjusted_subtotal, String + + # @!attribute adjustments + # All adjustments applied to the line item. + # + # @return [Array] + required :adjustments, -> { Orb::ArrayOf[union: Orb::Models::Invoice::LineItem::Adjustment] } + + # @!attribute amount + # The final amount after any discounts or minimums. + # + # @return [String] + required :amount, String + + # @!attribute credits_applied + # The number of credits used + # + # @return [String] + required :credits_applied, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute end_date + # The end date of the range of time applied for this line item's price. + # + # @return [Time] + required :end_date, Time + + # @!attribute grouping + # [DEPRECATED] For configured prices that are split by a grouping key, this will + # be populated with the key and a value. The `amount` and `subtotal` will be the + # values for this particular grouping. + # + # @return [String, nil] + required :grouping, String, nil?: true + + # @!attribute maximum + # This field is deprecated in favor of `adjustments`. + # + # @return [Orb::Models::Invoice::LineItem::Maximum, nil] + required :maximum, -> { Orb::Models::Invoice::LineItem::Maximum }, nil?: true + + # @!attribute maximum_amount + # This field is deprecated in favor of `adjustments`. + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute minimum + # This field is deprecated in favor of `adjustments`. + # + # @return [Orb::Models::Invoice::LineItem::Minimum, nil] + required :minimum, -> { Orb::Models::Invoice::LineItem::Minimum }, nil?: true + + # @!attribute minimum_amount + # This field is deprecated in favor of `adjustments`. + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute name + # The name of the price associated with this line item. + # + # @return [String] + required :name, String + + # @!attribute partially_invoiced_amount + # Any amount applied from a partial invoice + # + # @return [String] + required :partially_invoiced_amount, String + + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice, nil] + required :price, union: -> { Orb::Models::Price }, nil?: true + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute start_date + # The start date of the range of time applied for this line item's price. + # + # @return [Time] + required :start_date, Time + + # @!attribute sub_line_items + # For complex pricing structures, the line item can be broken down further in + # `sub_line_items`. + # + # @return [Array] + required :sub_line_items, -> { Orb::ArrayOf[union: Orb::Models::Invoice::LineItem::SubLineItem] } + + # @!attribute subtotal + # The line amount before any line item-specific discounts or minimums. + # + # @return [String] + required :subtotal, String + + # @!attribute tax_amounts + # An array of tax rates and their incurred tax amounts. Empty if no tax + # integration is configured. + # + # @return [Array] + required :tax_amounts, -> { Orb::ArrayOf[Orb::Models::Invoice::LineItem::TaxAmount] } + + # @!parse + # # @param id [String] + # # @param adjusted_subtotal [String] + # # @param adjustments [Array] + # # @param amount [String] + # # @param credits_applied [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param end_date [Time] + # # @param grouping [String, nil] + # # @param maximum [Orb::Models::Invoice::LineItem::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param minimum [Orb::Models::Invoice::LineItem::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param partially_invoiced_amount [String] + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice, nil] + # # @param quantity [Float] + # # @param start_date [Time] + # # @param sub_line_items [Array] + # # @param subtotal [String] + # # @param tax_amounts [Array] + # # + # def initialize( + # id:, + # adjusted_subtotal:, + # adjustments:, + # amount:, + # credits_applied:, + # discount:, + # end_date:, + # grouping:, + # maximum:, + # maximum_amount:, + # minimum:, + # minimum_amount:, + # name:, + # partially_invoiced_amount:, + # price:, + # quantity:, + # start_date:, + # sub_line_items:, + # subtotal:, + # tax_amounts:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "amount_discount", id: String, amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::Invoice::LineItem::Adjustment::AmountDiscountAdjustment ... + # in {adjustment_type: "percentage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::Invoice::LineItem::Adjustment::PercentageDiscountAdjustment ... + # in {adjustment_type: "usage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::Invoice::LineItem::Adjustment::UsageDiscountAdjustment ... + # in {adjustment_type: "minimum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::Invoice::LineItem::Adjustment::MinimumAdjustment ... + # in {adjustment_type: "maximum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::Invoice::LineItem::Adjustment::MaximumAdjustment ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::Invoice::LineItem::Adjustment::AmountDiscountAdjustment + # # ... + # in Orb::Models::Invoice::LineItem::Adjustment::PercentageDiscountAdjustment + # # ... + # in Orb::Models::Invoice::LineItem::Adjustment::UsageDiscountAdjustment + # # ... + # in Orb::Models::Invoice::LineItem::Adjustment::MinimumAdjustment + # # ... + # in Orb::Models::Invoice::LineItem::Adjustment::MaximumAdjustment + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :amount_discount, + -> { + Orb::Models::Invoice::LineItem::Adjustment::AmountDiscountAdjustment + } + + variant :percentage_discount, + -> { Orb::Models::Invoice::LineItem::Adjustment::PercentageDiscountAdjustment } + + variant :usage_discount, -> { Orb::Models::Invoice::LineItem::Adjustment::UsageDiscountAdjustment } + + variant :minimum, -> { Orb::Models::Invoice::LineItem::Adjustment::MinimumAdjustment } + + variant :maximum, -> { Orb::Models::Invoice::LineItem::Adjustment::MaximumAdjustment } + + # @example + # ```ruby + # amount_discount_adjustment => { + # id: String, + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # **_ + # } + # ``` + class AmountDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # The amount by which to discount the prices this adjustment applies to in a given + # billing period. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize( + # id:, + # amount_discount:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # adjustment_type: :amount_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_adjustment => { + # id: String, + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # percentage_discount: Float, + # **_ + # } + # ``` + class PercentageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute percentage_discount + # The percentage (as a value between 0 and 1) by which to discount the price + # intervals this adjustment applies to in a given billing period. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param percentage_discount [Float] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # percentage_discount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_adjustment => { + # id: String, + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # plan_phase_order: Integer, + # **_ + # } + # ``` + class UsageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute usage_discount + # The number of usage units by which to discount the price this adjustment applies + # to in a given billing period. + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param usage_discount [Float] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # usage_discount:, + # adjustment_type: :usage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_adjustment => { + # id: String, + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # item_id: String, + # **_ + # } + # ``` + class MinimumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # item_id:, + # minimum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_adjustment => { + # id: String, + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # maximum_amount: String, + # **_ + # } + # ``` + class MaximumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param maximum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # maximum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :maximum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] required :maximum_amount, String + + # @!parse + # # This field is deprecated in favor of `adjustments`. + # # + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class Minimum < Orb::Model - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] minimum_amount + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] required :minimum_amount, String + + # @!parse + # # This field is deprecated in favor of `adjustments`. + # # + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class TaxAmounts < Orb::Model - # @!attribute [rw] amount + + # @abstract + # + # @example + # ```ruby + # case sub_line_item + # in {type: "matrix", amount: String, grouping: Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::Grouping, matrix_config: Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig} + # # Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem ... + # in {type: "tier", amount: String, grouping: Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::Grouping, name: String} + # # Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem ... + # in {type: "'null'", amount: String, grouping: Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem::Grouping, name: String} + # # Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem ... + # end + # ``` + # + # @example + # ```ruby + # case sub_line_item + # in Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem + # # ... + # in Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem + # # ... + # in Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem + # # ... + # end + # ``` + class SubLineItem < Orb::Union + discriminator :type + + variant :matrix, -> { Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem } + + variant :tier, -> { Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem } + + variant :"'null'", -> { Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem } + + # @example + # ```ruby + # matrix_sub_line_item => { + # amount: String, + # grouping: Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::Grouping, + # matrix_config: Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig, + # name: String, + # quantity: Float + # } + # ``` + class MatrixSubLineItem < Orb::BaseModel + # @!attribute amount + # The total amount for this sub line item. + # + # @return [String] + required :amount, String + + # @!attribute grouping + # + # @return [Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::Grouping, nil] + required :grouping, + -> { Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::Grouping }, + nil?: true + + # @!attribute matrix_config + # + # @return [Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig] + required :matrix_config, + -> { Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig } + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute type + # + # @return [Symbol, :matrix] + required :type, const: :matrix + + # @!parse + # # @param amount [String] + # # @param grouping [Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::Grouping, nil] + # # @param matrix_config [Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig] + # # @param name [String] + # # @param quantity [Float] + # # @param type [Symbol, :matrix] + # # + # def initialize(amount:, grouping:, matrix_config:, name:, quantity:, type: :matrix, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # grouping => { + # key: String, + # value: String + # } + # ``` + class Grouping < Orb::BaseModel + # @!attribute key + # + # @return [String] + required :key, String + + # @!attribute value + # No value indicates the default group + # + # @return [String, nil] + required :value, String, nil?: true + + # @!parse + # # @param key [String] + # # @param value [String, nil] + # # + # def initialize(key:, value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # matrix_config => { + # dimension_values: -> { Orb::ArrayOf[String, nil?: true] === _1 } + # } + # ``` + class MatrixConfig < Orb::BaseModel + # @!attribute dimension_values + # The ordered dimension values for this line item. + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String, nil?: true] + + # @!parse + # # @param dimension_values [Array] + # # + # def initialize(dimension_values:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # tier_sub_line_item => { + # amount: String, + # grouping: Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::Grouping, + # name: String, + # quantity: Float, + # tier_config: Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::TierConfig + # } + # ``` + class TierSubLineItem < Orb::BaseModel + # @!attribute amount + # The total amount for this sub line item. + # + # @return [String] + required :amount, String + + # @!attribute grouping + # + # @return [Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::Grouping, nil] + required :grouping, + -> { Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::Grouping }, + nil?: true + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute tier_config + # + # @return [Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::TierConfig] + required :tier_config, + -> { + Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::TierConfig + } + + # @!attribute type + # + # @return [Symbol, :tier] + required :type, const: :tier + + # @!parse + # # @param amount [String] + # # @param grouping [Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::Grouping, nil] + # # @param name [String] + # # @param quantity [Float] + # # @param tier_config [Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::TierConfig] + # # @param type [Symbol, :tier] + # # + # def initialize(amount:, grouping:, name:, quantity:, tier_config:, type: :tier, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # grouping => { + # key: String, + # value: String + # } + # ``` + class Grouping < Orb::BaseModel + # @!attribute key + # + # @return [String] + required :key, String + + # @!attribute value + # No value indicates the default group + # + # @return [String, nil] + required :value, String, nil?: true + + # @!parse + # # @param key [String] + # # @param value [String, nil] + # # + # def initialize(key:, value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # tier_config => { + # first_unit: Float, + # last_unit: Float, + # unit_amount: String + # } + # ``` + class TierConfig < Orb::BaseModel + # @!attribute first_unit + # + # @return [Float] + required :first_unit, Float + + # @!attribute last_unit + # + # @return [Float, nil] + required :last_unit, Float, nil?: true + + # @!attribute unit_amount + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param first_unit [Float] + # # @param last_unit [Float, nil] + # # @param unit_amount [String] + # # + # def initialize(first_unit:, last_unit:, unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # other_sub_line_item => { + # amount: String, + # grouping: Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem::Grouping, + # name: String, + # quantity: Float, + # type: :"'null'" + # } + # ``` + class OtherSubLineItem < Orb::BaseModel + # @!attribute amount + # The total amount for this sub line item. + # + # @return [String] + required :amount, String + + # @!attribute grouping + # + # @return [Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem::Grouping, nil] + required :grouping, + -> { Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem::Grouping }, + nil?: true + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute type + # + # @return [Symbol, :"'null'"] + required :type, const: :"'null'" + + # @!parse + # # @param amount [String] + # # @param grouping [Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem::Grouping, nil] + # # @param name [String] + # # @param quantity [Float] + # # @param type [Symbol, :"'null'"] + # # + # def initialize(amount:, grouping:, name:, quantity:, type: :"'null'", **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # grouping => { + # key: String, + # value: String + # } + # ``` + class Grouping < Orb::BaseModel + # @!attribute key + # + # @return [String] + required :key, String + + # @!attribute value + # No value indicates the default group + # + # @return [String, nil] + required :value, String, nil?: true + + # @!parse + # # @param key [String] + # # @param value [String, nil] + # # + # def initialize(key:, value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # tax_amount => { + # amount: String, + # tax_rate_description: String, + # tax_rate_percentage: String + # } + # ``` + class TaxAmount < Orb::BaseModel + # @!attribute amount + # The amount of additional tax incurred by this tax rate. + # + # @return [String] required :amount, String - # @!attribute [rw] tax_rate_description + + # @!attribute tax_rate_description + # The human-readable description of the applied tax rate. + # + # @return [String] required :tax_rate_description, String - # @!attribute [rw] tax_rate_percentage - required :tax_rate_percentage, String + + # @!attribute tax_rate_percentage + # The tax rate percentage, out of 100. + # + # @return [String, nil] + required :tax_rate_percentage, String, nil?: true + + # @!parse + # # @param amount [String] + # # @param tax_rate_description [String] + # # @param tax_rate_percentage [String, nil] + # # + # def initialize(amount:, tax_rate_description:, tax_rate_percentage:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - # @!attribute [rw] id - required :id, String - # @!attribute [rw] amount - required :amount, String - # @!attribute [rw] discount - required :discount, Orb::Unknown - # @!attribute [rw] end_date - required :end_date, String - # @!attribute [rw] grouping - required :grouping, String - # @!attribute [rw] maximum - required :maximum, Maximum - # @!attribute [rw] maximum_amount - required :maximum_amount, String - # @!attribute [rw] minimum - required :minimum, Minimum - # @!attribute [rw] minimum_amount - required :minimum_amount, String - # @!attribute [rw] name_ - required :name_, String - # @!attribute [rw] price - required :price, Orb::Unknown - # @!attribute [rw] quantity - required :quantity, Float - # @!attribute [rw] start_date - required :start_date, String - # @!attribute [rw] sub_line_items - required :sub_line_items, Orb::ArrayOf.new(Orb::Unknown) - # @!attribute [rw] subtotal - required :subtotal, String - # @!attribute [rw] tax_amounts - required :tax_amounts, Orb::ArrayOf.new(TaxAmounts) end - class Maximum < Orb::Model - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] maximum_amount + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class Minimum < Orb::Model - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] minimum_amount + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # payment_attempt => { + # id: String, + # amount: String, + # created_at: Time, + # payment_provider: Orb::Models::Invoice::PaymentAttempt::PaymentProvider, + # payment_provider_id: String + # } + # ``` + class PaymentAttempt < Orb::BaseModel + # @!attribute id + # The ID of the payment attempt. + # + # @return [String] + required :id, String + + # @!attribute amount + # The amount of the payment attempt. + # + # @return [String] + required :amount, String + + # @!attribute created_at + # The time at which the payment attempt was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute payment_provider + # The payment provider that attempted to collect the payment. + # + # @return [Symbol, Orb::Models::Invoice::PaymentAttempt::PaymentProvider, nil] + required :payment_provider, + enum: -> { + Orb::Models::Invoice::PaymentAttempt::PaymentProvider + }, + nil?: true + + # @!attribute payment_provider_id + # The ID of the payment attempt in the payment provider. + # + # @return [String, nil] + required :payment_provider_id, String, nil?: true + + # @!attribute succeeded + # Whether the payment attempt succeeded. + # + # @return [Boolean] + required :succeeded, Orb::BooleanModel + + # @!parse + # # @param id [String] + # # @param amount [String] + # # @param created_at [Time] + # # @param payment_provider [Symbol, Orb::Models::Invoice::PaymentAttempt::PaymentProvider, nil] + # # @param payment_provider_id [String, nil] + # # @param succeeded [Boolean] + # # + # def initialize(id:, amount:, created_at:, payment_provider:, payment_provider_id:, succeeded:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The payment provider that attempted to collect the payment. + # + # @example + # ```ruby + # case payment_provider + # in :stripe + # # ... + # end + # ``` + class PaymentProvider < Orb::Enum + STRIPE = :stripe + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # shipping_address => { + # city: String, + # country: String, + # line1: String, + # line2: String, + # postal_code: String + # } + # ``` + class ShippingAddress < Orb::BaseModel + # @!attribute city + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute line1 + # + # @return [String, nil] + required :line1, String, nil?: true + + # @!attribute line2 + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute postal_code + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # + # @return [String, nil] + required :state, String, nil?: true + + # @!parse + # # @param city [String, nil] + # # @param country [String, nil] + # # @param line1 [String, nil] + # # @param line2 [String, nil] + # # @param postal_code [String, nil] + # # @param state [String, nil] + # # + # def initialize(city:, country:, line1:, line2:, postal_code:, state:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class ShippingAddress < Orb::Model - # @!attribute [rw] city - required :city, String - # @!attribute [rw] country - required :country, String - # @!attribute [rw] line1 - required :line1, String - # @!attribute [rw] line2 - required :line2, String - # @!attribute [rw] postal_code - required :postal_code, String - # @!attribute [rw] state - required :state, String + + # @abstract + # + # @example + # ```ruby + # case status + # in :issued + # # ... + # in :paid + # # ... + # in :synced + # # ... + # in :void + # # ... + # in :draft + # # ... + # end + # ``` + class Status < Orb::Enum + ISSUED = :issued + PAID = :paid + SYNCED = :synced + VOID = :void + DRAFT = :draft + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end end - class Subscription < Orb::Model - # @!attribute [rw] id + + # @example + # ```ruby + # subscription => { + # id: String + # } + # ``` + class Subscription < Orb::BaseModel + # @!attribute id + # + # @return [String] required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - # @!attribute [rw] id - required :id, String - # @!attribute [rw] amount_due - required :amount_due, String - # @!attribute [rw] auto_collection - required :auto_collection, AutoCollection - # @!attribute [rw] billing_address - required :billing_address, BillingAddress - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] credit_notes - required :credit_notes, Orb::ArrayOf.new(CreditNotes) - # @!attribute [rw] currency - required :currency, String - # @!attribute [rw] customer - required :customer, Customer - # @!attribute [rw] customer_balance_transactions - required :customer_balance_transactions, - Orb::ArrayOf.new(CustomerBalanceTransactions) - # @!attribute [rw] customer_tax_id - required :customer_tax_id, CustomerTaxID - # @!attribute [rw] discount - required :discount, Orb::Unknown - # @!attribute [rw] discounts - required :discounts, Orb::ArrayOf.new(Orb::Unknown) - # @!attribute [rw] due_date - required :due_date, String - # @!attribute [rw] eligible_to_issue_at - required :eligible_to_issue_at, String - # @!attribute [rw] hosted_invoice_url - required :hosted_invoice_url, String - # @!attribute [rw] invoice_date - required :invoice_date, String - # @!attribute [rw] invoice_number - required :invoice_number, String - # @!attribute [rw] invoice_pdf - required :invoice_pdf, String - # @!attribute [rw] issue_failed_at - required :issue_failed_at, String - # @!attribute [rw] issued_at - required :issued_at, String - # @!attribute [rw] line_items - required :line_items, Orb::ArrayOf.new(LineItems) - # @!attribute [rw] maximum - required :maximum, Maximum - # @!attribute [rw] maximum_amount - required :maximum_amount, String - # @!attribute [rw] memo - required :memo, String - # @!attribute [rw] metadata - required :metadata, Orb::Unknown - # @!attribute [rw] minimum - required :minimum, Minimum - # @!attribute [rw] minimum_amount - required :minimum_amount, String - # @!attribute [rw] paid_at - required :paid_at, String - # @!attribute [rw] payment_failed_at - required :payment_failed_at, String - # @!attribute [rw] payment_started_at - required :payment_started_at, String - # @!attribute [rw] scheduled_issue_at - required :scheduled_issue_at, String - # @!attribute [rw] shipping_address - required :shipping_address, ShippingAddress - # @!attribute [rw] status - required :status, - Orb::Enum.new([:"issued", :"paid", :"synced", :"void", :"draft"]) - # @!attribute [rw] subscription - required :subscription, Subscription - # @!attribute [rw] subtotal - required :subtotal, String - # @!attribute [rw] sync_failed_at - required :sync_failed_at, String - # @!attribute [rw] total - required :total, String - # @!attribute [rw] voided_at - required :voided_at, String - # @!attribute [rw] will_auto_issue - required :will_auto_issue, Orb::BooleanModel end end end diff --git a/lib/orb/models/invoice_create_params.rb b/lib/orb/models/invoice_create_params.rb new file mode 100644 index 00000000..ef4962c8 --- /dev/null +++ b/lib/orb/models/invoice_create_params.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +module Orb + module Models + class InvoiceCreateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute currency + # An ISO 4217 currency string. Must be the same as the customer's currency if it + # is set. + # + # @return [String] + required :currency, String + + # @!attribute invoice_date + # Optional invoice date to set. Must be in the past, if not set, `invoice_date` is + # set to the current time in the customer's timezone. + # + # @return [Time] + required :invoice_date, Time + + # @!attribute line_items + # + # @return [Array] + required :line_items, -> { Orb::ArrayOf[Orb::Models::InvoiceCreateParams::LineItem] } + + # @!attribute net_terms + # Determines the difference between the invoice issue date for subscription + # invoices as the date that they are due. A value of '0' here represents that the + # invoice is due on issue, whereas a value of 30 represents that the customer has + # 30 days to pay the invoice. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute customer_id + # The id of the `Customer` to create this invoice for. One of `customer_id` and + # `external_customer_id` are required. + # + # @return [String, nil] + optional :customer_id, String, nil?: true + + # @!attribute discount + # An optional discount to attach to the invoice. + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + optional :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_customer_id + # The `external_customer_id` of the `Customer` to create this invoice for. One of + # `customer_id` and `external_customer_id` are required. + # + # @return [String, nil] + optional :external_customer_id, String, nil?: true + + # @!attribute memo + # An optional memo to attach to the invoice. + # + # @return [String, nil] + optional :memo, String, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute [r] will_auto_issue + # When true, this invoice will automatically be issued upon creation. When false, + # the resulting invoice will require manual review to issue. Defaulted to false. + # + # @return [Boolean, nil] + optional :will_auto_issue, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :will_auto_issue + + # @!parse + # # @param currency [String] + # # @param invoice_date [Time] + # # @param line_items [Array] + # # @param net_terms [Integer] + # # @param customer_id [String, nil] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_customer_id [String, nil] + # # @param memo [String, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param will_auto_issue [Boolean] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # currency:, + # invoice_date:, + # line_items:, + # net_terms:, + # customer_id: nil, + # discount: nil, + # external_customer_id: nil, + # memo: nil, + # metadata: nil, + # will_auto_issue: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # line_item => { + # end_date: Date, + # item_id: String, + # model_type: Orb::Models::InvoiceCreateParams::LineItem::ModelType, + # name: String, + # quantity: Float, + # **_ + # } + # ``` + class LineItem < Orb::BaseModel + # @!attribute end_date + # A date string to specify the line item's end date in the customer's timezone. + # + # @return [Date] + required :end_date, Date + + # @!attribute item_id + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, Orb::Models::InvoiceCreateParams::LineItem::ModelType] + required :model_type, enum: -> { Orb::Models::InvoiceCreateParams::LineItem::ModelType } + + # @!attribute name + # The name of the line item. + # + # @return [String] + required :name, String + + # @!attribute quantity + # The number of units on the line item + # + # @return [Float] + required :quantity, Float + + # @!attribute start_date + # A date string to specify the line item's start date in the customer's timezone. + # + # @return [Date] + required :start_date, Date + + # @!attribute unit_config + # + # @return [Orb::Models::InvoiceCreateParams::LineItem::UnitConfig] + required :unit_config, -> { Orb::Models::InvoiceCreateParams::LineItem::UnitConfig } + + # @!parse + # # @param end_date [Date] + # # @param item_id [String] + # # @param model_type [Symbol, Orb::Models::InvoiceCreateParams::LineItem::ModelType] + # # @param name [String] + # # @param quantity [Float] + # # @param start_date [Date] + # # @param unit_config [Orb::Models::InvoiceCreateParams::LineItem::UnitConfig] + # # + # def initialize(end_date:, item_id:, model_type:, name:, quantity:, start_date:, unit_config:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case model_type + # in :unit + # # ... + # end + # ``` + class ModelType < Orb::Enum + UNIT = :unit + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # unit_config => { + # unit_amount: String + # } + # ``` + class UnitConfig < Orb::BaseModel + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param unit_amount [String] + # # + # def initialize(unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + end +end diff --git a/lib/orb/models/invoice_fetch_params.rb b/lib/orb/models/invoice_fetch_params.rb new file mode 100644 index 00000000..88f2a3e3 --- /dev/null +++ b/lib/orb/models/invoice_fetch_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class InvoiceFetchParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/invoice_fetch_upcoming_params.rb b/lib/orb/models/invoice_fetch_upcoming_params.rb new file mode 100644 index 00000000..8b3405b9 --- /dev/null +++ b/lib/orb/models/invoice_fetch_upcoming_params.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Orb + module Models + class InvoiceFetchUpcomingParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute subscription_id + # + # @return [String] + required :subscription_id, String + + # @!parse + # # @param subscription_id [String] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(subscription_id:, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/invoice_fetch_upcoming_response.rb b/lib/orb/models/invoice_fetch_upcoming_response.rb index ec478dda..d4ff2169 100644 --- a/lib/orb/models/invoice_fetch_upcoming_response.rb +++ b/lib/orb/models/invoice_fetch_upcoming_response.rb @@ -1,382 +1,2616 @@ -require "orb/model" +# frozen_string_literal: true + module Orb module Models - class InvoiceFetchUpcomingResponse < Orb::Model - class AutoCollection < Orb::Model - # @!attribute [rw] enabled - required :enabled, Orb::BooleanModel - # @!attribute [rw] next_attempt_at - required :next_attempt_at, String - # @!attribute [rw] previously_attempted_at - required :previously_attempted_at, String + # @example + # ```ruby + # invoice_fetch_upcoming_response => { + # id: String, + # amount_due: String, + # auto_collection: Orb::Models::InvoiceFetchUpcomingResponse::AutoCollection, + # billing_address: Orb::Models::InvoiceFetchUpcomingResponse::BillingAddress, + # created_at: Time, + # **_ + # } + # ``` + class InvoiceFetchUpcomingResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount_due + # This is the final amount required to be charged to the customer and reflects the + # application of the customer balance to the `total` of the invoice. + # + # @return [String] + required :amount_due, String + + # @!attribute auto_collection + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::AutoCollection] + required :auto_collection, -> { Orb::Models::InvoiceFetchUpcomingResponse::AutoCollection } + + # @!attribute billing_address + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::BillingAddress, nil] + required :billing_address, -> { Orb::Models::InvoiceFetchUpcomingResponse::BillingAddress }, nil?: true + + # @!attribute created_at + # The creation time of the resource in Orb. + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_notes + # A list of credit notes associated with the invoice + # + # @return [Array] + required :credit_notes, -> { Orb::ArrayOf[Orb::Models::InvoiceFetchUpcomingResponse::CreditNote] } + + # @!attribute currency + # An ISO 4217 currency string or `credits` + # + # @return [String] + required :currency, String + + # @!attribute customer + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::Customer] + required :customer, -> { Orb::Models::InvoiceFetchUpcomingResponse::Customer } + + # @!attribute customer_balance_transactions + # + # @return [Array] + required :customer_balance_transactions, + -> { Orb::ArrayOf[Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction] } + + # @!attribute customer_tax_id + # Tax IDs are commonly required to be displayed on customer invoices, which are + # added to the headers of invoices. + # + # ### Supported Tax ID Countries and Types + # + # | Country | Type | Description | + # | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # | Andorra | `ad_nrt` | Andorran NRT Number | + # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # | Austria | `eu_vat` | European VAT Number | + # | Bahrain | `bh_vat` | Bahraini VAT Number | + # | Belgium | `eu_vat` | European VAT Number | + # | Bolivia | `bo_tin` | Bolivian Tax ID | + # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # | Brazil | `br_cpf` | Brazilian CPF Number | + # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # | Bulgaria | `eu_vat` | European VAT Number | + # | Canada | `ca_bn` | Canadian BN | + # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # | Chile | `cl_tin` | Chilean TIN | + # | China | `cn_tin` | Chinese Tax ID | + # | Colombia | `co_nit` | Colombian NIT Number | + # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # | Croatia | `eu_vat` | European VAT Number | + # | Cyprus | `eu_vat` | European VAT Number | + # | Czech Republic | `eu_vat` | European VAT Number | + # | Denmark | `eu_vat` | European VAT Number | + # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # | Estonia | `eu_vat` | European VAT Number | + # | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # | Finland | `eu_vat` | European VAT Number | + # | France | `eu_vat` | European VAT Number | + # | Georgia | `ge_vat` | Georgian VAT | + # | Germany | `eu_vat` | European VAT Number | + # | Greece | `eu_vat` | European VAT Number | + # | Hong Kong | `hk_br` | Hong Kong BR Number | + # | Hungary | `eu_vat` | European VAT Number | + # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # | Iceland | `is_vat` | Icelandic VAT | + # | India | `in_gst` | Indian GST Number | + # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # | Ireland | `eu_vat` | European VAT Number | + # | Israel | `il_vat` | Israel VAT | + # | Italy | `eu_vat` | European VAT Number | + # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # | Latvia | `eu_vat` | European VAT Number | + # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # | Lithuania | `eu_vat` | European VAT Number | + # | Luxembourg | `eu_vat` | European VAT Number | + # | Malaysia | `my_frp` | Malaysian FRP Number | + # | Malaysia | `my_itn` | Malaysian ITN | + # | Malaysia | `my_sst` | Malaysian SST Number | + # | Malta | `eu_vat ` | European VAT Number | + # | Mexico | `mx_rfc` | Mexican RFC Number | + # | Netherlands | `eu_vat` | European VAT Number | + # | New Zealand | `nz_gst` | New Zealand GST Number | + # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # | Norway | `no_vat` | Norwegian VAT Number | + # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # | Oman | `om_vat` | Omani VAT Number | + # | Peru | `pe_ruc` | Peruvian RUC Number | + # | Philippines | `ph_tin ` | Philippines Tax Identification Number | + # | Poland | `eu_vat` | European VAT Number | + # | Portugal | `eu_vat` | European VAT Number | + # | Romania | `eu_vat` | European VAT Number | + # | Romania | `ro_tin` | Romanian Tax ID Number | + # | Russia | `ru_inn` | Russian INN | + # | Russia | `ru_kpp` | Russian KPP | + # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # | Serbia | `rs_pib` | Serbian PIB Number | + # | Singapore | `sg_gst` | Singaporean GST | + # | Singapore | `sg_uen` | Singaporean UEN | + # | Slovakia | `eu_vat` | European VAT Number | + # | Slovenia | `eu_vat` | European VAT Number | + # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # | South Africa | `za_vat` | South African VAT Number | + # | South Korea | `kr_brn` | Korean BRN | + # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # | Spain | `eu_vat` | European VAT Number | + # | Sweden | `eu_vat` | European VAT Number | + # | Switzerland | `ch_vat` | Switzerland VAT Number | + # | Taiwan | `tw_vat` | Taiwanese VAT | + # | Thailand | `th_vat` | Thai VAT | + # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # | Ukraine | `ua_vat` | Ukrainian VAT | + # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # | United States | `us_ein` | United States EIN | + # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID, nil] + required :customer_tax_id, -> { Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID }, nil?: true + + # @!attribute discount + # This field is deprecated in favor of `discounts`. If a `discounts` list is + # provided, the first discount in the list will be returned. If the list is empty, + # `None` will be returned. + # + # @return [Object] + required :discount, Orb::Unknown + + # @!attribute discounts + # + # @return [Array] + required :discounts, -> { Orb::ArrayOf[union: Orb::Models::InvoiceLevelDiscount] } + + # @!attribute due_date + # When the invoice payment is due. The due date is null if the invoice is not yet + # finalized. + # + # @return [Time, nil] + required :due_date, Time, nil?: true + + # @!attribute eligible_to_issue_at + # If the invoice has a status of `draft`, this will be the time that the invoice + # will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is + # true, the invoice will automatically begin issuing at this time. + # + # @return [Time, nil] + required :eligible_to_issue_at, Time, nil?: true + + # @!attribute hosted_invoice_url + # A URL for the customer-facing invoice portal. This URL expires 30 days after the + # invoice's due date, or 60 days after being re-generated through the UI. + # + # @return [String, nil] + required :hosted_invoice_url, String, nil?: true + + # @!attribute invoice_number + # Automatically generated invoice number to help track and reconcile invoices. + # Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per + # account or customer. + # + # @return [String] + required :invoice_number, String + + # @!attribute invoice_pdf + # The link to download the PDF representation of the `Invoice`. + # + # @return [String, nil] + required :invoice_pdf, String, nil?: true + + # @!attribute invoice_source + # + # @return [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::InvoiceSource] + required :invoice_source, enum: -> { Orb::Models::InvoiceFetchUpcomingResponse::InvoiceSource } + + # @!attribute issue_failed_at + # If the invoice failed to issue, this will be the last time it failed to issue + # (even if it is now in a different state.) + # + # @return [Time, nil] + required :issue_failed_at, Time, nil?: true + + # @!attribute issued_at + # If the invoice has been issued, this will be the time it transitioned to + # `issued` (even if it is now in a different state.) + # + # @return [Time, nil] + required :issued_at, Time, nil?: true + + # @!attribute line_items + # The breakdown of prices in this invoice. + # + # @return [Array] + required :line_items, -> { Orb::ArrayOf[Orb::Models::InvoiceFetchUpcomingResponse::LineItem] } + + # @!attribute maximum + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::Maximum, nil] + required :maximum, -> { Orb::Models::InvoiceFetchUpcomingResponse::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute memo + # Free-form text which is available on the invoice PDF and the Orb invoice portal. + # + # @return [String, nil] + required :memo, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::Minimum, nil] + required :minimum, -> { Orb::Models::InvoiceFetchUpcomingResponse::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute paid_at + # If the invoice has a status of `paid`, this gives a timestamp when the invoice + # was paid. + # + # @return [Time, nil] + required :paid_at, Time, nil?: true + + # @!attribute payment_attempts + # A list of payment attempts associated with the invoice + # + # @return [Array] + required :payment_attempts, + -> { + Orb::ArrayOf[Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt] + } + + # @!attribute payment_failed_at + # If payment was attempted on this invoice but failed, this will be the time of + # the most recent attempt. + # + # @return [Time, nil] + required :payment_failed_at, Time, nil?: true + + # @!attribute payment_started_at + # If payment was attempted on this invoice, this will be the start time of the + # most recent attempt. This field is especially useful for delayed-notification + # payment mechanisms (like bank transfers), where payment can take 3 days or more. + # + # @return [Time, nil] + required :payment_started_at, Time, nil?: true + + # @!attribute scheduled_issue_at + # If the invoice is in draft, this timestamp will reflect when the invoice is + # scheduled to be issued. + # + # @return [Time, nil] + required :scheduled_issue_at, Time, nil?: true + + # @!attribute shipping_address + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::ShippingAddress, nil] + required :shipping_address, + -> { + Orb::Models::InvoiceFetchUpcomingResponse::ShippingAddress + }, + nil?: true + + # @!attribute status + # + # @return [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::Status] + required :status, enum: -> { Orb::Models::InvoiceFetchUpcomingResponse::Status } + + # @!attribute subscription + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::Subscription, nil] + required :subscription, -> { Orb::Models::InvoiceFetchUpcomingResponse::Subscription }, nil?: true + + # @!attribute subtotal + # The total before any discounts and minimums are applied. + # + # @return [String] + required :subtotal, String + + # @!attribute sync_failed_at + # If the invoice failed to sync, this will be the last time an external invoicing + # provider sync was attempted. This field will always be `null` for invoices using + # Orb Invoicing. + # + # @return [Time, nil] + required :sync_failed_at, Time, nil?: true + + # @!attribute target_date + # The scheduled date of the invoice + # + # @return [Time] + required :target_date, Time + + # @!attribute total + # The total after any minimums and discounts have been applied. + # + # @return [String] + required :total, String + + # @!attribute voided_at + # If the invoice has a status of `void`, this gives a timestamp when the invoice + # was voided. + # + # @return [Time, nil] + required :voided_at, Time, nil?: true + + # @!attribute will_auto_issue + # This is true if the invoice will be automatically issued in the future, and + # false otherwise. + # + # @return [Boolean] + required :will_auto_issue, Orb::BooleanModel + + # @!parse + # # @param id [String] + # # @param amount_due [String] + # # @param auto_collection [Orb::Models::InvoiceFetchUpcomingResponse::AutoCollection] + # # @param billing_address [Orb::Models::InvoiceFetchUpcomingResponse::BillingAddress, nil] + # # @param created_at [Time] + # # @param credit_notes [Array] + # # @param currency [String] + # # @param customer [Orb::Models::InvoiceFetchUpcomingResponse::Customer] + # # @param customer_balance_transactions [Array] + # # @param customer_tax_id [Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID, nil] + # # @param discount [Object] + # # @param discounts [Array] + # # @param due_date [Time, nil] + # # @param eligible_to_issue_at [Time, nil] + # # @param hosted_invoice_url [String, nil] + # # @param invoice_number [String] + # # @param invoice_pdf [String, nil] + # # @param invoice_source [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::InvoiceSource] + # # @param issue_failed_at [Time, nil] + # # @param issued_at [Time, nil] + # # @param line_items [Array] + # # @param maximum [Orb::Models::InvoiceFetchUpcomingResponse::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param memo [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::InvoiceFetchUpcomingResponse::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param paid_at [Time, nil] + # # @param payment_attempts [Array] + # # @param payment_failed_at [Time, nil] + # # @param payment_started_at [Time, nil] + # # @param scheduled_issue_at [Time, nil] + # # @param shipping_address [Orb::Models::InvoiceFetchUpcomingResponse::ShippingAddress, nil] + # # @param status [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::Status] + # # @param subscription [Orb::Models::InvoiceFetchUpcomingResponse::Subscription, nil] + # # @param subtotal [String] + # # @param sync_failed_at [Time, nil] + # # @param target_date [Time] + # # @param total [String] + # # @param voided_at [Time, nil] + # # @param will_auto_issue [Boolean] + # # + # def initialize( + # id:, + # amount_due:, + # auto_collection:, + # billing_address:, + # created_at:, + # credit_notes:, + # currency:, + # customer:, + # customer_balance_transactions:, + # customer_tax_id:, + # discount:, + # discounts:, + # due_date:, + # eligible_to_issue_at:, + # hosted_invoice_url:, + # invoice_number:, + # invoice_pdf:, + # invoice_source:, + # issue_failed_at:, + # issued_at:, + # line_items:, + # maximum:, + # maximum_amount:, + # memo:, + # metadata:, + # minimum:, + # minimum_amount:, + # paid_at:, + # payment_attempts:, + # payment_failed_at:, + # payment_started_at:, + # scheduled_issue_at:, + # shipping_address:, + # status:, + # subscription:, + # subtotal:, + # sync_failed_at:, + # target_date:, + # total:, + # voided_at:, + # will_auto_issue:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # auto_collection => { + # enabled: Orb::BooleanModel, + # next_attempt_at: Time, + # num_attempts: Integer, + # previously_attempted_at: Time + # } + # ``` + class AutoCollection < Orb::BaseModel + # @!attribute enabled + # True only if auto-collection is enabled for this invoice. + # + # @return [Boolean, nil] + required :enabled, Orb::BooleanModel, nil?: true + + # @!attribute next_attempt_at + # If the invoice is scheduled for auto-collection, this field will reflect when + # the next attempt will occur. If dunning has been exhausted, or auto-collection + # is not enabled for this invoice, this field will be `null`. + # + # @return [Time, nil] + required :next_attempt_at, Time, nil?: true + + # @!attribute num_attempts + # Number of auto-collection payment attempts. + # + # @return [Integer, nil] + required :num_attempts, Integer, nil?: true + + # @!attribute previously_attempted_at + # If Orb has ever attempted payment auto-collection for this invoice, this field + # will reflect when that attempt occurred. In conjunction with `next_attempt_at`, + # this can be used to tell whether the invoice is currently in dunning (that is, + # `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or + # if dunning has been exhausted (`previously_attempted_at` is non-null, but + # `next_attempt_time` is null). + # + # @return [Time, nil] + required :previously_attempted_at, Time, nil?: true + + # @!parse + # # @param enabled [Boolean, nil] + # # @param next_attempt_at [Time, nil] + # # @param num_attempts [Integer, nil] + # # @param previously_attempted_at [Time, nil] + # # + # def initialize(enabled:, next_attempt_at:, num_attempts:, previously_attempted_at:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class BillingAddress < Orb::Model - # @!attribute [rw] city - required :city, String - # @!attribute [rw] country - required :country, String - # @!attribute [rw] line1 - required :line1, String - # @!attribute [rw] line2 - required :line2, String - # @!attribute [rw] postal_code - required :postal_code, String - # @!attribute [rw] state - required :state, String + + # @example + # ```ruby + # billing_address => { + # city: String, + # country: String, + # line1: String, + # line2: String, + # postal_code: String + # } + # ``` + class BillingAddress < Orb::BaseModel + # @!attribute city + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute line1 + # + # @return [String, nil] + required :line1, String, nil?: true + + # @!attribute line2 + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute postal_code + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # + # @return [String, nil] + required :state, String, nil?: true + + # @!parse + # # @param city [String, nil] + # # @param country [String, nil] + # # @param line1 [String, nil] + # # @param line2 [String, nil] + # # @param postal_code [String, nil] + # # @param state [String, nil] + # # + # def initialize(city:, country:, line1:, line2:, postal_code:, state:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class CreditNotes < Orb::Model - # @!attribute [rw] id + + # @example + # ```ruby + # credit_note => { + # id: String, + # credit_note_number: String, + # memo: String, + # reason: String, + # total: String, + # **_ + # } + # ``` + class CreditNote < Orb::BaseModel + # @!attribute id + # + # @return [String] required :id, String - # @!attribute [rw] credit_note_number + + # @!attribute credit_note_number + # + # @return [String] required :credit_note_number, String - # @!attribute [rw] reason + + # @!attribute memo + # An optional memo supplied on the credit note. + # + # @return [String, nil] + required :memo, String, nil?: true + + # @!attribute reason + # + # @return [String] required :reason, String - # @!attribute [rw] total + + # @!attribute total + # + # @return [String] required :total, String - # @!attribute [rw] type + + # @!attribute type + # + # @return [String] required :type, String - # @!attribute [rw] voided_at - required :voided_at, String + + # @!attribute voided_at + # If the credit note has a status of `void`, this gives a timestamp when the + # credit note was voided. + # + # @return [Time, nil] + required :voided_at, Time, nil?: true + + # @!parse + # # @param id [String] + # # @param credit_note_number [String] + # # @param memo [String, nil] + # # @param reason [String] + # # @param total [String] + # # @param type [String] + # # @param voided_at [Time, nil] + # # + # def initialize(id:, credit_note_number:, memo:, reason:, total:, type:, voided_at:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class Customer < Orb::Model - # @!attribute [rw] id + + # @example + # ```ruby + # customer => { + # id: String, + # external_customer_id: String + # } + # ``` + class Customer < Orb::BaseModel + # @!attribute id + # + # @return [String] required :id, String - # @!attribute [rw] external_customer_id - required :external_customer_id, String + + # @!attribute external_customer_id + # + # @return [String, nil] + required :external_customer_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param external_customer_id [String, nil] + # # + # def initialize(id:, external_customer_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class CustomerBalanceTransactions < Orb::Model - class CreditNote < Orb::Model - # @!attribute [rw] id - required :id, String - end - class Invoice < Orb::Model - # @!attribute [rw] id - required :id, String - end - # @!attribute [rw] id + + # @example + # ```ruby + # customer_balance_transaction => { + # id: String, + # action: Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Action, + # amount: String, + # created_at: Time, + # credit_note: Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::CreditNote, + # **_ + # } + # ``` + class CustomerBalanceTransaction < Orb::BaseModel + # @!attribute id + # A unique id for this transaction. + # + # @return [String] required :id, String - # @!attribute [rw] action + + # @!attribute action + # + # @return [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Action] required :action, - Orb::Enum.new( - [ - :"applied_to_invoice", - :"manual_adjustment", - :"prorated_refund", - :"revert_prorated_refund", - :"return_from_voiding", - :"credit_note_applied", - :"credit_note_voided", - :"overpayment_refund" - ] - ) - # @!attribute [rw] amount + enum: -> { Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Action } + + # @!attribute amount + # The value of the amount changed in the transaction. + # + # @return [String] required :amount, String - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] credit_note - required :credit_note, CreditNote - # @!attribute [rw] description - required :description, String - # @!attribute [rw] ending_balance + + # @!attribute created_at + # The creation time of this transaction. + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_note + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::CreditNote, nil] + required :credit_note, + -> { Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::CreditNote }, + nil?: true + + # @!attribute description + # An optional description provided for manual customer balance adjustments. + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute ending_balance + # The new value of the customer's balance prior to the transaction, in the + # customer's currency. + # + # @return [String] required :ending_balance, String - # @!attribute [rw] invoice - required :invoice, Invoice - # @!attribute [rw] starting_balance + + # @!attribute invoice + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Invoice, nil] + required :invoice, + -> { Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Invoice }, + nil?: true + + # @!attribute starting_balance + # The original value of the customer's balance prior to the transaction, in the + # customer's currency. + # + # @return [String] required :starting_balance, String - # @!attribute [rw] type - required :type, Orb::Enum.new([:"increment", :"decrement"]) - end - class CustomerTaxID < Orb::Model - # @!attribute [rw] country - required :country, - Orb::Enum.new( - [ - :"AE", - :"AT", - :"AU", - :"BE", - :"BG", - :"BR", - :"CA", - :"CH", - :"CL", - :"CY", - :"CZ", - :"DE", - :"DK", - :"EE", - :"EG", - :"ES", - :"EU", - :"FI", - :"FR", - :"GB", - :"GE", - :"GR", - :"HK", - :"HR", - :"HU", - :"ID", - :"IE", - :"IL", - :"IN", - :"IS", - :"IT", - :"JP", - :"KE", - :"KR", - :"LI", - :"LT", - :"LU", - :"LV", - :"MT", - :"MX", - :"MY", - :"NL", - :"NO", - :"NZ", - :"PH", - :"PL", - :"PT", - :"RO", - :"RU", - :"SA", - :"SE", - :"SG", - :"SI", - :"SK", - :"TH", - :"TR", - :"TW", - :"UA", - :"US", - :"ZA" - ] - ) - # @!attribute [rw] type + + # @!attribute type + # + # @return [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Type] required :type, - Orb::Enum.new( - [ - :"ae_trn", - :"eu_vat", - :"au_abn", - :"au_arn", - :"bg_uic", - :"br_cnpj", - :"br_cpf", - :"ca_bn", - :"ca_gst_hst", - :"ca_pst_bc", - :"ca_pst_mb", - :"ca_pst_sk", - :"ca_qst", - :"ch_vat", - :"cl_tin", - :"eg_tin", - :"es_cif", - :"eu_oss_vat", - :"gb_vat", - :"ge_vat", - :"hk_br", - :"hu_tin", - :"id_npwp", - :"il_vat", - :"in_gst", - :"is_vat", - :"jp_cn", - :"jp_rn", - :"jp_trn", - :"ke_pin", - :"kr_brn", - :"li_uid", - :"mx_rfc", - :"my_frp", - :"my_itn", - :"my_sst", - :"no_vat", - :"nz_gst", - :"ph_tin", - :"ru_inn", - :"ru_kpp", - :"sa_vat", - :"sg_gst", - :"sg_uen", - :"si_tin", - :"th_vat", - :"tr_tin", - :"tw_vat", - :"ua_vat", - :"us_ein", - :"za_vat" - ] - ) - # @!attribute [rw] value + enum: -> { + Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Type + } + + # @!parse + # # @param id [String] + # # @param action [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Action] + # # @param amount [String] + # # @param created_at [Time] + # # @param credit_note [Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::CreditNote, nil] + # # @param description [String, nil] + # # @param ending_balance [String] + # # @param invoice [Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Invoice, nil] + # # @param starting_balance [String] + # # @param type [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Type] + # # + # def initialize( + # id:, + # action:, + # amount:, + # created_at:, + # credit_note:, + # description:, + # ending_balance:, + # invoice:, + # starting_balance:, + # type:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case action + # in :applied_to_invoice + # # ... + # in :manual_adjustment + # # ... + # in :prorated_refund + # # ... + # in :revert_prorated_refund + # # ... + # in :return_from_voiding + # # ... + # in ... + # #... + # end + # ``` + class Action < Orb::Enum + APPLIED_TO_INVOICE = :applied_to_invoice + MANUAL_ADJUSTMENT = :manual_adjustment + PRORATED_REFUND = :prorated_refund + REVERT_PRORATED_REFUND = :revert_prorated_refund + RETURN_FROM_VOIDING = :return_from_voiding + CREDIT_NOTE_APPLIED = :credit_note_applied + CREDIT_NOTE_VOIDED = :credit_note_voided + OVERPAYMENT_REFUND = :overpayment_refund + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_note => { + # id: String + # } + # ``` + class CreditNote < Orb::BaseModel + # @!attribute id + # The id of the Credit note + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoice => { + # id: String + # } + # ``` + class Invoice < Orb::BaseModel + # @!attribute id + # The Invoice id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case type + # in :increment + # # ... + # in :decrement + # # ... + # end + # ``` + class Type < Orb::Enum + INCREMENT = :increment + DECREMENT = :decrement + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # customer_tax_id => { + # country: Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::Country, + # type: Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::Type, + # value: String + # } + # ``` + class CustomerTaxID < Orb::BaseModel + # @!attribute country + # + # @return [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::Country] + required :country, enum: -> { Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::Country } + + # @!attribute type + # + # @return [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::Type] + required :type, enum: -> { Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::Type } + + # @!attribute value + # + # @return [String] required :value, String + + # @!parse + # # Tax IDs are commonly required to be displayed on customer invoices, which are + # # added to the headers of invoices. + # # + # # ### Supported Tax ID Countries and Types + # # + # # | Country | Type | Description | + # # | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # # | Andorra | `ad_nrt` | Andorran NRT Number | + # # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # # | Austria | `eu_vat` | European VAT Number | + # # | Bahrain | `bh_vat` | Bahraini VAT Number | + # # | Belgium | `eu_vat` | European VAT Number | + # # | Bolivia | `bo_tin` | Bolivian Tax ID | + # # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # # | Brazil | `br_cpf` | Brazilian CPF Number | + # # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # # | Bulgaria | `eu_vat` | European VAT Number | + # # | Canada | `ca_bn` | Canadian BN | + # # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # # | Chile | `cl_tin` | Chilean TIN | + # # | China | `cn_tin` | Chinese Tax ID | + # # | Colombia | `co_nit` | Colombian NIT Number | + # # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # # | Croatia | `eu_vat` | European VAT Number | + # # | Cyprus | `eu_vat` | European VAT Number | + # # | Czech Republic | `eu_vat` | European VAT Number | + # # | Denmark | `eu_vat` | European VAT Number | + # # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # # | Estonia | `eu_vat` | European VAT Number | + # # | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # # | Finland | `eu_vat` | European VAT Number | + # # | France | `eu_vat` | European VAT Number | + # # | Georgia | `ge_vat` | Georgian VAT | + # # | Germany | `eu_vat` | European VAT Number | + # # | Greece | `eu_vat` | European VAT Number | + # # | Hong Kong | `hk_br` | Hong Kong BR Number | + # # | Hungary | `eu_vat` | European VAT Number | + # # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # # | Iceland | `is_vat` | Icelandic VAT | + # # | India | `in_gst` | Indian GST Number | + # # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # # | Ireland | `eu_vat` | European VAT Number | + # # | Israel | `il_vat` | Israel VAT | + # # | Italy | `eu_vat` | European VAT Number | + # # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # # | Latvia | `eu_vat` | European VAT Number | + # # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # # | Lithuania | `eu_vat` | European VAT Number | + # # | Luxembourg | `eu_vat` | European VAT Number | + # # | Malaysia | `my_frp` | Malaysian FRP Number | + # # | Malaysia | `my_itn` | Malaysian ITN | + # # | Malaysia | `my_sst` | Malaysian SST Number | + # # | Malta | `eu_vat ` | European VAT Number | + # # | Mexico | `mx_rfc` | Mexican RFC Number | + # # | Netherlands | `eu_vat` | European VAT Number | + # # | New Zealand | `nz_gst` | New Zealand GST Number | + # # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # # | Norway | `no_vat` | Norwegian VAT Number | + # # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # # | Oman | `om_vat` | Omani VAT Number | + # # | Peru | `pe_ruc` | Peruvian RUC Number | + # # | Philippines | `ph_tin ` | Philippines Tax Identification Number | + # # | Poland | `eu_vat` | European VAT Number | + # # | Portugal | `eu_vat` | European VAT Number | + # # | Romania | `eu_vat` | European VAT Number | + # # | Romania | `ro_tin` | Romanian Tax ID Number | + # # | Russia | `ru_inn` | Russian INN | + # # | Russia | `ru_kpp` | Russian KPP | + # # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # # | Serbia | `rs_pib` | Serbian PIB Number | + # # | Singapore | `sg_gst` | Singaporean GST | + # # | Singapore | `sg_uen` | Singaporean UEN | + # # | Slovakia | `eu_vat` | European VAT Number | + # # | Slovenia | `eu_vat` | European VAT Number | + # # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # # | South Africa | `za_vat` | South African VAT Number | + # # | South Korea | `kr_brn` | Korean BRN | + # # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # # | Spain | `eu_vat` | European VAT Number | + # # | Sweden | `eu_vat` | European VAT Number | + # # | Switzerland | `ch_vat` | Switzerland VAT Number | + # # | Taiwan | `tw_vat` | Taiwanese VAT | + # # | Thailand | `th_vat` | Thai VAT | + # # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # # | Ukraine | `ua_vat` | Ukrainian VAT | + # # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # # | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + # # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # # | United States | `us_ein` | United States EIN | + # # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # # + # # @param country [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::Country] + # # @param type [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::Type] + # # @param value [String] + # # + # def initialize(country:, type:, value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case country + # in :AD + # # ... + # in :AE + # # ... + # in :AR + # # ... + # in :AT + # # ... + # in :AU + # # ... + # in ... + # #... + # end + # ``` + class Country < Orb::Enum + AD = :AD + AE = :AE + AR = :AR + AT = :AT + AU = :AU + BE = :BE + BG = :BG + BH = :BH + BO = :BO + BR = :BR + CA = :CA + CH = :CH + CL = :CL + CN = :CN + CO = :CO + CR = :CR + CY = :CY + CZ = :CZ + DE = :DE + DK = :DK + EE = :EE + DO = :DO + EC = :EC + EG = :EG + ES = :ES + EU = :EU + FI = :FI + FR = :FR + GB = :GB + GE = :GE + GR = :GR + HK = :HK + HR = :HR + HU = :HU + ID = :ID + IE = :IE + IL = :IL + IN = :IN + IS = :IS + IT = :IT + JP = :JP + KE = :KE + KR = :KR + KZ = :KZ + LI = :LI + LT = :LT + LU = :LU + LV = :LV + MT = :MT + MX = :MX + MY = :MY + NG = :NG + NL = :NL + NO = :NO + NZ = :NZ + OM = :OM + PE = :PE + PH = :PH + PL = :PL + PT = :PT + RO = :RO + RS = :RS + RU = :RU + SA = :SA + SE = :SE + SG = :SG + SI = :SI + SK = :SK + SV = :SV + TH = :TH + TR = :TR + TW = :TW + UA = :UA + US = :US + UY = :UY + VE = :VE + VN = :VN + ZA = :ZA + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # @example + # ```ruby + # case type + # in :ad_nrt + # # ... + # in :ae_trn + # # ... + # in :ar_cuit + # # ... + # in :eu_vat + # # ... + # in :au_abn + # # ... + # in ... + # #... + # end + # ``` + class Type < Orb::Enum + AD_NRT = :ad_nrt + AE_TRN = :ae_trn + AR_CUIT = :ar_cuit + EU_VAT = :eu_vat + AU_ABN = :au_abn + AU_ARN = :au_arn + BG_UIC = :bg_uic + BH_VAT = :bh_vat + BO_TIN = :bo_tin + BR_CNPJ = :br_cnpj + BR_CPF = :br_cpf + CA_BN = :ca_bn + CA_GST_HST = :ca_gst_hst + CA_PST_BC = :ca_pst_bc + CA_PST_MB = :ca_pst_mb + CA_PST_SK = :ca_pst_sk + CA_QST = :ca_qst + CH_VAT = :ch_vat + CL_TIN = :cl_tin + CN_TIN = :cn_tin + CO_NIT = :co_nit + CR_TIN = :cr_tin + DO_RCN = :do_rcn + EC_RUC = :ec_ruc + EG_TIN = :eg_tin + ES_CIF = :es_cif + EU_OSS_VAT = :eu_oss_vat + GB_VAT = :gb_vat + GE_VAT = :ge_vat + HK_BR = :hk_br + HU_TIN = :hu_tin + ID_NPWP = :id_npwp + IL_VAT = :il_vat + IN_GST = :in_gst + IS_VAT = :is_vat + JP_CN = :jp_cn + JP_RN = :jp_rn + JP_TRN = :jp_trn + KE_PIN = :ke_pin + KR_BRN = :kr_brn + KZ_BIN = :kz_bin + LI_UID = :li_uid + MX_RFC = :mx_rfc + MY_FRP = :my_frp + MY_ITN = :my_itn + MY_SST = :my_sst + NG_TIN = :ng_tin + NO_VAT = :no_vat + NO_VOEC = :no_voec + NZ_GST = :nz_gst + OM_VAT = :om_vat + PE_RUC = :pe_ruc + PH_TIN = :ph_tin + RO_TIN = :ro_tin + RS_PIB = :rs_pib + RU_INN = :ru_inn + RU_KPP = :ru_kpp + SA_VAT = :sa_vat + SG_GST = :sg_gst + SG_UEN = :sg_uen + SI_TIN = :si_tin + SV_NIT = :sv_nit + TH_VAT = :th_vat + TR_TIN = :tr_tin + TW_VAT = :tw_vat + UA_VAT = :ua_vat + US_EIN = :us_ein + UY_RUC = :uy_ruc + VE_RIF = :ve_rif + VN_TIN = :vn_tin + ZA_VAT = :za_vat + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case invoice_source + # in :subscription + # # ... + # in :partial + # # ... + # in :one_off + # # ... + # end + # ``` + class InvoiceSource < Orb::Enum + SUBSCRIPTION = :subscription + PARTIAL = :partial + ONE_OFF = :one_off + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end end - class LineItems < Orb::Model - class Maximum < Orb::Model - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] maximum_amount + + # @example + # ```ruby + # line_item => { + # id: String, + # adjusted_subtotal: String, + # adjustments: -> { Orb::ArrayOf[union: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment] === _1 }, + # amount: String, + # credits_applied: String, + # **_ + # } + # ``` + class LineItem < Orb::BaseModel + # @!attribute id + # A unique ID for this line item. + # + # @return [String] + required :id, String + + # @!attribute adjusted_subtotal + # The line amount after any adjustments, before overage conversion, credits and + # partial invoicing. + # + # @return [String] + required :adjusted_subtotal, String + + # @!attribute adjustments + # All adjustments applied to the line item. + # + # @return [Array] + required :adjustments, + -> { Orb::ArrayOf[union: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment] } + + # @!attribute amount + # The final amount after any discounts or minimums. + # + # @return [String] + required :amount, String + + # @!attribute credits_applied + # The number of credits used + # + # @return [String] + required :credits_applied, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute end_date + # The end date of the range of time applied for this line item's price. + # + # @return [Time] + required :end_date, Time + + # @!attribute grouping + # [DEPRECATED] For configured prices that are split by a grouping key, this will + # be populated with the key and a value. The `amount` and `subtotal` will be the + # values for this particular grouping. + # + # @return [String, nil] + required :grouping, String, nil?: true + + # @!attribute maximum + # This field is deprecated in favor of `adjustments`. + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Maximum, nil] + required :maximum, -> { Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Maximum }, nil?: true + + # @!attribute maximum_amount + # This field is deprecated in favor of `adjustments`. + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute minimum + # This field is deprecated in favor of `adjustments`. + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Minimum, nil] + required :minimum, -> { Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Minimum }, nil?: true + + # @!attribute minimum_amount + # This field is deprecated in favor of `adjustments`. + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute name + # The name of the price associated with this line item. + # + # @return [String] + required :name, String + + # @!attribute partially_invoiced_amount + # Any amount applied from a partial invoice + # + # @return [String] + required :partially_invoiced_amount, String + + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice, nil] + required :price, union: -> { Orb::Models::Price }, nil?: true + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute start_date + # The start date of the range of time applied for this line item's price. + # + # @return [Time] + required :start_date, Time + + # @!attribute sub_line_items + # For complex pricing structures, the line item can be broken down further in + # `sub_line_items`. + # + # @return [Array] + required :sub_line_items, + -> { Orb::ArrayOf[union: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem] } + + # @!attribute subtotal + # The line amount before any line item-specific discounts or minimums. + # + # @return [String] + required :subtotal, String + + # @!attribute tax_amounts + # An array of tax rates and their incurred tax amounts. Empty if no tax + # integration is configured. + # + # @return [Array] + required :tax_amounts, + -> { + Orb::ArrayOf[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::TaxAmount] + } + + # @!parse + # # @param id [String] + # # @param adjusted_subtotal [String] + # # @param adjustments [Array] + # # @param amount [String] + # # @param credits_applied [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param end_date [Time] + # # @param grouping [String, nil] + # # @param maximum [Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param minimum [Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param partially_invoiced_amount [String] + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice, nil] + # # @param quantity [Float] + # # @param start_date [Time] + # # @param sub_line_items [Array] + # # @param subtotal [String] + # # @param tax_amounts [Array] + # # + # def initialize( + # id:, + # adjusted_subtotal:, + # adjustments:, + # amount:, + # credits_applied:, + # discount:, + # end_date:, + # grouping:, + # maximum:, + # maximum_amount:, + # minimum:, + # minimum_amount:, + # name:, + # partially_invoiced_amount:, + # price:, + # quantity:, + # start_date:, + # sub_line_items:, + # subtotal:, + # tax_amounts:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "amount_discount", id: String, amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::AmountDiscountAdjustment ... + # in {adjustment_type: "percentage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::PercentageDiscountAdjustment ... + # in {adjustment_type: "usage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::UsageDiscountAdjustment ... + # in {adjustment_type: "minimum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::MinimumAdjustment ... + # in {adjustment_type: "maximum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::MaximumAdjustment ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::AmountDiscountAdjustment + # # ... + # in Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::PercentageDiscountAdjustment + # # ... + # in Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::UsageDiscountAdjustment + # # ... + # in Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::MinimumAdjustment + # # ... + # in Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::MaximumAdjustment + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :amount_discount, + -> { Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::AmountDiscountAdjustment } + + variant :percentage_discount, + -> { Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::PercentageDiscountAdjustment } + + variant :usage_discount, + -> { Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::UsageDiscountAdjustment } + + variant :minimum, + -> { Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::MinimumAdjustment } + + variant :maximum, + -> { Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::MaximumAdjustment } + + # @example + # ```ruby + # amount_discount_adjustment => { + # id: String, + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # **_ + # } + # ``` + class AmountDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # The amount by which to discount the prices this adjustment applies to in a given + # billing period. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize( + # id:, + # amount_discount:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # adjustment_type: :amount_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_adjustment => { + # id: String, + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # percentage_discount: Float, + # **_ + # } + # ``` + class PercentageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute percentage_discount + # The percentage (as a value between 0 and 1) by which to discount the price + # intervals this adjustment applies to in a given billing period. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param percentage_discount [Float] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # percentage_discount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_adjustment => { + # id: String, + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # plan_phase_order: Integer, + # **_ + # } + # ``` + class UsageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute usage_discount + # The number of usage units by which to discount the price this adjustment applies + # to in a given billing period. + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param usage_discount [Float] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # usage_discount:, + # adjustment_type: :usage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_adjustment => { + # id: String, + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # item_id: String, + # **_ + # } + # ``` + class MinimumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # item_id:, + # minimum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_adjustment => { + # id: String, + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # maximum_amount: String, + # **_ + # } + # ``` + class MaximumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param maximum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # maximum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :maximum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] required :maximum_amount, String + + # @!parse + # # This field is deprecated in favor of `adjustments`. + # # + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class Minimum < Orb::Model - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] minimum_amount + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] required :minimum_amount, String + + # @!parse + # # This field is deprecated in favor of `adjustments`. + # # + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class TaxAmounts < Orb::Model - # @!attribute [rw] amount + + # @abstract + # + # @example + # ```ruby + # case sub_line_item + # in {type: "matrix", amount: String, grouping: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::Grouping, matrix_config: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig} + # # Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem ... + # in {type: "tier", amount: String, grouping: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::Grouping, name: String} + # # Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem ... + # in {type: "'null'", amount: String, grouping: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem::Grouping, name: String} + # # Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem ... + # end + # ``` + # + # @example + # ```ruby + # case sub_line_item + # in Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem + # # ... + # in Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem + # # ... + # in Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem + # # ... + # end + # ``` + class SubLineItem < Orb::Union + discriminator :type + + variant :matrix, + -> { Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem } + + variant :tier, + -> { + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem + } + + variant :"'null'", + -> { Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem } + + # @example + # ```ruby + # matrix_sub_line_item => { + # amount: String, + # grouping: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::Grouping, + # matrix_config: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig, + # name: String, + # quantity: Float + # } + # ``` + class MatrixSubLineItem < Orb::BaseModel + # @!attribute amount + # The total amount for this sub line item. + # + # @return [String] + required :amount, String + + # @!attribute grouping + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::Grouping, nil] + required :grouping, + -> { + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::Grouping + }, + nil?: true + + # @!attribute matrix_config + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig] + required :matrix_config, + -> { Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig } + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute type + # + # @return [Symbol, :matrix] + required :type, const: :matrix + + # @!parse + # # @param amount [String] + # # @param grouping [Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::Grouping, nil] + # # @param matrix_config [Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig] + # # @param name [String] + # # @param quantity [Float] + # # @param type [Symbol, :matrix] + # # + # def initialize(amount:, grouping:, matrix_config:, name:, quantity:, type: :matrix, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # grouping => { + # key: String, + # value: String + # } + # ``` + class Grouping < Orb::BaseModel + # @!attribute key + # + # @return [String] + required :key, String + + # @!attribute value + # No value indicates the default group + # + # @return [String, nil] + required :value, String, nil?: true + + # @!parse + # # @param key [String] + # # @param value [String, nil] + # # + # def initialize(key:, value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # matrix_config => { + # dimension_values: -> { Orb::ArrayOf[String, nil?: true] === _1 } + # } + # ``` + class MatrixConfig < Orb::BaseModel + # @!attribute dimension_values + # The ordered dimension values for this line item. + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String, nil?: true] + + # @!parse + # # @param dimension_values [Array] + # # + # def initialize(dimension_values:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # tier_sub_line_item => { + # amount: String, + # grouping: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::Grouping, + # name: String, + # quantity: Float, + # tier_config: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::TierConfig + # } + # ``` + class TierSubLineItem < Orb::BaseModel + # @!attribute amount + # The total amount for this sub line item. + # + # @return [String] + required :amount, String + + # @!attribute grouping + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::Grouping, nil] + required :grouping, + -> { + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::Grouping + }, + nil?: true + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute tier_config + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::TierConfig] + required :tier_config, + -> { Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::TierConfig } + + # @!attribute type + # + # @return [Symbol, :tier] + required :type, const: :tier + + # @!parse + # # @param amount [String] + # # @param grouping [Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::Grouping, nil] + # # @param name [String] + # # @param quantity [Float] + # # @param tier_config [Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::TierConfig] + # # @param type [Symbol, :tier] + # # + # def initialize(amount:, grouping:, name:, quantity:, tier_config:, type: :tier, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # grouping => { + # key: String, + # value: String + # } + # ``` + class Grouping < Orb::BaseModel + # @!attribute key + # + # @return [String] + required :key, String + + # @!attribute value + # No value indicates the default group + # + # @return [String, nil] + required :value, String, nil?: true + + # @!parse + # # @param key [String] + # # @param value [String, nil] + # # + # def initialize(key:, value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # tier_config => { + # first_unit: Float, + # last_unit: Float, + # unit_amount: String + # } + # ``` + class TierConfig < Orb::BaseModel + # @!attribute first_unit + # + # @return [Float] + required :first_unit, Float + + # @!attribute last_unit + # + # @return [Float, nil] + required :last_unit, Float, nil?: true + + # @!attribute unit_amount + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param first_unit [Float] + # # @param last_unit [Float, nil] + # # @param unit_amount [String] + # # + # def initialize(first_unit:, last_unit:, unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # other_sub_line_item => { + # amount: String, + # grouping: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem::Grouping, + # name: String, + # quantity: Float, + # type: :"'null'" + # } + # ``` + class OtherSubLineItem < Orb::BaseModel + # @!attribute amount + # The total amount for this sub line item. + # + # @return [String] + required :amount, String + + # @!attribute grouping + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem::Grouping, nil] + required :grouping, + -> { + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem::Grouping + }, + nil?: true + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute type + # + # @return [Symbol, :"'null'"] + required :type, const: :"'null'" + + # @!parse + # # @param amount [String] + # # @param grouping [Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem::Grouping, nil] + # # @param name [String] + # # @param quantity [Float] + # # @param type [Symbol, :"'null'"] + # # + # def initialize(amount:, grouping:, name:, quantity:, type: :"'null'", **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # grouping => { + # key: String, + # value: String + # } + # ``` + class Grouping < Orb::BaseModel + # @!attribute key + # + # @return [String] + required :key, String + + # @!attribute value + # No value indicates the default group + # + # @return [String, nil] + required :value, String, nil?: true + + # @!parse + # # @param key [String] + # # @param value [String, nil] + # # + # def initialize(key:, value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # tax_amount => { + # amount: String, + # tax_rate_description: String, + # tax_rate_percentage: String + # } + # ``` + class TaxAmount < Orb::BaseModel + # @!attribute amount + # The amount of additional tax incurred by this tax rate. + # + # @return [String] required :amount, String - # @!attribute [rw] tax_rate_description + + # @!attribute tax_rate_description + # The human-readable description of the applied tax rate. + # + # @return [String] required :tax_rate_description, String - # @!attribute [rw] tax_rate_percentage - required :tax_rate_percentage, String + + # @!attribute tax_rate_percentage + # The tax rate percentage, out of 100. + # + # @return [String, nil] + required :tax_rate_percentage, String, nil?: true + + # @!parse + # # @param amount [String] + # # @param tax_rate_description [String] + # # @param tax_rate_percentage [String, nil] + # # + # def initialize(amount:, tax_rate_description:, tax_rate_percentage:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - # @!attribute [rw] id - required :id, String - # @!attribute [rw] amount - required :amount, String - # @!attribute [rw] discount - required :discount, Orb::Unknown - # @!attribute [rw] end_date - required :end_date, String - # @!attribute [rw] grouping - required :grouping, String - # @!attribute [rw] maximum - required :maximum, Maximum - # @!attribute [rw] maximum_amount - required :maximum_amount, String - # @!attribute [rw] minimum - required :minimum, Minimum - # @!attribute [rw] minimum_amount - required :minimum_amount, String - # @!attribute [rw] name_ - required :name_, String - # @!attribute [rw] price - required :price, Orb::Unknown - # @!attribute [rw] quantity - required :quantity, Float - # @!attribute [rw] start_date - required :start_date, String - # @!attribute [rw] sub_line_items - required :sub_line_items, Orb::ArrayOf.new(Orb::Unknown) - # @!attribute [rw] subtotal - required :subtotal, String - # @!attribute [rw] tax_amounts - required :tax_amounts, Orb::ArrayOf.new(TaxAmounts) end - class Maximum < Orb::Model - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] maximum_amount + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class Minimum < Orb::Model - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] minimum_amount + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class ShippingAddress < Orb::Model - # @!attribute [rw] city - required :city, String - # @!attribute [rw] country - required :country, String - # @!attribute [rw] line1 - required :line1, String - # @!attribute [rw] line2 - required :line2, String - # @!attribute [rw] postal_code - required :postal_code, String - # @!attribute [rw] state - required :state, String + + # @example + # ```ruby + # payment_attempt => { + # id: String, + # amount: String, + # created_at: Time, + # payment_provider: Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt::PaymentProvider, + # payment_provider_id: String + # } + # ``` + class PaymentAttempt < Orb::BaseModel + # @!attribute id + # The ID of the payment attempt. + # + # @return [String] + required :id, String + + # @!attribute amount + # The amount of the payment attempt. + # + # @return [String] + required :amount, String + + # @!attribute created_at + # The time at which the payment attempt was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute payment_provider + # The payment provider that attempted to collect the payment. + # + # @return [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt::PaymentProvider, nil] + required :payment_provider, + enum: -> { Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt::PaymentProvider }, + nil?: true + + # @!attribute payment_provider_id + # The ID of the payment attempt in the payment provider. + # + # @return [String, nil] + required :payment_provider_id, String, nil?: true + + # @!attribute succeeded + # Whether the payment attempt succeeded. + # + # @return [Boolean] + required :succeeded, Orb::BooleanModel + + # @!parse + # # @param id [String] + # # @param amount [String] + # # @param created_at [Time] + # # @param payment_provider [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt::PaymentProvider, nil] + # # @param payment_provider_id [String, nil] + # # @param succeeded [Boolean] + # # + # def initialize(id:, amount:, created_at:, payment_provider:, payment_provider_id:, succeeded:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The payment provider that attempted to collect the payment. + # + # @example + # ```ruby + # case payment_provider + # in :stripe + # # ... + # end + # ``` + class PaymentProvider < Orb::Enum + STRIPE = :stripe + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # shipping_address => { + # city: String, + # country: String, + # line1: String, + # line2: String, + # postal_code: String + # } + # ``` + class ShippingAddress < Orb::BaseModel + # @!attribute city + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute line1 + # + # @return [String, nil] + required :line1, String, nil?: true + + # @!attribute line2 + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute postal_code + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # + # @return [String, nil] + required :state, String, nil?: true + + # @!parse + # # @param city [String, nil] + # # @param country [String, nil] + # # @param line1 [String, nil] + # # @param line2 [String, nil] + # # @param postal_code [String, nil] + # # @param state [String, nil] + # # + # def initialize(city:, country:, line1:, line2:, postal_code:, state:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case status + # in :issued + # # ... + # in :paid + # # ... + # in :synced + # # ... + # in :void + # # ... + # in :draft + # # ... + # end + # ``` + class Status < Orb::Enum + ISSUED = :issued + PAID = :paid + SYNCED = :synced + VOID = :void + DRAFT = :draft + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end end - class Subscription < Orb::Model - # @!attribute [rw] id + + # @example + # ```ruby + # subscription => { + # id: String + # } + # ``` + class Subscription < Orb::BaseModel + # @!attribute id + # + # @return [String] required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - # @!attribute [rw] id - required :id, String - # @!attribute [rw] amount_due - required :amount_due, String - # @!attribute [rw] auto_collection - required :auto_collection, AutoCollection - # @!attribute [rw] billing_address - required :billing_address, BillingAddress - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] credit_notes - required :credit_notes, Orb::ArrayOf.new(CreditNotes) - # @!attribute [rw] currency - required :currency, String - # @!attribute [rw] customer - required :customer, Customer - # @!attribute [rw] customer_balance_transactions - required :customer_balance_transactions, - Orb::ArrayOf.new(CustomerBalanceTransactions) - # @!attribute [rw] customer_tax_id - required :customer_tax_id, CustomerTaxID - # @!attribute [rw] discount - required :discount, Orb::Unknown - # @!attribute [rw] discounts - required :discounts, Orb::ArrayOf.new(Orb::Unknown) - # @!attribute [rw] due_date - required :due_date, String - # @!attribute [rw] eligible_to_issue_at - required :eligible_to_issue_at, String - # @!attribute [rw] hosted_invoice_url - required :hosted_invoice_url, String - # @!attribute [rw] invoice_number - required :invoice_number, String - # @!attribute [rw] invoice_pdf - required :invoice_pdf, String - # @!attribute [rw] issue_failed_at - required :issue_failed_at, String - # @!attribute [rw] issued_at - required :issued_at, String - # @!attribute [rw] line_items - required :line_items, Orb::ArrayOf.new(LineItems) - # @!attribute [rw] maximum - required :maximum, Maximum - # @!attribute [rw] maximum_amount - required :maximum_amount, String - # @!attribute [rw] memo - required :memo, String - # @!attribute [rw] metadata - required :metadata, Orb::Unknown - # @!attribute [rw] minimum - required :minimum, Minimum - # @!attribute [rw] minimum_amount - required :minimum_amount, String - # @!attribute [rw] paid_at - required :paid_at, String - # @!attribute [rw] payment_failed_at - required :payment_failed_at, String - # @!attribute [rw] payment_started_at - required :payment_started_at, String - # @!attribute [rw] scheduled_issue_at - required :scheduled_issue_at, String - # @!attribute [rw] shipping_address - required :shipping_address, ShippingAddress - # @!attribute [rw] status - required :status, - Orb::Enum.new([:"issued", :"paid", :"synced", :"void", :"draft"]) - # @!attribute [rw] subscription - required :subscription, Subscription - # @!attribute [rw] subtotal - required :subtotal, String - # @!attribute [rw] sync_failed_at - required :sync_failed_at, String - # @!attribute [rw] target_date - required :target_date, String - # @!attribute [rw] total - required :total, String - # @!attribute [rw] voided_at - required :voided_at, String - # @!attribute [rw] will_auto_issue - required :will_auto_issue, Orb::BooleanModel end end end diff --git a/lib/orb/models/invoice_issue_params.rb b/lib/orb/models/invoice_issue_params.rb new file mode 100644 index 00000000..3aa31d2e --- /dev/null +++ b/lib/orb/models/invoice_issue_params.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Orb + module Models + class InvoiceIssueParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute [r] synchronous + # If true, the invoice will be issued synchronously. If false, the invoice will be + # issued asynchronously. The synchronous option is only available for invoices + # that have no usage fees. If the invoice is configured to sync to an external + # provider, a successful response from this endpoint guarantees the invoice is + # present in the provider. + # + # @return [Boolean, nil] + optional :synchronous, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :synchronous + + # @!parse + # # @param synchronous [Boolean] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(synchronous: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/invoice_level_discount.rb b/lib/orb/models/invoice_level_discount.rb new file mode 100644 index 00000000..1aed7932 --- /dev/null +++ b/lib/orb/models/invoice_level_discount.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Orb + module Models + # @abstract + # + # @example + # ```ruby + # case invoice_level_discount + # in {discount_type: "percentage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, percentage_discount: Float, reason: String} + # # Orb::Models::PercentageDiscount ... + # in {discount_type: "amount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, reason: String} + # # Orb::Models::AmountDiscount ... + # in {discount_type: "trial", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, reason: String, trial_amount_discount: String} + # # Orb::Models::TrialDiscount ... + # end + # ``` + # + # @example + # ```ruby + # case invoice_level_discount + # in Orb::Models::PercentageDiscount + # # ... + # in Orb::Models::AmountDiscount + # # ... + # in Orb::Models::TrialDiscount + # # ... + # end + # ``` + class InvoiceLevelDiscount < Orb::Union + discriminator :discount_type + + variant :percentage, -> { Orb::Models::PercentageDiscount } + + variant :amount, -> { Orb::Models::AmountDiscount } + + variant :trial, -> { Orb::Models::TrialDiscount } + end + end +end diff --git a/lib/orb/models/invoice_line_item_create_params.rb b/lib/orb/models/invoice_line_item_create_params.rb new file mode 100644 index 00000000..fbc7fb1c --- /dev/null +++ b/lib/orb/models/invoice_line_item_create_params.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +module Orb + module Models + class InvoiceLineItemCreateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute amount + # The total amount in the invoice's currency to add to the line item. + # + # @return [String] + required :amount, String + + # @!attribute end_date + # A date string to specify the line item's end date in the customer's timezone. + # + # @return [Date] + required :end_date, Date + + # @!attribute invoice_id + # The id of the Invoice to add this line item. + # + # @return [String] + required :invoice_id, String + + # @!attribute name + # The item name associated with this line item. If an item with the same name + # exists in Orb, that item will be associated with the line item. + # + # @return [String] + required :name, String + + # @!attribute quantity + # The number of units on the line item + # + # @return [Float] + required :quantity, Float + + # @!attribute start_date + # A date string to specify the line item's start date in the customer's timezone. + # + # @return [Date] + required :start_date, Date + + # @!parse + # # @param amount [String] + # # @param end_date [Date] + # # @param invoice_id [String] + # # @param name [String] + # # @param quantity [Float] + # # @param start_date [Date] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(amount:, end_date:, invoice_id:, name:, quantity:, start_date:, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/invoice_line_item_create_response.rb b/lib/orb/models/invoice_line_item_create_response.rb index 113d20d8..6bc43e64 100644 --- a/lib/orb/models/invoice_line_item_create_response.rb +++ b/lib/orb/models/invoice_line_item_create_response.rb @@ -1,59 +1,1101 @@ -require "orb/model" +# frozen_string_literal: true + module Orb module Models - class InvoiceLineItemCreateResponse < Orb::Model - class Maximum < Orb::Model - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] maximum_amount + # @example + # ```ruby + # invoice_line_item_create_response => { + # id: String, + # adjusted_subtotal: String, + # adjustments: -> { Orb::ArrayOf[union: Orb::Models::InvoiceLineItemCreateResponse::Adjustment] === _1 }, + # amount: String, + # credits_applied: String, + # **_ + # } + # ``` + class InvoiceLineItemCreateResponse < Orb::BaseModel + # @!attribute id + # A unique ID for this line item. + # + # @return [String] + required :id, String + + # @!attribute adjusted_subtotal + # The line amount after any adjustments, before overage conversion, credits and + # partial invoicing. + # + # @return [String] + required :adjusted_subtotal, String + + # @!attribute adjustments + # All adjustments applied to the line item. + # + # @return [Array] + required :adjustments, + -> { + Orb::ArrayOf[union: Orb::Models::InvoiceLineItemCreateResponse::Adjustment] + } + + # @!attribute amount + # The final amount after any discounts or minimums. + # + # @return [String] + required :amount, String + + # @!attribute credits_applied + # The number of credits used + # + # @return [String] + required :credits_applied, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute end_date + # The end date of the range of time applied for this line item's price. + # + # @return [Time] + required :end_date, Time + + # @!attribute grouping + # [DEPRECATED] For configured prices that are split by a grouping key, this will + # be populated with the key and a value. The `amount` and `subtotal` will be the + # values for this particular grouping. + # + # @return [String, nil] + required :grouping, String, nil?: true + + # @!attribute maximum + # This field is deprecated in favor of `adjustments`. + # + # @return [Orb::Models::InvoiceLineItemCreateResponse::Maximum, nil] + required :maximum, -> { Orb::Models::InvoiceLineItemCreateResponse::Maximum }, nil?: true + + # @!attribute maximum_amount + # This field is deprecated in favor of `adjustments`. + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute minimum + # This field is deprecated in favor of `adjustments`. + # + # @return [Orb::Models::InvoiceLineItemCreateResponse::Minimum, nil] + required :minimum, -> { Orb::Models::InvoiceLineItemCreateResponse::Minimum }, nil?: true + + # @!attribute minimum_amount + # This field is deprecated in favor of `adjustments`. + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute name + # The name of the price associated with this line item. + # + # @return [String] + required :name, String + + # @!attribute partially_invoiced_amount + # Any amount applied from a partial invoice + # + # @return [String] + required :partially_invoiced_amount, String + + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice, nil] + required :price, union: -> { Orb::Models::Price }, nil?: true + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute start_date + # The start date of the range of time applied for this line item's price. + # + # @return [Time] + required :start_date, Time + + # @!attribute sub_line_items + # For complex pricing structures, the line item can be broken down further in + # `sub_line_items`. + # + # @return [Array] + required :sub_line_items, + -> { Orb::ArrayOf[union: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem] } + + # @!attribute subtotal + # The line amount before any line item-specific discounts or minimums. + # + # @return [String] + required :subtotal, String + + # @!attribute tax_amounts + # An array of tax rates and their incurred tax amounts. Empty if no tax + # integration is configured. + # + # @return [Array] + required :tax_amounts, -> { Orb::ArrayOf[Orb::Models::InvoiceLineItemCreateResponse::TaxAmount] } + + # @!parse + # # @param id [String] + # # @param adjusted_subtotal [String] + # # @param adjustments [Array] + # # @param amount [String] + # # @param credits_applied [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param end_date [Time] + # # @param grouping [String, nil] + # # @param maximum [Orb::Models::InvoiceLineItemCreateResponse::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param minimum [Orb::Models::InvoiceLineItemCreateResponse::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param partially_invoiced_amount [String] + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice, nil] + # # @param quantity [Float] + # # @param start_date [Time] + # # @param sub_line_items [Array] + # # @param subtotal [String] + # # @param tax_amounts [Array] + # # + # def initialize( + # id:, + # adjusted_subtotal:, + # adjustments:, + # amount:, + # credits_applied:, + # discount:, + # end_date:, + # grouping:, + # maximum:, + # maximum_amount:, + # minimum:, + # minimum_amount:, + # name:, + # partially_invoiced_amount:, + # price:, + # quantity:, + # start_date:, + # sub_line_items:, + # subtotal:, + # tax_amounts:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "amount_discount", id: String, amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::InvoiceLineItemCreateResponse::Adjustment::AmountDiscountAdjustment ... + # in {adjustment_type: "percentage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::InvoiceLineItemCreateResponse::Adjustment::PercentageDiscountAdjustment ... + # in {adjustment_type: "usage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::InvoiceLineItemCreateResponse::Adjustment::UsageDiscountAdjustment ... + # in {adjustment_type: "minimum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::InvoiceLineItemCreateResponse::Adjustment::MinimumAdjustment ... + # in {adjustment_type: "maximum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::InvoiceLineItemCreateResponse::Adjustment::MaximumAdjustment ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::InvoiceLineItemCreateResponse::Adjustment::AmountDiscountAdjustment + # # ... + # in Orb::Models::InvoiceLineItemCreateResponse::Adjustment::PercentageDiscountAdjustment + # # ... + # in Orb::Models::InvoiceLineItemCreateResponse::Adjustment::UsageDiscountAdjustment + # # ... + # in Orb::Models::InvoiceLineItemCreateResponse::Adjustment::MinimumAdjustment + # # ... + # in Orb::Models::InvoiceLineItemCreateResponse::Adjustment::MaximumAdjustment + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :amount_discount, + -> { Orb::Models::InvoiceLineItemCreateResponse::Adjustment::AmountDiscountAdjustment } + + variant :percentage_discount, + -> { Orb::Models::InvoiceLineItemCreateResponse::Adjustment::PercentageDiscountAdjustment } + + variant :usage_discount, + -> { Orb::Models::InvoiceLineItemCreateResponse::Adjustment::UsageDiscountAdjustment } + + variant :minimum, -> { Orb::Models::InvoiceLineItemCreateResponse::Adjustment::MinimumAdjustment } + + variant :maximum, -> { Orb::Models::InvoiceLineItemCreateResponse::Adjustment::MaximumAdjustment } + + # @example + # ```ruby + # amount_discount_adjustment => { + # id: String, + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # **_ + # } + # ``` + class AmountDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # The amount by which to discount the prices this adjustment applies to in a given + # billing period. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize( + # id:, + # amount_discount:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # adjustment_type: :amount_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_adjustment => { + # id: String, + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # percentage_discount: Float, + # **_ + # } + # ``` + class PercentageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute percentage_discount + # The percentage (as a value between 0 and 1) by which to discount the price + # intervals this adjustment applies to in a given billing period. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param percentage_discount [Float] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # percentage_discount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_adjustment => { + # id: String, + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # plan_phase_order: Integer, + # **_ + # } + # ``` + class UsageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute usage_discount + # The number of usage units by which to discount the price this adjustment applies + # to in a given billing period. + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param usage_discount [Float] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # usage_discount:, + # adjustment_type: :usage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_adjustment => { + # id: String, + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # item_id: String, + # **_ + # } + # ``` + class MinimumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # item_id:, + # minimum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_adjustment => { + # id: String, + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # maximum_amount: String, + # **_ + # } + # ``` + class MaximumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param maximum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # maximum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :maximum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] required :maximum_amount, String + + # @!parse + # # This field is deprecated in favor of `adjustments`. + # # + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class Minimum < Orb::Model - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] minimum_amount + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] required :minimum_amount, String + + # @!parse + # # This field is deprecated in favor of `adjustments`. + # # + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class TaxAmounts < Orb::Model - # @!attribute [rw] amount + + # @abstract + # + # @example + # ```ruby + # case sub_line_item + # in {type: "matrix", amount: String, grouping: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::Grouping, matrix_config: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::MatrixConfig} + # # Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem ... + # in {type: "tier", amount: String, grouping: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::Grouping, name: String} + # # Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem ... + # in {type: "'null'", amount: String, grouping: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem::Grouping, name: String} + # # Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem ... + # end + # ``` + # + # @example + # ```ruby + # case sub_line_item + # in Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem + # # ... + # in Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem + # # ... + # in Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem + # # ... + # end + # ``` + class SubLineItem < Orb::Union + discriminator :type + + variant :matrix, -> { Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem } + + variant :tier, -> { Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem } + + variant :"'null'", -> { Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem } + + # @example + # ```ruby + # matrix_sub_line_item => { + # amount: String, + # grouping: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::Grouping, + # matrix_config: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::MatrixConfig, + # name: String, + # quantity: Float + # } + # ``` + class MatrixSubLineItem < Orb::BaseModel + # @!attribute amount + # The total amount for this sub line item. + # + # @return [String] + required :amount, String + + # @!attribute grouping + # + # @return [Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::Grouping, nil] + required :grouping, + -> { + Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::Grouping + }, + nil?: true + + # @!attribute matrix_config + # + # @return [Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::MatrixConfig] + required :matrix_config, + -> { Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::MatrixConfig } + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute type + # + # @return [Symbol, :matrix] + required :type, const: :matrix + + # @!parse + # # @param amount [String] + # # @param grouping [Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::Grouping, nil] + # # @param matrix_config [Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::MatrixConfig] + # # @param name [String] + # # @param quantity [Float] + # # @param type [Symbol, :matrix] + # # + # def initialize(amount:, grouping:, matrix_config:, name:, quantity:, type: :matrix, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # grouping => { + # key: String, + # value: String + # } + # ``` + class Grouping < Orb::BaseModel + # @!attribute key + # + # @return [String] + required :key, String + + # @!attribute value + # No value indicates the default group + # + # @return [String, nil] + required :value, String, nil?: true + + # @!parse + # # @param key [String] + # # @param value [String, nil] + # # + # def initialize(key:, value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # matrix_config => { + # dimension_values: -> { Orb::ArrayOf[String, nil?: true] === _1 } + # } + # ``` + class MatrixConfig < Orb::BaseModel + # @!attribute dimension_values + # The ordered dimension values for this line item. + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String, nil?: true] + + # @!parse + # # @param dimension_values [Array] + # # + # def initialize(dimension_values:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # tier_sub_line_item => { + # amount: String, + # grouping: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::Grouping, + # name: String, + # quantity: Float, + # tier_config: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::TierConfig + # } + # ``` + class TierSubLineItem < Orb::BaseModel + # @!attribute amount + # The total amount for this sub line item. + # + # @return [String] + required :amount, String + + # @!attribute grouping + # + # @return [Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::Grouping, nil] + required :grouping, + -> { Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::Grouping }, + nil?: true + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute tier_config + # + # @return [Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::TierConfig] + required :tier_config, + -> { Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::TierConfig } + + # @!attribute type + # + # @return [Symbol, :tier] + required :type, const: :tier + + # @!parse + # # @param amount [String] + # # @param grouping [Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::Grouping, nil] + # # @param name [String] + # # @param quantity [Float] + # # @param tier_config [Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::TierConfig] + # # @param type [Symbol, :tier] + # # + # def initialize(amount:, grouping:, name:, quantity:, tier_config:, type: :tier, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # grouping => { + # key: String, + # value: String + # } + # ``` + class Grouping < Orb::BaseModel + # @!attribute key + # + # @return [String] + required :key, String + + # @!attribute value + # No value indicates the default group + # + # @return [String, nil] + required :value, String, nil?: true + + # @!parse + # # @param key [String] + # # @param value [String, nil] + # # + # def initialize(key:, value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # tier_config => { + # first_unit: Float, + # last_unit: Float, + # unit_amount: String + # } + # ``` + class TierConfig < Orb::BaseModel + # @!attribute first_unit + # + # @return [Float] + required :first_unit, Float + + # @!attribute last_unit + # + # @return [Float, nil] + required :last_unit, Float, nil?: true + + # @!attribute unit_amount + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param first_unit [Float] + # # @param last_unit [Float, nil] + # # @param unit_amount [String] + # # + # def initialize(first_unit:, last_unit:, unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # other_sub_line_item => { + # amount: String, + # grouping: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem::Grouping, + # name: String, + # quantity: Float, + # type: :"'null'" + # } + # ``` + class OtherSubLineItem < Orb::BaseModel + # @!attribute amount + # The total amount for this sub line item. + # + # @return [String] + required :amount, String + + # @!attribute grouping + # + # @return [Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem::Grouping, nil] + required :grouping, + -> { Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem::Grouping }, + nil?: true + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute type + # + # @return [Symbol, :"'null'"] + required :type, const: :"'null'" + + # @!parse + # # @param amount [String] + # # @param grouping [Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem::Grouping, nil] + # # @param name [String] + # # @param quantity [Float] + # # @param type [Symbol, :"'null'"] + # # + # def initialize(amount:, grouping:, name:, quantity:, type: :"'null'", **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # grouping => { + # key: String, + # value: String + # } + # ``` + class Grouping < Orb::BaseModel + # @!attribute key + # + # @return [String] + required :key, String + + # @!attribute value + # No value indicates the default group + # + # @return [String, nil] + required :value, String, nil?: true + + # @!parse + # # @param key [String] + # # @param value [String, nil] + # # + # def initialize(key:, value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # tax_amount => { + # amount: String, + # tax_rate_description: String, + # tax_rate_percentage: String + # } + # ``` + class TaxAmount < Orb::BaseModel + # @!attribute amount + # The amount of additional tax incurred by this tax rate. + # + # @return [String] required :amount, String - # @!attribute [rw] tax_rate_description + + # @!attribute tax_rate_description + # The human-readable description of the applied tax rate. + # + # @return [String] required :tax_rate_description, String - # @!attribute [rw] tax_rate_percentage - required :tax_rate_percentage, String + + # @!attribute tax_rate_percentage + # The tax rate percentage, out of 100. + # + # @return [String, nil] + required :tax_rate_percentage, String, nil?: true + + # @!parse + # # @param amount [String] + # # @param tax_rate_description [String] + # # @param tax_rate_percentage [String, nil] + # # + # def initialize(amount:, tax_rate_description:, tax_rate_percentage:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - # @!attribute [rw] id - required :id, String - # @!attribute [rw] amount - required :amount, String - # @!attribute [rw] discount - required :discount, Orb::Unknown - # @!attribute [rw] end_date - required :end_date, String - # @!attribute [rw] grouping - required :grouping, String - # @!attribute [rw] maximum - required :maximum, Maximum - # @!attribute [rw] maximum_amount - required :maximum_amount, String - # @!attribute [rw] minimum - required :minimum, Minimum - # @!attribute [rw] minimum_amount - required :minimum_amount, String - # @!attribute [rw] name_ - required :name_, String - # @!attribute [rw] price - required :price, Orb::Unknown - # @!attribute [rw] quantity - required :quantity, Float - # @!attribute [rw] start_date - required :start_date, String - # @!attribute [rw] sub_line_items - required :sub_line_items, Orb::ArrayOf.new(Orb::Unknown) - # @!attribute [rw] subtotal - required :subtotal, String - # @!attribute [rw] tax_amounts - required :tax_amounts, Orb::ArrayOf.new(TaxAmounts) end end end diff --git a/lib/orb/models/invoice_list_params.rb b/lib/orb/models/invoice_list_params.rb new file mode 100644 index 00000000..dcb8a83f --- /dev/null +++ b/lib/orb/models/invoice_list_params.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +module Orb + module Models + class InvoiceListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute amount + # + # @return [String, nil] + optional :amount, String, nil?: true + + # @!attribute amount_gt + # + # @return [String, nil] + optional :amount_gt, String, api_name: :"amount[gt]", nil?: true + + # @!attribute amount_lt + # + # @return [String, nil] + optional :amount_lt, String, api_name: :"amount[lt]", nil?: true + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute customer_id + # + # @return [String, nil] + optional :customer_id, String, nil?: true + + # @!attribute date_type + # + # @return [Symbol, Orb::Models::InvoiceListParams::DateType, nil] + optional :date_type, enum: -> { Orb::Models::InvoiceListParams::DateType }, nil?: true + + # @!attribute due_date + # + # @return [Date, nil] + optional :due_date, Date, nil?: true + + # @!attribute due_date_window + # Filters invoices by their due dates within a specific time range in the past. + # Specify the range as a number followed by 'd' (days) or 'm' (months). For + # example, '7d' filters invoices due in the last 7 days, and '2m' filters those + # due in the last 2 months. + # + # @return [String, nil] + optional :due_date_window, String, nil?: true + + # @!attribute due_date_gt + # + # @return [Date, nil] + optional :due_date_gt, Date, api_name: :"due_date[gt]", nil?: true + + # @!attribute due_date_lt + # + # @return [Date, nil] + optional :due_date_lt, Date, api_name: :"due_date[lt]", nil?: true + + # @!attribute external_customer_id + # + # @return [String, nil] + optional :external_customer_id, String, nil?: true + + # @!attribute invoice_date_gt + # + # @return [Time, nil] + optional :invoice_date_gt, Time, api_name: :"invoice_date[gt]", nil?: true + + # @!attribute invoice_date_gte + # + # @return [Time, nil] + optional :invoice_date_gte, Time, api_name: :"invoice_date[gte]", nil?: true + + # @!attribute invoice_date_lt + # + # @return [Time, nil] + optional :invoice_date_lt, Time, api_name: :"invoice_date[lt]", nil?: true + + # @!attribute invoice_date_lte + # + # @return [Time, nil] + optional :invoice_date_lte, Time, api_name: :"invoice_date[lte]", nil?: true + + # @!attribute is_recurring + # + # @return [Boolean, nil] + optional :is_recurring, Orb::BooleanModel, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!attribute status + # + # @return [Array, nil] + optional :status, -> { Orb::ArrayOf[enum: Orb::Models::InvoiceListParams::Status] }, nil?: true + + # @!attribute subscription_id + # + # @return [String, nil] + optional :subscription_id, String, nil?: true + + # @!parse + # # @param amount [String, nil] + # # @param amount_gt [String, nil] + # # @param amount_lt [String, nil] + # # @param cursor [String, nil] + # # @param customer_id [String, nil] + # # @param date_type [Symbol, Orb::Models::InvoiceListParams::DateType, nil] + # # @param due_date [Date, nil] + # # @param due_date_window [String, nil] + # # @param due_date_gt [Date, nil] + # # @param due_date_lt [Date, nil] + # # @param external_customer_id [String, nil] + # # @param invoice_date_gt [Time, nil] + # # @param invoice_date_gte [Time, nil] + # # @param invoice_date_lt [Time, nil] + # # @param invoice_date_lte [Time, nil] + # # @param is_recurring [Boolean, nil] + # # @param limit [Integer] + # # @param status [Array, nil] + # # @param subscription_id [String, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # amount: nil, + # amount_gt: nil, + # amount_lt: nil, + # cursor: nil, + # customer_id: nil, + # date_type: nil, + # due_date: nil, + # due_date_window: nil, + # due_date_gt: nil, + # due_date_lt: nil, + # external_customer_id: nil, + # invoice_date_gt: nil, + # invoice_date_gte: nil, + # invoice_date_lt: nil, + # invoice_date_lte: nil, + # is_recurring: nil, + # limit: nil, + # status: nil, + # subscription_id: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case date_type + # in :due_date + # # ... + # in :invoice_date + # # ... + # end + # ``` + class DateType < Orb::Enum + DUE_DATE = :due_date + INVOICE_DATE = :invoice_date + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # @example + # ```ruby + # case status + # in :draft + # # ... + # in :issued + # # ... + # in :paid + # # ... + # in :synced + # # ... + # in :void + # # ... + # end + # ``` + class Status < Orb::Enum + DRAFT = :draft + ISSUED = :issued + PAID = :paid + SYNCED = :synced + VOID = :void + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/orb/models/invoice_mark_paid_params.rb b/lib/orb/models/invoice_mark_paid_params.rb new file mode 100644 index 00000000..1173d252 --- /dev/null +++ b/lib/orb/models/invoice_mark_paid_params.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Orb + module Models + class InvoiceMarkPaidParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute payment_received_date + # A date string to specify the date of the payment. + # + # @return [Date] + required :payment_received_date, Date + + # @!attribute external_id + # An optional external ID to associate with the payment. + # + # @return [String, nil] + optional :external_id, String, nil?: true + + # @!attribute notes + # An optional note to associate with the payment. + # + # @return [String, nil] + optional :notes, String, nil?: true + + # @!parse + # # @param payment_received_date [Date] + # # @param external_id [String, nil] + # # @param notes [String, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(payment_received_date:, external_id: nil, notes: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/invoice_pay_params.rb b/lib/orb/models/invoice_pay_params.rb new file mode 100644 index 00000000..ed8cd542 --- /dev/null +++ b/lib/orb/models/invoice_pay_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class InvoicePayParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/invoice_update_params.rb b/lib/orb/models/invoice_update_params.rb new file mode 100644 index 00000000..767b4ea0 --- /dev/null +++ b/lib/orb/models/invoice_update_params.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Orb + module Models + class InvoiceUpdateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/invoice_void_params.rb b/lib/orb/models/invoice_void_params.rb new file mode 100644 index 00000000..9953e3d5 --- /dev/null +++ b/lib/orb/models/invoice_void_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class InvoiceVoidParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/item.rb b/lib/orb/models/item.rb index 6083c9a5..a59f512e 100644 --- a/lib/orb/models/item.rb +++ b/lib/orb/models/item.rb @@ -1,32 +1,114 @@ -require "orb/model" +# frozen_string_literal: true + module Orb module Models - class Item < Orb::Model - class ExternalConnections < Orb::Model - # @!attribute [rw] external_connection_name + # @example + # ```ruby + # item => { + # id: String, + # created_at: Time, + # external_connections: -> { Orb::ArrayOf[Orb::Models::Item::ExternalConnection] === _1 }, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute external_connections + # + # @return [Array] + required :external_connections, -> { Orb::ArrayOf[Orb::Models::Item::ExternalConnection] } + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # The Item resource represents a sellable product or good. Items are associated + # # with all line items, billable metrics, and prices and are used for defining + # # external sync behavior for invoices and tax calculation purposes. + # # + # # @param id [String] + # # @param created_at [Time] + # # @param external_connections [Array] + # # @param name [String] + # # + # def initialize(id:, created_at:, external_connections:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # external_connection => { + # external_connection_name: Orb::Models::Item::ExternalConnection::ExternalConnectionName, + # external_entity_id: String + # } + # ``` + class ExternalConnection < Orb::BaseModel + # @!attribute external_connection_name + # + # @return [Symbol, Orb::Models::Item::ExternalConnection::ExternalConnectionName] required :external_connection_name, - Orb::Enum.new( - [ - :"stripe", - :"quickbooks", - :"bill.com", - :"netsuite", - :"taxjar", - :"avalara", - :"anrok" - ] - ) - # @!attribute [rw] external_entity_id + enum: -> { Orb::Models::Item::ExternalConnection::ExternalConnectionName } + + # @!attribute external_entity_id + # + # @return [String] required :external_entity_id, String + + # @!parse + # # @param external_connection_name [Symbol, Orb::Models::Item::ExternalConnection::ExternalConnectionName] + # # @param external_entity_id [String] + # # + # def initialize(external_connection_name:, external_entity_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case external_connection_name + # in :stripe + # # ... + # in :quickbooks + # # ... + # in :"bill.com" + # # ... + # in :netsuite + # # ... + # in :taxjar + # # ... + # in ... + # #... + # end + # ``` + class ExternalConnectionName < Orb::Enum + STRIPE = :stripe + QUICKBOOKS = :quickbooks + BILL_COM = :"bill.com" + NETSUITE = :netsuite + TAXJAR = :taxjar + AVALARA = :avalara + ANROK = :anrok + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end end - # @!attribute [rw] id - required :id, String - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] external_connections - required :external_connections, Orb::ArrayOf.new(ExternalConnections) - # @!attribute [rw] name_ - required :name_, String end end end diff --git a/lib/orb/models/item_create_params.rb b/lib/orb/models/item_create_params.rb new file mode 100644 index 00000000..d28b406f --- /dev/null +++ b/lib/orb/models/item_create_params.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Orb + module Models + class ItemCreateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute name + # The name of the item. + # + # @return [String] + required :name, String + + # @!parse + # # @param name [String] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(name:, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/item_fetch_params.rb b/lib/orb/models/item_fetch_params.rb new file mode 100644 index 00000000..bb1827f8 --- /dev/null +++ b/lib/orb/models/item_fetch_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class ItemFetchParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/item_list_params.rb b/lib/orb/models/item_list_params.rb new file mode 100644 index 00000000..c63d0652 --- /dev/null +++ b/lib/orb/models/item_list_params.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Orb + module Models + class ItemListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!parse + # # @param cursor [String, nil] + # # @param limit [Integer] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(cursor: nil, limit: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/item_update_params.rb b/lib/orb/models/item_update_params.rb new file mode 100644 index 00000000..9e04c243 --- /dev/null +++ b/lib/orb/models/item_update_params.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +module Orb + module Models + class ItemUpdateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute external_connections + # + # @return [Array, nil] + optional :external_connections, + -> { Orb::ArrayOf[Orb::Models::ItemUpdateParams::ExternalConnection] }, + nil?: true + + # @!attribute name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!parse + # # @param external_connections [Array, nil] + # # @param name [String, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(external_connections: nil, name: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # external_connection => { + # external_connection_name: Orb::Models::ItemUpdateParams::ExternalConnection::ExternalConnectionName, + # external_entity_id: String + # } + # ``` + class ExternalConnection < Orb::BaseModel + # @!attribute external_connection_name + # + # @return [Symbol, Orb::Models::ItemUpdateParams::ExternalConnection::ExternalConnectionName] + required :external_connection_name, + enum: -> { Orb::Models::ItemUpdateParams::ExternalConnection::ExternalConnectionName } + + # @!attribute external_entity_id + # + # @return [String] + required :external_entity_id, String + + # @!parse + # # @param external_connection_name [Symbol, Orb::Models::ItemUpdateParams::ExternalConnection::ExternalConnectionName] + # # @param external_entity_id [String] + # # + # def initialize(external_connection_name:, external_entity_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case external_connection_name + # in :stripe + # # ... + # in :quickbooks + # # ... + # in :"bill.com" + # # ... + # in :netsuite + # # ... + # in :taxjar + # # ... + # in ... + # #... + # end + # ``` + class ExternalConnectionName < Orb::Enum + STRIPE = :stripe + QUICKBOOKS = :quickbooks + BILL_COM = :"bill.com" + NETSUITE = :netsuite + TAXJAR = :taxjar + AVALARA = :avalara + ANROK = :anrok + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/metric_create_params.rb b/lib/orb/models/metric_create_params.rb new file mode 100644 index 00000000..2d0eb8a9 --- /dev/null +++ b/lib/orb/models/metric_create_params.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module Orb + module Models + class MetricCreateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute description + # A description of the metric. + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute item_id + # The id of the item + # + # @return [String] + required :item_id, String + + # @!attribute name + # The name of the metric. + # + # @return [String] + required :name, String + + # @!attribute sql + # A sql string defining the metric. + # + # @return [String] + required :sql, String + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param description [String, nil] + # # @param item_id [String] + # # @param name [String] + # # @param sql [String] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(description:, item_id:, name:, sql:, metadata: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/metric_create_response.rb b/lib/orb/models/metric_create_response.rb deleted file mode 100644 index 16b92b63..00000000 --- a/lib/orb/models/metric_create_response.rb +++ /dev/null @@ -1,20 +0,0 @@ -require "orb/model" -require "orb/models/item" -module Orb - module Models - class MetricCreateResponse < Orb::Model - # @!attribute [rw] id - required :id, String - # @!attribute [rw] description - required :description, String - # @!attribute [rw] item - required :item, Orb::Models::Item - # @!attribute [rw] metadata - required :metadata, Hash - # @!attribute [rw] name_ - required :name_, String - # @!attribute [rw] status - required :status, Orb::Enum.new([:"active", :"draft", :"archived"]) - end - end -end diff --git a/lib/orb/models/metric_fetch_params.rb b/lib/orb/models/metric_fetch_params.rb new file mode 100644 index 00000000..3db09c6c --- /dev/null +++ b/lib/orb/models/metric_fetch_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class MetricFetchParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/metric_fetch_response.rb b/lib/orb/models/metric_fetch_response.rb deleted file mode 100644 index e870d864..00000000 --- a/lib/orb/models/metric_fetch_response.rb +++ /dev/null @@ -1,20 +0,0 @@ -require "orb/model" -require "orb/models/item" -module Orb - module Models - class MetricFetchResponse < Orb::Model - # @!attribute [rw] id - required :id, String - # @!attribute [rw] description - required :description, String - # @!attribute [rw] item - required :item, Orb::Models::Item - # @!attribute [rw] metadata - required :metadata, Hash - # @!attribute [rw] name_ - required :name_, String - # @!attribute [rw] status - required :status, Orb::Enum.new([:"active", :"draft", :"archived"]) - end - end -end diff --git a/lib/orb/models/metric_list_params.rb b/lib/orb/models/metric_list_params.rb new file mode 100644 index 00000000..c56b6992 --- /dev/null +++ b/lib/orb/models/metric_list_params.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +module Orb + module Models + class MetricListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute created_at_gt + # + # @return [Time, nil] + optional :created_at_gt, Time, api_name: :"created_at[gt]", nil?: true + + # @!attribute created_at_gte + # + # @return [Time, nil] + optional :created_at_gte, Time, api_name: :"created_at[gte]", nil?: true + + # @!attribute created_at_lt + # + # @return [Time, nil] + optional :created_at_lt, Time, api_name: :"created_at[lt]", nil?: true + + # @!attribute created_at_lte + # + # @return [Time, nil] + optional :created_at_lte, Time, api_name: :"created_at[lte]", nil?: true + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!parse + # # @param created_at_gt [Time, nil] + # # @param created_at_gte [Time, nil] + # # @param created_at_lt [Time, nil] + # # @param created_at_lte [Time, nil] + # # @param cursor [String, nil] + # # @param limit [Integer] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # created_at_gt: nil, + # created_at_gte: nil, + # created_at_lt: nil, + # created_at_lte: nil, + # cursor: nil, + # limit: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/metric_list_response.rb b/lib/orb/models/metric_list_response.rb deleted file mode 100644 index c51c1529..00000000 --- a/lib/orb/models/metric_list_response.rb +++ /dev/null @@ -1,20 +0,0 @@ -require "orb/model" -require "orb/models/item" -module Orb - module Models - class MetricListResponse < Orb::Model - # @!attribute [rw] id - required :id, String - # @!attribute [rw] description - required :description, String - # @!attribute [rw] item - required :item, Orb::Models::Item - # @!attribute [rw] metadata - required :metadata, Hash - # @!attribute [rw] name_ - required :name_, String - # @!attribute [rw] status - required :status, Orb::Enum.new([:"active", :"draft", :"archived"]) - end - end -end diff --git a/lib/orb/models/metric_update_params.rb b/lib/orb/models/metric_update_params.rb new file mode 100644 index 00000000..e1a99e89 --- /dev/null +++ b/lib/orb/models/metric_update_params.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Orb + module Models + class MetricUpdateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/pagination_metadata.rb b/lib/orb/models/pagination_metadata.rb new file mode 100644 index 00000000..0da216cd --- /dev/null +++ b/lib/orb/models/pagination_metadata.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # pagination_metadata => { + # has_more: Orb::BooleanModel, + # next_cursor: String + # } + # ``` + class PaginationMetadata < Orb::BaseModel + # @!attribute has_more + # + # @return [Boolean] + required :has_more, Orb::BooleanModel + + # @!attribute next_cursor + # + # @return [String, nil] + required :next_cursor, String, nil?: true + + # @!parse + # # @param has_more [Boolean] + # # @param next_cursor [String, nil] + # # + # def initialize(has_more:, next_cursor:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/percentage_discount.rb b/lib/orb/models/percentage_discount.rb new file mode 100644 index 00000000..1b0c442d --- /dev/null +++ b/lib/orb/models/percentage_discount.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # percentage_discount => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: Orb::Models::PercentageDiscount::DiscountType, + # percentage_discount: Float, + # reason: String + # } + # ``` + class PercentageDiscount < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this discount applies to. For plan/plan phase discounts, + # this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, Orb::Models::PercentageDiscount::DiscountType] + required :discount_type, enum: -> { Orb::Models::PercentageDiscount::DiscountType } + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`. This is a number between 0 + # and 1. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute reason + # + # @return [String, nil] + optional :reason, String, nil?: true + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param discount_type [Symbol, Orb::Models::PercentageDiscount::DiscountType] + # # @param percentage_discount [Float] + # # @param reason [String, nil] + # # + # def initialize(applies_to_price_ids:, discount_type:, percentage_discount:, reason: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case discount_type + # in :percentage + # # ... + # end + # ``` + class DiscountType < Orb::Enum + PERCENTAGE = :percentage + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/orb/models/plan.rb b/lib/orb/models/plan.rb index 1207abd5..6c346d30 100644 --- a/lib/orb/models/plan.rb +++ b/lib/orb/models/plan.rb @@ -1,122 +1,1074 @@ -require "orb/model" +# frozen_string_literal: true + module Orb module Models - class Plan < Orb::Model - class BasePlan < Orb::Model - # @!attribute [rw] id - required :id, String - # @!attribute [rw] external_plan_id - required :external_plan_id, String - # @!attribute [rw] name_ - required :name_, String + # @example + # ```ruby + # plan => { + # id: String, + # adjustments: -> { Orb::ArrayOf[union: Orb::Models::Plan::Adjustment] === _1 }, + # base_plan: Orb::Models::Plan::BasePlan, + # base_plan_id: String, + # created_at: Time, + # **_ + # } + # ``` + class Plan < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustments + # Adjustments for this plan. If the plan has phases, this includes adjustments + # across all phases of the plan. + # + # @return [Array] + required :adjustments, -> { Orb::ArrayOf[union: Orb::Models::Plan::Adjustment] } + + # @!attribute base_plan + # + # @return [Orb::Models::Plan::BasePlan, nil] + required :base_plan, -> { Orb::Models::Plan::BasePlan }, nil?: true + + # @!attribute base_plan_id + # The parent plan id if the given plan was created by overriding one or more of + # the parent's prices + # + # @return [String, nil] + required :base_plan_id, String, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute currency + # An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's + # prices. + # + # @return [String] + required :currency, String + + # @!attribute default_invoice_memo + # The default memo text on the invoices corresponding to subscriptions on this + # plan. Note that each subscription may configure its own memo. + # + # @return [String, nil] + required :default_invoice_memo, String, nil?: true + + # @!attribute description + # + # @return [String] + required :description, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_plan_id + # An optional user-defined ID for this plan resource, used throughout the system + # as an alias for this Plan. Use this field to identify a plan by an existing + # identifier in your system. + # + # @return [String, nil] + required :external_plan_id, String, nil?: true + + # @!attribute invoicing_currency + # An ISO 4217 currency string for which this plan is billed in. Matches `currency` + # unless `currency` is a custom pricing unit. + # + # @return [String] + required :invoicing_currency, String + + # @!attribute maximum + # + # @return [Orb::Models::Plan::Maximum, nil] + required :maximum, -> { Orb::Models::Plan::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Plan::Minimum, nil] + required :minimum, -> { Orb::Models::Plan::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute net_terms + # Determines the difference between the invoice issue date and the due date. A + # value of "0" here signifies that invoices are due on issue, whereas a value of + # "30" means that the customer has a month to pay the invoice before its overdue. + # Note that individual subscriptions or invoices may set a different net terms + # configuration. + # + # @return [Integer, nil] + required :net_terms, Integer, nil?: true + + # @!attribute plan_phases + # + # @return [Array, nil] + required :plan_phases, -> { Orb::ArrayOf[Orb::Models::Plan::PlanPhase] }, nil?: true + + # @!attribute prices + # Prices for this plan. If the plan has phases, this includes prices across all + # phases of the plan. + # + # @return [Array] + required :prices, -> { Orb::ArrayOf[union: Orb::Models::Price] } + + # @!attribute product + # + # @return [Orb::Models::Plan::Product] + required :product, -> { Orb::Models::Plan::Product } + + # @!attribute status + # + # @return [Symbol, Orb::Models::Plan::Status] + required :status, enum: -> { Orb::Models::Plan::Status } + + # @!attribute trial_config + # + # @return [Orb::Models::Plan::TrialConfig] + required :trial_config, -> { Orb::Models::Plan::TrialConfig } + + # @!attribute version + # + # @return [Integer] + required :version, Integer + + # @!parse + # # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + # # subscribed to by a customer. Plans define the billing behavior of the + # # subscription. You can see more about how to configure prices in the + # # [Price resource](/reference/price). + # # + # # @param id [String] + # # @param adjustments [Array] + # # @param base_plan [Orb::Models::Plan::BasePlan, nil] + # # @param base_plan_id [String, nil] + # # @param created_at [Time] + # # @param currency [String] + # # @param default_invoice_memo [String, nil] + # # @param description [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_plan_id [String, nil] + # # @param invoicing_currency [String] + # # @param maximum [Orb::Models::Plan::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Plan::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param net_terms [Integer, nil] + # # @param plan_phases [Array, nil] + # # @param prices [Array] + # # @param product [Orb::Models::Plan::Product] + # # @param status [Symbol, Orb::Models::Plan::Status] + # # @param trial_config [Orb::Models::Plan::TrialConfig] + # # @param version [Integer] + # # + # def initialize( + # id:, + # adjustments:, + # base_plan:, + # base_plan_id:, + # created_at:, + # currency:, + # default_invoice_memo:, + # description:, + # discount:, + # external_plan_id:, + # invoicing_currency:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # net_terms:, + # plan_phases:, + # prices:, + # product:, + # status:, + # trial_config:, + # version:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "amount_discount", id: String, amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::Plan::Adjustment::AmountDiscountAdjustment ... + # in {adjustment_type: "percentage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::Plan::Adjustment::PercentageDiscountAdjustment ... + # in {adjustment_type: "usage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::Plan::Adjustment::UsageDiscountAdjustment ... + # in {adjustment_type: "minimum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::Plan::Adjustment::MinimumAdjustment ... + # in {adjustment_type: "maximum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::Plan::Adjustment::MaximumAdjustment ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::Plan::Adjustment::AmountDiscountAdjustment + # # ... + # in Orb::Models::Plan::Adjustment::PercentageDiscountAdjustment + # # ... + # in Orb::Models::Plan::Adjustment::UsageDiscountAdjustment + # # ... + # in Orb::Models::Plan::Adjustment::MinimumAdjustment + # # ... + # in Orb::Models::Plan::Adjustment::MaximumAdjustment + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :amount_discount, -> { Orb::Models::Plan::Adjustment::AmountDiscountAdjustment } + + variant :percentage_discount, -> { Orb::Models::Plan::Adjustment::PercentageDiscountAdjustment } + + variant :usage_discount, -> { Orb::Models::Plan::Adjustment::UsageDiscountAdjustment } + + variant :minimum, -> { Orb::Models::Plan::Adjustment::MinimumAdjustment } + + variant :maximum, -> { Orb::Models::Plan::Adjustment::MaximumAdjustment } + + # @example + # ```ruby + # amount_discount_adjustment => { + # id: String, + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # **_ + # } + # ``` + class AmountDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # The amount by which to discount the prices this adjustment applies to in a given + # billing period. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize( + # id:, + # amount_discount:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # adjustment_type: :amount_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_adjustment => { + # id: String, + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # percentage_discount: Float, + # **_ + # } + # ``` + class PercentageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute percentage_discount + # The percentage (as a value between 0 and 1) by which to discount the price + # intervals this adjustment applies to in a given billing period. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param percentage_discount [Float] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # percentage_discount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_adjustment => { + # id: String, + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # plan_phase_order: Integer, + # **_ + # } + # ``` + class UsageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute usage_discount + # The number of usage units by which to discount the price this adjustment applies + # to in a given billing period. + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param usage_discount [Float] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # usage_discount:, + # adjustment_type: :usage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_adjustment => { + # id: String, + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # item_id: String, + # **_ + # } + # ``` + class MinimumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # item_id:, + # minimum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_adjustment => { + # id: String, + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # maximum_amount: String, + # **_ + # } + # ``` + class MaximumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param maximum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # maximum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :maximum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # base_plan => { + # id: String, + # external_plan_id: String, + # name: String + # } + # ``` + class BasePlan < Orb::BaseModel + # @!attribute id + # + # @return [String, nil] + required :id, String, nil?: true + + # @!attribute external_plan_id + # An optional user-defined ID for this plan resource, used throughout the system + # as an alias for this Plan. Use this field to identify a plan by an existing + # identifier in your system. + # + # @return [String, nil] + required :external_plan_id, String, nil?: true + + # @!attribute name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!parse + # # @param id [String, nil] + # # @param external_plan_id [String, nil] + # # @param name [String, nil] + # # + # def initialize(id:, external_plan_id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class Maximum < Orb::Model - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] maximum_amount + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class Minimum < Orb::Model - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] minimum_amount + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class PlanPhases < Orb::Model - class Maximum < Orb::Model - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] maximum_amount + + # @example + # ```ruby + # plan_phase => { + # id: String, + # description: String, + # discount: Orb::Models::Discount, + # duration: Integer, + # duration_unit: Orb::Models::Plan::PlanPhase::DurationUnit, + # **_ + # } + # ``` + class PlanPhase < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute duration + # How many terms of length `duration_unit` this phase is active for. If null, this + # phase is evergreen and active indefinitely + # + # @return [Integer, nil] + required :duration, Integer, nil?: true + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Plan::PlanPhase::DurationUnit, nil] + required :duration_unit, enum: -> { Orb::Models::Plan::PlanPhase::DurationUnit }, nil?: true + + # @!attribute maximum + # + # @return [Orb::Models::Plan::PlanPhase::Maximum, nil] + required :maximum, -> { Orb::Models::Plan::PlanPhase::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute minimum + # + # @return [Orb::Models::Plan::PlanPhase::Minimum, nil] + required :minimum, -> { Orb::Models::Plan::PlanPhase::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute order + # Determines the ordering of the phase in a plan's lifecycle. 1 = first phase. + # + # @return [Integer] + required :order, Integer + + # @!parse + # # @param id [String] + # # @param description [String, nil] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param duration [Integer, nil] + # # @param duration_unit [Symbol, Orb::Models::Plan::PlanPhase::DurationUnit, nil] + # # @param maximum [Orb::Models::Plan::PlanPhase::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param minimum [Orb::Models::Plan::PlanPhase::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param order [Integer] + # # + # def initialize( + # id:, + # description:, + # discount:, + # duration:, + # duration_unit:, + # maximum:, + # maximum_amount:, + # minimum:, + # minimum_amount:, + # name:, + # order:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :daily + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAILY = :daily + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class Minimum < Orb::Model - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] minimum_amount + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - # @!attribute [rw] id - required :id, String - # @!attribute [rw] description - required :description, String - # @!attribute [rw] discount - required :discount, Orb::Unknown - # @!attribute [rw] duration - required :duration, Integer - # @!attribute [rw] duration_unit - required :duration_unit, - Orb::Enum.new([:"daily", :"monthly", :"quarterly", :"annual"]) - # @!attribute [rw] maximum - required :maximum, Maximum - # @!attribute [rw] maximum_amount - required :maximum_amount, String - # @!attribute [rw] minimum - required :minimum, Minimum - # @!attribute [rw] minimum_amount - required :minimum_amount, String - # @!attribute [rw] name_ - required :name_, String - # @!attribute [rw] order - required :order, Integer end - class Product < Orb::Model - # @!attribute [rw] id + + # @example + # ```ruby + # product => { + # id: String, + # created_at: Time, + # name: String + # } + # ``` + class Product < Orb::BaseModel + # @!attribute id + # + # @return [String] required :id, String - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] name_ - required :name_, String + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param created_at [Time] + # # @param name [String] + # # + # def initialize(id:, created_at:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class TrialConfig < Orb::Model - # @!attribute [rw] trial_period - required :trial_period, Integer - # @!attribute [rw] trial_period_unit - required :trial_period_unit, Orb::Enum.new([:"days"]) + + # @abstract + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :archived + # # ... + # in :draft + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + ARCHIVED = :archived + DRAFT = :draft + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # trial_config => { + # trial_period: Integer, + # trial_period_unit: Orb::Models::Plan::TrialConfig::TrialPeriodUnit + # } + # ``` + class TrialConfig < Orb::BaseModel + # @!attribute trial_period + # + # @return [Integer, nil] + required :trial_period, Integer, nil?: true + + # @!attribute trial_period_unit + # + # @return [Symbol, Orb::Models::Plan::TrialConfig::TrialPeriodUnit] + required :trial_period_unit, enum: -> { Orb::Models::Plan::TrialConfig::TrialPeriodUnit } + + # @!parse + # # @param trial_period [Integer, nil] + # # @param trial_period_unit [Symbol, Orb::Models::Plan::TrialConfig::TrialPeriodUnit] + # # + # def initialize(trial_period:, trial_period_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case trial_period_unit + # in :days + # # ... + # end + # ``` + class TrialPeriodUnit < Orb::Enum + DAYS = :days + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end end - # @!attribute [rw] id - required :id, String - # @!attribute [rw] base_plan - required :base_plan, BasePlan - # @!attribute [rw] base_plan_id - required :base_plan_id, String - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] currency - required :currency, String - # @!attribute [rw] default_invoice_memo - required :default_invoice_memo, String - # @!attribute [rw] description - required :description, String - # @!attribute [rw] discount - required :discount, Orb::Unknown - # @!attribute [rw] external_plan_id - required :external_plan_id, String - # @!attribute [rw] invoicing_currency - required :invoicing_currency, String - # @!attribute [rw] maximum - required :maximum, Maximum - # @!attribute [rw] maximum_amount - required :maximum_amount, String - # @!attribute [rw] metadata - required :metadata, Orb::Unknown - # @!attribute [rw] minimum - required :minimum, Minimum - # @!attribute [rw] minimum_amount - required :minimum_amount, String - # @!attribute [rw] name_ - required :name_, String - # @!attribute [rw] net_terms - required :net_terms, Integer - # @!attribute [rw] plan_phases - required :plan_phases, Orb::ArrayOf.new(PlanPhases) - # @!attribute [rw] prices - required :prices, Orb::ArrayOf.new(Orb::Unknown) - # @!attribute [rw] product - required :product, Product - # @!attribute [rw] status - required :status, Orb::Enum.new([:"active", :"archived", :"draft"]) - # @!attribute [rw] trial_config - required :trial_config, TrialConfig end end end diff --git a/lib/orb/models/plan_create_params.rb b/lib/orb/models/plan_create_params.rb new file mode 100644 index 00000000..16462894 --- /dev/null +++ b/lib/orb/models/plan_create_params.rb @@ -0,0 +1,8275 @@ +# frozen_string_literal: true + +module Orb + module Models + class PlanCreateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute currency + # An ISO 4217 currency string for invoices generated by subscriptions on this + # plan. + # + # @return [String] + required :currency, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute prices + # Prices for this plan. If the plan has phases, this includes prices across all + # phases of the plan. + # + # @return [Array] + required :prices, -> { Orb::ArrayOf[union: Orb::Models::PlanCreateParams::Price] } + + # @!attribute default_invoice_memo + # Free-form text which is available on the invoice PDF and the Orb invoice portal. + # + # @return [String, nil] + optional :default_invoice_memo, String, nil?: true + + # @!attribute external_plan_id + # + # @return [String, nil] + optional :external_plan_id, String, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute net_terms + # The net terms determines the difference between the invoice date and the issue + # date for the invoice. If you intend the invoice to be due on issue, set this + # to 0. + # + # @return [Integer, nil] + optional :net_terms, Integer, nil?: true + + # @!attribute [r] status + # The status of the plan to create (either active or draft). If not specified, + # this defaults to active. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Status, nil] + optional :status, enum: -> { Orb::Models::PlanCreateParams::Status } + + # @!parse + # # @return [Symbol, Orb::Models::PlanCreateParams::Status] + # attr_writer :status + + # @!parse + # # @param currency [String] + # # @param name [String] + # # @param prices [Array] + # # @param default_invoice_memo [String, nil] + # # @param external_plan_id [String, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param net_terms [Integer, nil] + # # @param status [Symbol, Orb::Models::PlanCreateParams::Status] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # currency:, + # name:, + # prices:, + # default_invoice_memo: nil, + # external_plan_id: nil, + # metadata: nil, + # net_terms: nil, + # status: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case price + # in {model_type: "unit", cadence: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::Cadence, item_id: String, name: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice ... + # in {model_type: "package", cadence: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::Cadence, item_id: String, name: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice ... + # in {model_type: "matrix", cadence: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::Cadence, item_id: String, matrix_config: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig} + # # Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice ... + # in {model_type: "tiered", cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::Cadence, item_id: String, name: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice ... + # in {model_type: "tiered_bps", cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::Cadence, item_id: String, name: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice ... + # in {model_type: "bps", bps_config: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BpsConfig, cadence: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::Cadence, item_id: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice ... + # in {model_type: "bulk_bps", bulk_bps_config: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig, cadence: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::Cadence, item_id: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice ... + # in {model_type: "bulk", bulk_config: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig, cadence: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::Cadence, item_id: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice ... + # in {model_type: "threshold_total_amount", cadence: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::Cadence, item_id: String, name: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice ... + # in {model_type: "tiered_package", cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::Cadence, item_id: String, name: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice ... + # in {model_type: "tiered_with_minimum", cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::Cadence, item_id: String, name: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice ... + # in {model_type: "unit_with_percent", cadence: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::Cadence, item_id: String, name: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice ... + # in {model_type: "package_with_allocation", cadence: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::Cadence, item_id: String, name: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice ... + # in {model_type: "tiered_with_proration", cadence: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::Cadence, item_id: String, name: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice ... + # in {model_type: "unit_with_proration", cadence: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::Cadence, item_id: String, name: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice ... + # in {model_type: "grouped_allocation", cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::Cadence, grouped_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, item_id: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice ... + # in {model_type: "grouped_with_prorated_minimum", cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::Cadence, grouped_with_prorated_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, item_id: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice ... + # in {model_type: "grouped_with_metered_minimum", cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::Cadence, grouped_with_metered_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, item_id: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice ... + # in {model_type: "matrix_with_display_name", cadence: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::Cadence, item_id: String, matrix_with_display_name_config: -> { Orb::HashOf[Orb::Unknown] === _1 }} + # # Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice ... + # in {model_type: "bulk_with_proration", bulk_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, cadence: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::Cadence, item_id: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice ... + # in {model_type: "grouped_tiered_package", cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::Cadence, grouped_tiered_package_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, item_id: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice ... + # in {model_type: "max_group_tiered_package", cadence: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::Cadence, item_id: String, max_group_tiered_package_config: -> { Orb::HashOf[Orb::Unknown] === _1 }} + # # Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice ... + # in {model_type: "scalable_matrix_with_unit_pricing", cadence: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::Cadence, item_id: String, name: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice ... + # in {model_type: "scalable_matrix_with_tiered_pricing", cadence: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::Cadence, item_id: String, name: String} + # # Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice ... + # end + # ``` + # + # @example + # ```ruby + # case price + # in Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice + # # ... + # in Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice + # # ... + # end + # ``` + class Price < Orb::Union + discriminator :model_type + + variant :unit, -> { Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice } + + variant :package, -> { Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice } + + variant :matrix, -> { Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice } + + variant :tiered, -> { Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice } + + variant :tiered_bps, -> { Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice } + + variant :bps, -> { Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice } + + variant :bulk_bps, -> { Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice } + + variant :bulk, -> { Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice } + + variant :threshold_total_amount, + -> { Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice } + + variant :tiered_package, -> { Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice } + + variant :tiered_with_minimum, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice + } + + variant :unit_with_percent, -> { Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice } + + variant :package_with_allocation, + -> { Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice } + + variant :tiered_with_proration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice + } + + variant :unit_with_proration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice + } + + variant :grouped_allocation, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice + } + + variant :grouped_with_prorated_minimum, + -> { Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice } + + variant :grouped_with_metered_minimum, + -> { Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice } + + variant :matrix_with_display_name, + -> { Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice } + + variant :bulk_with_proration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice + } + + variant :grouped_tiered_package, + -> { Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice } + + variant :max_group_tiered_package, + -> { Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice } + + variant :scalable_matrix_with_unit_pricing, + -> { Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice } + + variant :scalable_matrix_with_tiered_pricing, + -> { Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice } + + # @example + # ```ruby + # new_plan_unit_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::Cadence, + # item_id: String, + # model_type: :unit, + # name: String, + # unit_config: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::UnitConfig, + # **_ + # } + # ``` + class NewPlanUnitPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::Cadence] + required :cadence, enum: -> { Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::Cadence } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit] + required :model_type, const: :unit + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_config + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::UnitConfig] + required :unit_config, -> { Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::UnitConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param unit_config [Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::UnitConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :unit] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # unit_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :unit, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # unit_config => { + # unit_amount: String + # } + # ``` + class UnitConfig < Orb::BaseModel + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param unit_amount [String] + # # + # def initialize(unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_package_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::Cadence, + # item_id: String, + # model_type: :package, + # name: String, + # package_config: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::PackageConfig, + # **_ + # } + # ``` + class NewPlanPackagePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::Cadence] + required :cadence, enum: -> { Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::Cadence } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :package] + required :model_type, const: :package + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute package_config + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::PackageConfig] + required :package_config, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::PackageConfig + } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param package_config [Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::PackageConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :package] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # package_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # package_config => { + # package_amount: String, + # package_size: Integer + # } + # ``` + class PackageConfig < Orb::BaseModel + # @!attribute package_amount + # A currency amount to rate usage by + # + # @return [String] + required :package_amount, String + + # @!attribute package_size + # An integer amount to represent package size. For example, 1000 here would divide + # usage by 1000 before multiplying by package_amount in rating + # + # @return [Integer] + required :package_size, Integer + + # @!parse + # # @param package_amount [String] + # # @param package_size [Integer] + # # + # def initialize(package_amount:, package_size:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_matrix_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::Cadence, + # item_id: String, + # matrix_config: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig, + # model_type: :matrix, + # name: String, + # **_ + # } + # ``` + class NewPlanMatrixPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::Cadence] + required :cadence, enum: -> { Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::Cadence } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute matrix_config + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig] + required :matrix_config, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig + } + + # @!attribute model_type + # + # @return [Symbol, :matrix] + required :model_type, const: :matrix + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::Cadence] + # # @param item_id [String] + # # @param matrix_config [Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :matrix] + # # + # def initialize( + # cadence:, + # item_id:, + # matrix_config:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :matrix, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # matrix_config => { + # default_unit_amount: String, + # dimensions: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # matrix_values: -> { Orb::ArrayOf[Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig::MatrixValue] === _1 } + # } + # ``` + class MatrixConfig < Orb::BaseModel + # @!attribute default_unit_amount + # Default per unit rate for any usage not bucketed into a specified matrix_value + # + # @return [String] + required :default_unit_amount, String + + # @!attribute dimensions + # One or two event property values to evaluate matrix groups by + # + # @return [Array] + required :dimensions, Orb::ArrayOf[String, nil?: true] + + # @!attribute matrix_values + # Matrix values for specified matrix grouping keys + # + # @return [Array] + required :matrix_values, + -> { + Orb::ArrayOf[Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig::MatrixValue] + } + + # @!parse + # # @param default_unit_amount [String] + # # @param dimensions [Array] + # # @param matrix_values [Array] + # # + # def initialize(default_unit_amount:, dimensions:, matrix_values:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # matrix_value => { + # dimension_values: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # unit_amount: String + # } + # ``` + class MatrixValue < Orb::BaseModel + # @!attribute dimension_values + # One or two matrix keys to filter usage to this Matrix value by. For example, + # ["region", "tier"] could be used to filter cloud usage by a cloud region and an + # instance tier. + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String, nil?: true] + + # @!attribute unit_amount + # Unit price for the specified dimension_values + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param dimension_values [Array] + # # @param unit_amount [String] + # # + # def initialize(dimension_values:, unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_tiered_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::Cadence, + # item_id: String, + # model_type: :tiered, + # name: String, + # tiered_config: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig, + # **_ + # } + # ``` + class NewPlanTieredPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::Cadence] + required :cadence, enum: -> { Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::Cadence } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered] + required :model_type, const: :tiered + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_config + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig] + required :tiered_config, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig + } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_config [Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :tiered] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :tiered, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # tiered_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig::Tier] === _1 } + # } + # ``` + class TieredConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # first_unit: Float, + # unit_amount: String, + # last_unit: Float + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute first_unit + # Inclusive tier starting value + # + # @return [Float] + required :first_unit, Float + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute last_unit + # Exclusive tier ending value. If null, this is treated as the last tier + # + # @return [Float, nil] + optional :last_unit, Float, nil?: true + + # @!parse + # # @param first_unit [Float] + # # @param unit_amount [String] + # # @param last_unit [Float, nil] + # # + # def initialize(first_unit:, unit_amount:, last_unit: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_tiered_bps_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::Cadence, + # item_id: String, + # model_type: :tiered_bps, + # name: String, + # tiered_bps_config: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig, + # **_ + # } + # ``` + class NewPlanTieredBpsPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::Cadence] + required :cadence, enum: -> { Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::Cadence } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_bps] + required :model_type, const: :tiered_bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_bps_config + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig] + required :tiered_bps_config, + -> { Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_bps_config [Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :tiered_bps] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_bps_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :tiered_bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # tiered_bps_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig::Tier] === _1 } + # } + # ``` + class TieredBpsConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + # tiers + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # bps: Float, + # minimum_amount: String, + # maximum_amount: String, + # per_unit_maximum: String + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute bps + # Per-event basis point rate + # + # @return [Float] + required :bps, Float + + # @!attribute minimum_amount + # Inclusive tier starting value + # + # @return [String] + required :minimum_amount, String + + # @!attribute maximum_amount + # Exclusive tier ending value + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute per_unit_maximum + # Per unit maximum to charge + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param minimum_amount [String] + # # @param maximum_amount [String, nil] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_bps_price => { + # bps_config: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BpsConfig, + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::Cadence, + # item_id: String, + # model_type: :bps, + # name: String, + # **_ + # } + # ``` + class NewPlanBpsPrice < Orb::BaseModel + # @!attribute bps_config + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BpsConfig] + required :bps_config, -> { Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BpsConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::Cadence] + required :cadence, enum: -> { Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::Cadence } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bps] + required :model_type, const: :bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param bps_config [Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BpsConfig] + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :bps] + # # + # def initialize( + # bps_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bps_config => { + # bps: Float, + # per_unit_maximum: String + # } + # ``` + class BpsConfig < Orb::BaseModel + # @!attribute bps + # Basis point take rate per event + # + # @return [Float] + required :bps, Float + + # @!attribute per_unit_maximum + # Optional currency amount maximum to cap spend per event + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_bulk_bps_price => { + # bulk_bps_config: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig, + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::Cadence, + # item_id: String, + # model_type: :bulk_bps, + # name: String, + # **_ + # } + # ``` + class NewPlanBulkBpsPrice < Orb::BaseModel + # @!attribute bulk_bps_config + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig] + required :bulk_bps_config, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig + } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::Cadence] + required :cadence, enum: -> { Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::Cadence } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk_bps] + required :model_type, const: :bulk_bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param bulk_bps_config [Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig] + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :bulk_bps] + # # + # def initialize( + # bulk_bps_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :bulk_bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bulk_bps_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig::Tier] === _1 } + # } + # ``` + class BulkBpsConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for a bulk BPS pricing model where all usage is aggregated to a single + # tier based on total volume + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # bps: Float, + # maximum_amount: String, + # per_unit_maximum: String + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute bps + # Basis points to rate on + # + # @return [Float] + required :bps, Float + + # @!attribute maximum_amount + # Upper bound for tier + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute per_unit_maximum + # The maximum amount to charge for any one event + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param maximum_amount [String, nil] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, maximum_amount: nil, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_bulk_price => { + # bulk_config: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig, + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::Cadence, + # item_id: String, + # model_type: :bulk, + # name: String, + # **_ + # } + # ``` + class NewPlanBulkPrice < Orb::BaseModel + # @!attribute bulk_config + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig] + required :bulk_config, -> { Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::Cadence] + required :cadence, enum: -> { Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::Cadence } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk] + required :model_type, const: :bulk + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param bulk_config [Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig] + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :bulk] + # # + # def initialize( + # bulk_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :bulk, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bulk_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig::Tier] === _1 } + # } + # ``` + class BulkConfig < Orb::BaseModel + # @!attribute tiers + # Bulk tiers for rating based on total usage volume + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # unit_amount: String, + # maximum_units: Float + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute maximum_units + # Upper bound for this tier + # + # @return [Float, nil] + optional :maximum_units, Float, nil?: true + + # @!parse + # # @param unit_amount [String] + # # @param maximum_units [Float, nil] + # # + # def initialize(unit_amount:, maximum_units: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_threshold_total_amount_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::Cadence, + # item_id: String, + # model_type: :threshold_total_amount, + # name: String, + # threshold_total_amount_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewPlanThresholdTotalAmountPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :threshold_total_amount] + required :model_type, const: :threshold_total_amount + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute threshold_total_amount_config + # + # @return [Hash{Symbol=>Object}] + required :threshold_total_amount_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param threshold_total_amount_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :threshold_total_amount] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # threshold_total_amount_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :threshold_total_amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_tiered_package_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::Cadence, + # item_id: String, + # model_type: :tiered_package, + # name: String, + # tiered_package_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewPlanTieredPackagePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_package] + required :model_type, const: :tiered_package + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_package_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_package_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_package_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :tiered_package] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_package_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :tiered_package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_tiered_with_minimum_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::Cadence, + # item_id: String, + # model_type: :tiered_with_minimum, + # name: String, + # tiered_with_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewPlanTieredWithMinimumPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::Cadence] + required :cadence, + enum: -> { Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::Cadence } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_with_minimum] + required :model_type, const: :tiered_with_minimum + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_with_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_with_minimum_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :tiered_with_minimum] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_with_minimum_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :tiered_with_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_unit_with_percent_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::Cadence, + # item_id: String, + # model_type: :unit_with_percent, + # name: String, + # unit_with_percent_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewPlanUnitWithPercentPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit_with_percent] + required :model_type, const: :unit_with_percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_with_percent_config + # + # @return [Hash{Symbol=>Object}] + required :unit_with_percent_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param unit_with_percent_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :unit_with_percent] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # unit_with_percent_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :unit_with_percent, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_package_with_allocation_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::Cadence, + # item_id: String, + # model_type: :package_with_allocation, + # name: String, + # package_with_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewPlanPackageWithAllocationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :package_with_allocation] + required :model_type, const: :package_with_allocation + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute package_with_allocation_config + # + # @return [Hash{Symbol=>Object}] + required :package_with_allocation_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param package_with_allocation_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :package_with_allocation] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # package_with_allocation_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :package_with_allocation, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_tier_with_proration_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::Cadence, + # item_id: String, + # model_type: :tiered_with_proration, + # name: String, + # tiered_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewPlanTierWithProrationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::Cadence] + required :cadence, + enum: -> { Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::Cadence } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_with_proration_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :tiered_with_proration] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_with_proration_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :tiered_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_unit_with_proration_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::Cadence, + # item_id: String, + # model_type: :unit_with_proration, + # name: String, + # unit_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewPlanUnitWithProrationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::Cadence] + required :cadence, + enum: -> { Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::Cadence } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit_with_proration] + required :model_type, const: :unit_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :unit_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param unit_with_proration_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :unit_with_proration] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # unit_with_proration_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :unit_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_grouped_allocation_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::Cadence, + # grouped_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_allocation, + # name: String, + # **_ + # } + # ``` + class NewPlanGroupedAllocationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::Cadence] + required :cadence, + enum: -> { Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::Cadence } + + # @!attribute grouped_allocation_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_allocation_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_allocation] + required :model_type, const: :grouped_allocation + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::Cadence] + # # @param grouped_allocation_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :grouped_allocation] + # # + # def initialize( + # cadence:, + # grouped_allocation_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :grouped_allocation, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_grouped_with_prorated_minimum_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::Cadence, + # grouped_with_prorated_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_with_prorated_minimum, + # name: String, + # **_ + # } + # ``` + class NewPlanGroupedWithProratedMinimumPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::Cadence + } + + # @!attribute grouped_with_prorated_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_with_prorated_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_with_prorated_minimum] + required :model_type, const: :grouped_with_prorated_minimum + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::Cadence] + # # @param grouped_with_prorated_minimum_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :grouped_with_prorated_minimum] + # # + # def initialize( + # cadence:, + # grouped_with_prorated_minimum_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :grouped_with_prorated_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_grouped_with_metered_minimum_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::Cadence, + # grouped_with_metered_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_with_metered_minimum, + # name: String, + # **_ + # } + # ``` + class NewPlanGroupedWithMeteredMinimumPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::Cadence + } + + # @!attribute grouped_with_metered_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_with_metered_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_with_metered_minimum] + required :model_type, const: :grouped_with_metered_minimum + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::Cadence] + # # @param grouped_with_metered_minimum_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :grouped_with_metered_minimum] + # # + # def initialize( + # cadence:, + # grouped_with_metered_minimum_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :grouped_with_metered_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_matrix_with_display_name_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::Cadence, + # item_id: String, + # matrix_with_display_name_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # model_type: :matrix_with_display_name, + # name: String, + # **_ + # } + # ``` + class NewPlanMatrixWithDisplayNamePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute matrix_with_display_name_config + # + # @return [Hash{Symbol=>Object}] + required :matrix_with_display_name_config, Orb::HashOf[Orb::Unknown] + + # @!attribute model_type + # + # @return [Symbol, :matrix_with_display_name] + required :model_type, const: :matrix_with_display_name + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::Cadence] + # # @param item_id [String] + # # @param matrix_with_display_name_config [Hash{Symbol=>Object}] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :matrix_with_display_name] + # # + # def initialize( + # cadence:, + # item_id:, + # matrix_with_display_name_config:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :matrix_with_display_name, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_bulk_with_proration_price => { + # bulk_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::Cadence, + # item_id: String, + # model_type: :bulk_with_proration, + # name: String, + # **_ + # } + # ``` + class NewPlanBulkWithProrationPrice < Orb::BaseModel + # @!attribute bulk_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :bulk_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::Cadence] + required :cadence, + enum: -> { Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::Cadence } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk_with_proration] + required :model_type, const: :bulk_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param bulk_with_proration_config [Hash{Symbol=>Object}] + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :bulk_with_proration] + # # + # def initialize( + # bulk_with_proration_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :bulk_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_grouped_tiered_package_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::Cadence, + # grouped_tiered_package_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_tiered_package, + # name: String, + # **_ + # } + # ``` + class NewPlanGroupedTieredPackagePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::Cadence + } + + # @!attribute grouped_tiered_package_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_tiered_package_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_tiered_package] + required :model_type, const: :grouped_tiered_package + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::Cadence] + # # @param grouped_tiered_package_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :grouped_tiered_package] + # # + # def initialize( + # cadence:, + # grouped_tiered_package_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :grouped_tiered_package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_max_group_tiered_package_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::Cadence, + # item_id: String, + # max_group_tiered_package_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # model_type: :max_group_tiered_package, + # name: String, + # **_ + # } + # ``` + class NewPlanMaxGroupTieredPackagePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute max_group_tiered_package_config + # + # @return [Hash{Symbol=>Object}] + required :max_group_tiered_package_config, Orb::HashOf[Orb::Unknown] + + # @!attribute model_type + # + # @return [Symbol, :max_group_tiered_package] + required :model_type, const: :max_group_tiered_package + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::Cadence] + # # @param item_id [String] + # # @param max_group_tiered_package_config [Hash{Symbol=>Object}] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :max_group_tiered_package] + # # + # def initialize( + # cadence:, + # item_id:, + # max_group_tiered_package_config:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :max_group_tiered_package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_scalable_matrix_with_unit_pricing_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::Cadence, + # item_id: String, + # model_type: :scalable_matrix_with_unit_pricing, + # name: String, + # scalable_matrix_with_unit_pricing_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewPlanScalableMatrixWithUnitPricingPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :scalable_matrix_with_unit_pricing] + required :model_type, const: :scalable_matrix_with_unit_pricing + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute scalable_matrix_with_unit_pricing_config + # + # @return [Hash{Symbol=>Object}] + required :scalable_matrix_with_unit_pricing_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param scalable_matrix_with_unit_pricing_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :scalable_matrix_with_unit_pricing] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # scalable_matrix_with_unit_pricing_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :scalable_matrix_with_unit_pricing, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_plan_scalable_matrix_with_tiered_pricing_price => { + # cadence: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::Cadence, + # item_id: String, + # model_type: :scalable_matrix_with_tiered_pricing, + # name: String, + # scalable_matrix_with_tiered_pricing_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewPlanScalableMatrixWithTieredPricingPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :scalable_matrix_with_tiered_pricing] + required :model_type, const: :scalable_matrix_with_tiered_pricing + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute scalable_matrix_with_tiered_pricing_config + # + # @return [Hash{Symbol=>Object}] + required :scalable_matrix_with_tiered_pricing_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param scalable_matrix_with_tiered_pricing_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :scalable_matrix_with_tiered_pricing] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # scalable_matrix_with_tiered_pricing_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :scalable_matrix_with_tiered_pricing, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + + # @abstract + # + # The status of the plan to create (either active or draft). If not specified, + # this defaults to active. + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :draft + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + DRAFT = :draft + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/orb/models/plan_fetch_params.rb b/lib/orb/models/plan_fetch_params.rb new file mode 100644 index 00000000..2a41f4ab --- /dev/null +++ b/lib/orb/models/plan_fetch_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class PlanFetchParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/plan_list_params.rb b/lib/orb/models/plan_list_params.rb new file mode 100644 index 00000000..0077743a --- /dev/null +++ b/lib/orb/models/plan_list_params.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true + +module Orb + module Models + class PlanListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute created_at_gt + # + # @return [Time, nil] + optional :created_at_gt, Time, api_name: :"created_at[gt]", nil?: true + + # @!attribute created_at_gte + # + # @return [Time, nil] + optional :created_at_gte, Time, api_name: :"created_at[gte]", nil?: true + + # @!attribute created_at_lt + # + # @return [Time, nil] + optional :created_at_lt, Time, api_name: :"created_at[lt]", nil?: true + + # @!attribute created_at_lte + # + # @return [Time, nil] + optional :created_at_lte, Time, api_name: :"created_at[lte]", nil?: true + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!attribute [r] status + # The plan status to filter to ('active', 'archived', or 'draft'). + # + # @return [Symbol, Orb::Models::PlanListParams::Status, nil] + optional :status, enum: -> { Orb::Models::PlanListParams::Status } + + # @!parse + # # @return [Symbol, Orb::Models::PlanListParams::Status] + # attr_writer :status + + # @!parse + # # @param created_at_gt [Time, nil] + # # @param created_at_gte [Time, nil] + # # @param created_at_lt [Time, nil] + # # @param created_at_lte [Time, nil] + # # @param cursor [String, nil] + # # @param limit [Integer] + # # @param status [Symbol, Orb::Models::PlanListParams::Status] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # created_at_gt: nil, + # created_at_gte: nil, + # created_at_lt: nil, + # created_at_lte: nil, + # cursor: nil, + # limit: nil, + # status: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The plan status to filter to ('active', 'archived', or 'draft'). + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :archived + # # ... + # in :draft + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + ARCHIVED = :archived + DRAFT = :draft + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/orb/models/plan_update_params.rb b/lib/orb/models/plan_update_params.rb new file mode 100644 index 00000000..8975c0cc --- /dev/null +++ b/lib/orb/models/plan_update_params.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Orb + module Models + class PlanUpdateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute external_plan_id + # An optional user-defined ID for this plan resource, used throughout the system + # as an alias for this Plan. Use this field to identify a plan by an existing + # identifier in your system. + # + # @return [String, nil] + optional :external_plan_id, String, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param external_plan_id [String, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(external_plan_id: nil, metadata: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/plans/external_plan_id_fetch_params.rb b/lib/orb/models/plans/external_plan_id_fetch_params.rb new file mode 100644 index 00000000..9d754bfb --- /dev/null +++ b/lib/orb/models/plans/external_plan_id_fetch_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Orb + module Models + module Plans + class ExternalPlanIDFetchParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/plans/external_plan_id_update_params.rb b/lib/orb/models/plans/external_plan_id_update_params.rb new file mode 100644 index 00000000..f8122a1d --- /dev/null +++ b/lib/orb/models/plans/external_plan_id_update_params.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module Orb + module Models + module Plans + class ExternalPlanIDUpdateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute external_plan_id + # An optional user-defined ID for this plan resource, used throughout the system + # as an alias for this Plan. Use this field to identify a plan by an existing + # identifier in your system. + # + # @return [String, nil] + optional :external_plan_id, String, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param external_plan_id [String, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(external_plan_id: nil, metadata: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/price.rb b/lib/orb/models/price.rb new file mode 100644 index 00000000..b110318a --- /dev/null +++ b/lib/orb/models/price.rb @@ -0,0 +1,14908 @@ +# frozen_string_literal: true + +module Orb + module Models + # @abstract + # + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @example + # ```ruby + # case price + # in {model_type: "unit", id: String, billable_metric: Orb::Models::Price::UnitPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::UnitPrice::BillingCycleConfiguration} + # # Orb::Models::Price::UnitPrice ... + # in {model_type: "package", id: String, billable_metric: Orb::Models::Price::PackagePrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::PackagePrice::BillingCycleConfiguration} + # # Orb::Models::Price::PackagePrice ... + # in {model_type: "matrix", id: String, billable_metric: Orb::Models::Price::MatrixPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::MatrixPrice::BillingCycleConfiguration} + # # Orb::Models::Price::MatrixPrice ... + # in {model_type: "tiered", id: String, billable_metric: Orb::Models::Price::TieredPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::TieredPrice::BillingCycleConfiguration} + # # Orb::Models::Price::TieredPrice ... + # in {model_type: "tiered_bps", id: String, billable_metric: Orb::Models::Price::TieredBpsPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration} + # # Orb::Models::Price::TieredBpsPrice ... + # in {model_type: "bps", id: String, billable_metric: Orb::Models::Price::BpsPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::BpsPrice::BillingCycleConfiguration} + # # Orb::Models::Price::BpsPrice ... + # in {model_type: "bulk_bps", id: String, billable_metric: Orb::Models::Price::BulkBpsPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration} + # # Orb::Models::Price::BulkBpsPrice ... + # in {model_type: "bulk", id: String, billable_metric: Orb::Models::Price::BulkPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::BulkPrice::BillingCycleConfiguration} + # # Orb::Models::Price::BulkPrice ... + # in {model_type: "threshold_total_amount", id: String, billable_metric: Orb::Models::Price::ThresholdTotalAmountPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration} + # # Orb::Models::Price::ThresholdTotalAmountPrice ... + # in {model_type: "tiered_package", id: String, billable_metric: Orb::Models::Price::TieredPackagePrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration} + # # Orb::Models::Price::TieredPackagePrice ... + # in {model_type: "grouped_tiered", id: String, billable_metric: Orb::Models::Price::GroupedTieredPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration} + # # Orb::Models::Price::GroupedTieredPrice ... + # in {model_type: "tiered_with_minimum", id: String, billable_metric: Orb::Models::Price::TieredWithMinimumPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration} + # # Orb::Models::Price::TieredWithMinimumPrice ... + # in {model_type: "tiered_package_with_minimum", id: String, billable_metric: Orb::Models::Price::TieredPackageWithMinimumPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration} + # # Orb::Models::Price::TieredPackageWithMinimumPrice ... + # in {model_type: "package_with_allocation", id: String, billable_metric: Orb::Models::Price::PackageWithAllocationPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration} + # # Orb::Models::Price::PackageWithAllocationPrice ... + # in {model_type: "unit_with_percent", id: String, billable_metric: Orb::Models::Price::UnitWithPercentPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration} + # # Orb::Models::Price::UnitWithPercentPrice ... + # in {model_type: "matrix_with_allocation", id: String, billable_metric: Orb::Models::Price::MatrixWithAllocationPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration} + # # Orb::Models::Price::MatrixWithAllocationPrice ... + # in {model_type: "tiered_with_proration", id: String, billable_metric: Orb::Models::Price::TieredWithProrationPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration} + # # Orb::Models::Price::TieredWithProrationPrice ... + # in {model_type: "unit_with_proration", id: String, billable_metric: Orb::Models::Price::UnitWithProrationPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration} + # # Orb::Models::Price::UnitWithProrationPrice ... + # in {model_type: "grouped_allocation", id: String, billable_metric: Orb::Models::Price::GroupedAllocationPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration} + # # Orb::Models::Price::GroupedAllocationPrice ... + # in {model_type: "grouped_with_prorated_minimum", id: String, billable_metric: Orb::Models::Price::GroupedWithProratedMinimumPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration} + # # Orb::Models::Price::GroupedWithProratedMinimumPrice ... + # in {model_type: "grouped_with_metered_minimum", id: String, billable_metric: Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration} + # # Orb::Models::Price::GroupedWithMeteredMinimumPrice ... + # in {model_type: "matrix_with_display_name", id: String, billable_metric: Orb::Models::Price::MatrixWithDisplayNamePrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration} + # # Orb::Models::Price::MatrixWithDisplayNamePrice ... + # in {model_type: "bulk_with_proration", id: String, billable_metric: Orb::Models::Price::BulkWithProrationPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration} + # # Orb::Models::Price::BulkWithProrationPrice ... + # in {model_type: "grouped_tiered_package", id: String, billable_metric: Orb::Models::Price::GroupedTieredPackagePrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration} + # # Orb::Models::Price::GroupedTieredPackagePrice ... + # in {model_type: "max_group_tiered_package", id: String, billable_metric: Orb::Models::Price::MaxGroupTieredPackagePrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration} + # # Orb::Models::Price::MaxGroupTieredPackagePrice ... + # in {model_type: "scalable_matrix_with_unit_pricing", id: String, billable_metric: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration} + # # Orb::Models::Price::ScalableMatrixWithUnitPricingPrice ... + # in {model_type: "scalable_matrix_with_tiered_pricing", id: String, billable_metric: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillableMetric, billing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration} + # # Orb::Models::Price::ScalableMatrixWithTieredPricingPrice ... + # end + # ``` + # + # @example + # ```ruby + # case price + # in Orb::Models::Price::UnitPrice + # # ... + # in Orb::Models::Price::PackagePrice + # # ... + # in Orb::Models::Price::MatrixPrice + # # ... + # in Orb::Models::Price::TieredPrice + # # ... + # in Orb::Models::Price::TieredBpsPrice + # # ... + # in Orb::Models::Price::BpsPrice + # # ... + # in Orb::Models::Price::BulkBpsPrice + # # ... + # in Orb::Models::Price::BulkPrice + # # ... + # in Orb::Models::Price::ThresholdTotalAmountPrice + # # ... + # in Orb::Models::Price::TieredPackagePrice + # # ... + # in Orb::Models::Price::GroupedTieredPrice + # # ... + # in Orb::Models::Price::TieredWithMinimumPrice + # # ... + # in Orb::Models::Price::TieredPackageWithMinimumPrice + # # ... + # in Orb::Models::Price::PackageWithAllocationPrice + # # ... + # in Orb::Models::Price::UnitWithPercentPrice + # # ... + # in Orb::Models::Price::MatrixWithAllocationPrice + # # ... + # in Orb::Models::Price::TieredWithProrationPrice + # # ... + # in Orb::Models::Price::UnitWithProrationPrice + # # ... + # in Orb::Models::Price::GroupedAllocationPrice + # # ... + # in Orb::Models::Price::GroupedWithProratedMinimumPrice + # # ... + # in Orb::Models::Price::GroupedWithMeteredMinimumPrice + # # ... + # in Orb::Models::Price::MatrixWithDisplayNamePrice + # # ... + # in Orb::Models::Price::BulkWithProrationPrice + # # ... + # in Orb::Models::Price::GroupedTieredPackagePrice + # # ... + # in Orb::Models::Price::MaxGroupTieredPackagePrice + # # ... + # in Orb::Models::Price::ScalableMatrixWithUnitPricingPrice + # # ... + # in Orb::Models::Price::ScalableMatrixWithTieredPricingPrice + # # ... + # end + # ``` + class Price < Orb::Union + discriminator :model_type + + variant :unit, -> { Orb::Models::Price::UnitPrice } + + variant :package, -> { Orb::Models::Price::PackagePrice } + + variant :matrix, -> { Orb::Models::Price::MatrixPrice } + + variant :tiered, -> { Orb::Models::Price::TieredPrice } + + variant :tiered_bps, -> { Orb::Models::Price::TieredBpsPrice } + + variant :bps, -> { Orb::Models::Price::BpsPrice } + + variant :bulk_bps, -> { Orb::Models::Price::BulkBpsPrice } + + variant :bulk, -> { Orb::Models::Price::BulkPrice } + + variant :threshold_total_amount, -> { Orb::Models::Price::ThresholdTotalAmountPrice } + + variant :tiered_package, -> { Orb::Models::Price::TieredPackagePrice } + + variant :grouped_tiered, -> { Orb::Models::Price::GroupedTieredPrice } + + variant :tiered_with_minimum, -> { Orb::Models::Price::TieredWithMinimumPrice } + + variant :tiered_package_with_minimum, -> { Orb::Models::Price::TieredPackageWithMinimumPrice } + + variant :package_with_allocation, -> { Orb::Models::Price::PackageWithAllocationPrice } + + variant :unit_with_percent, -> { Orb::Models::Price::UnitWithPercentPrice } + + variant :matrix_with_allocation, -> { Orb::Models::Price::MatrixWithAllocationPrice } + + variant :tiered_with_proration, -> { Orb::Models::Price::TieredWithProrationPrice } + + variant :unit_with_proration, -> { Orb::Models::Price::UnitWithProrationPrice } + + variant :grouped_allocation, -> { Orb::Models::Price::GroupedAllocationPrice } + + variant :grouped_with_prorated_minimum, -> { Orb::Models::Price::GroupedWithProratedMinimumPrice } + + variant :grouped_with_metered_minimum, -> { Orb::Models::Price::GroupedWithMeteredMinimumPrice } + + variant :matrix_with_display_name, -> { Orb::Models::Price::MatrixWithDisplayNamePrice } + + variant :bulk_with_proration, -> { Orb::Models::Price::BulkWithProrationPrice } + + variant :grouped_tiered_package, -> { Orb::Models::Price::GroupedTieredPackagePrice } + + variant :max_group_tiered_package, -> { Orb::Models::Price::MaxGroupTieredPackagePrice } + + variant :scalable_matrix_with_unit_pricing, + -> { + Orb::Models::Price::ScalableMatrixWithUnitPricingPrice + } + + variant :scalable_matrix_with_tiered_pricing, + -> { Orb::Models::Price::ScalableMatrixWithTieredPricingPrice } + + # @example + # ```ruby + # unit_price => { + # id: String, + # billable_metric: Orb::Models::Price::UnitPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::UnitPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::UnitPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class UnitPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::UnitPrice::BillableMetric, nil] + required :billable_metric, -> { Orb::Models::Price::UnitPrice::BillableMetric }, nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::UnitPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, -> { Orb::Models::Price::UnitPrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::UnitPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::UnitPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::UnitPrice::CreditAllocation, nil] + required :credit_allocation, -> { Orb::Models::Price::UnitPrice::CreditAllocation }, nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::UnitPrice::Item] + required :item, -> { Orb::Models::Price::UnitPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::UnitPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::UnitPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::UnitPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::UnitPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :unit] + required :model_type, const: :unit + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::UnitPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::UnitPrice::PriceType } + + # @!attribute unit_config + # + # @return [Orb::Models::Price::UnitPrice::UnitConfig] + required :unit_config, -> { Orb::Models::Price::UnitPrice::UnitConfig } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::UnitPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::UnitPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::UnitPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::UnitPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::UnitPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::UnitPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::UnitPrice::Item] + # # @param maximum [Orb::Models::Price::UnitPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::UnitPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::UnitPrice::PriceType] + # # @param unit_config [Orb::Models::Price::UnitPrice::UnitConfig] + # # @param dimensional_price_configuration [Orb::Models::Price::UnitPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :unit] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # unit_config:, + # dimensional_price_configuration: nil, + # model_type: :unit, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::UnitPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::UnitPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::Price::UnitPrice::BillingCycleConfiguration::DurationUnit } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::UnitPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration::DurationUnit } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # unit_config => { + # unit_amount: String + # } + # ``` + class UnitConfig < Orb::BaseModel + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param unit_amount [String] + # # + # def initialize(unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # package_price => { + # id: String, + # billable_metric: Orb::Models::Price::PackagePrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::PackagePrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::PackagePrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class PackagePrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::PackagePrice::BillableMetric, nil] + required :billable_metric, -> { Orb::Models::Price::PackagePrice::BillableMetric }, nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::PackagePrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { + Orb::Models::Price::PackagePrice::BillingCycleConfiguration + } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::PackagePrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::PackagePrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::PackagePrice::CreditAllocation, nil] + required :credit_allocation, -> { Orb::Models::Price::PackagePrice::CreditAllocation }, nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::PackagePrice::Item] + required :item, -> { Orb::Models::Price::PackagePrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::PackagePrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::PackagePrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::PackagePrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::PackagePrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :package] + required :model_type, const: :package + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute package_config + # + # @return [Orb::Models::Price::PackagePrice::PackageConfig] + required :package_config, -> { Orb::Models::Price::PackagePrice::PackageConfig } + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::PackagePrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::PackagePrice::PriceType } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::PackagePrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::PackagePrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::PackagePrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::PackagePrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::PackagePrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::PackagePrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::PackagePrice::Item] + # # @param maximum [Orb::Models::Price::PackagePrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::PackagePrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param package_config [Orb::Models::Price::PackagePrice::PackageConfig] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::PackagePrice::PriceType] + # # @param dimensional_price_configuration [Orb::Models::Price::PackagePrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :package] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # package_config:, + # plan_phase_order:, + # price_type:, + # dimensional_price_configuration: nil, + # model_type: :package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::PackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::PackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::Price::PackagePrice::BillingCycleConfiguration::DurationUnit } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::PackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration::DurationUnit } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # package_config => { + # package_amount: String, + # package_size: Integer + # } + # ``` + class PackageConfig < Orb::BaseModel + # @!attribute package_amount + # A currency amount to rate usage by + # + # @return [String] + required :package_amount, String + + # @!attribute package_size + # An integer amount to represent package size. For example, 1000 here would divide + # usage by 1000 before multiplying by package_amount in rating + # + # @return [Integer] + required :package_size, Integer + + # @!parse + # # @param package_amount [String] + # # @param package_size [Integer] + # # + # def initialize(package_amount:, package_size:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # matrix_price => { + # id: String, + # billable_metric: Orb::Models::Price::MatrixPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::MatrixPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::MatrixPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class MatrixPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::MatrixPrice::BillableMetric, nil] + required :billable_metric, -> { Orb::Models::Price::MatrixPrice::BillableMetric }, nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::MatrixPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { + Orb::Models::Price::MatrixPrice::BillingCycleConfiguration + } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::MatrixPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::MatrixPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::MatrixPrice::CreditAllocation, nil] + required :credit_allocation, -> { Orb::Models::Price::MatrixPrice::CreditAllocation }, nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::MatrixPrice::Item] + required :item, -> { Orb::Models::Price::MatrixPrice::Item } + + # @!attribute matrix_config + # + # @return [Orb::Models::Price::MatrixPrice::MatrixConfig] + required :matrix_config, -> { Orb::Models::Price::MatrixPrice::MatrixConfig } + + # @!attribute maximum + # + # @return [Orb::Models::Price::MatrixPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::MatrixPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::MatrixPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::MatrixPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :matrix] + required :model_type, const: :matrix + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::MatrixPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::MatrixPrice::PriceType } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::MatrixPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::MatrixPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::MatrixPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::MatrixPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::MatrixPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::MatrixPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::MatrixPrice::Item] + # # @param matrix_config [Orb::Models::Price::MatrixPrice::MatrixConfig] + # # @param maximum [Orb::Models::Price::MatrixPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::MatrixPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::MatrixPrice::PriceType] + # # @param dimensional_price_configuration [Orb::Models::Price::MatrixPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :matrix] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # matrix_config:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # dimensional_price_configuration: nil, + # model_type: :matrix, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::MatrixPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::MatrixPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::Price::MatrixPrice::BillingCycleConfiguration::DurationUnit } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::MatrixPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration::DurationUnit } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # matrix_config => { + # default_unit_amount: String, + # dimensions: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # matrix_values: -> { Orb::ArrayOf[Orb::Models::Price::MatrixPrice::MatrixConfig::MatrixValue] === _1 } + # } + # ``` + class MatrixConfig < Orb::BaseModel + # @!attribute default_unit_amount + # Default per unit rate for any usage not bucketed into a specified matrix_value + # + # @return [String] + required :default_unit_amount, String + + # @!attribute dimensions + # One or two event property values to evaluate matrix groups by + # + # @return [Array] + required :dimensions, Orb::ArrayOf[String, nil?: true] + + # @!attribute matrix_values + # Matrix values for specified matrix grouping keys + # + # @return [Array] + required :matrix_values, + -> { + Orb::ArrayOf[Orb::Models::Price::MatrixPrice::MatrixConfig::MatrixValue] + } + + # @!parse + # # @param default_unit_amount [String] + # # @param dimensions [Array] + # # @param matrix_values [Array] + # # + # def initialize(default_unit_amount:, dimensions:, matrix_values:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # matrix_value => { + # dimension_values: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # unit_amount: String + # } + # ``` + class MatrixValue < Orb::BaseModel + # @!attribute dimension_values + # One or two matrix keys to filter usage to this Matrix value by. For example, + # ["region", "tier"] could be used to filter cloud usage by a cloud region and an + # instance tier. + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String, nil?: true] + + # @!attribute unit_amount + # Unit price for the specified dimension_values + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param dimension_values [Array] + # # @param unit_amount [String] + # # + # def initialize(dimension_values:, unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # tiered_price => { + # id: String, + # billable_metric: Orb::Models::Price::TieredPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::TieredPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::TieredPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class TieredPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::TieredPrice::BillableMetric, nil] + required :billable_metric, -> { Orb::Models::Price::TieredPrice::BillableMetric }, nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::TieredPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { + Orb::Models::Price::TieredPrice::BillingCycleConfiguration + } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::TieredPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::TieredPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::TieredPrice::CreditAllocation, nil] + required :credit_allocation, -> { Orb::Models::Price::TieredPrice::CreditAllocation }, nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::TieredPrice::Item] + required :item, -> { Orb::Models::Price::TieredPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::TieredPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::TieredPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::TieredPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::TieredPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :tiered] + required :model_type, const: :tiered + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::TieredPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::TieredPrice::PriceType } + + # @!attribute tiered_config + # + # @return [Orb::Models::Price::TieredPrice::TieredConfig] + required :tiered_config, -> { Orb::Models::Price::TieredPrice::TieredConfig } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::TieredPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::TieredPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::TieredPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::TieredPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::TieredPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::TieredPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::TieredPrice::Item] + # # @param maximum [Orb::Models::Price::TieredPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::TieredPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::TieredPrice::PriceType] + # # @param tiered_config [Orb::Models::Price::TieredPrice::TieredConfig] + # # @param dimensional_price_configuration [Orb::Models::Price::TieredPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :tiered] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # tiered_config:, + # dimensional_price_configuration: nil, + # model_type: :tiered, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::TieredPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::TieredPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::Price::TieredPrice::BillingCycleConfiguration::DurationUnit } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::TieredPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration::DurationUnit } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # tiered_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::Price::TieredPrice::TieredConfig::Tier] === _1 } + # } + # ``` + class TieredConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier + # + # @return [Array] + required :tiers, -> { Orb::ArrayOf[Orb::Models::Price::TieredPrice::TieredConfig::Tier] } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # first_unit: Float, + # unit_amount: String, + # last_unit: Float + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute first_unit + # Inclusive tier starting value + # + # @return [Float] + required :first_unit, Float + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute last_unit + # Exclusive tier ending value. If null, this is treated as the last tier + # + # @return [Float, nil] + optional :last_unit, Float, nil?: true + + # @!parse + # # @param first_unit [Float] + # # @param unit_amount [String] + # # @param last_unit [Float, nil] + # # + # def initialize(first_unit:, unit_amount:, last_unit: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # tiered_bps_price => { + # id: String, + # billable_metric: Orb::Models::Price::TieredBpsPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::TieredBpsPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class TieredBpsPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::TieredBpsPrice::BillableMetric, nil] + required :billable_metric, -> { Orb::Models::Price::TieredBpsPrice::BillableMetric }, nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::TieredBpsPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::TieredBpsPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::TieredBpsPrice::CreditAllocation, nil] + required :credit_allocation, -> { Orb::Models::Price::TieredBpsPrice::CreditAllocation }, nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::TieredBpsPrice::Item] + required :item, -> { Orb::Models::Price::TieredBpsPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::TieredBpsPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::TieredBpsPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::TieredBpsPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::TieredBpsPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :tiered_bps] + required :model_type, const: :tiered_bps + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::TieredBpsPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::TieredBpsPrice::PriceType } + + # @!attribute tiered_bps_config + # + # @return [Orb::Models::Price::TieredBpsPrice::TieredBpsConfig] + required :tiered_bps_config, -> { Orb::Models::Price::TieredBpsPrice::TieredBpsConfig } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::TieredBpsPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::TieredBpsPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::TieredBpsPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::TieredBpsPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::TieredBpsPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::TieredBpsPrice::Item] + # # @param maximum [Orb::Models::Price::TieredBpsPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::TieredBpsPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::TieredBpsPrice::PriceType] + # # @param tiered_bps_config [Orb::Models::Price::TieredBpsPrice::TieredBpsConfig] + # # @param dimensional_price_configuration [Orb::Models::Price::TieredBpsPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :tiered_bps] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # tiered_bps_config:, + # dimensional_price_configuration: nil, + # model_type: :tiered_bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration::DurationUnit } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration::DurationUnit } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # tiered_bps_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::Price::TieredBpsPrice::TieredBpsConfig::Tier] === _1 } + # } + # ``` + class TieredBpsConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + # tiers + # + # @return [Array] + required :tiers, -> { Orb::ArrayOf[Orb::Models::Price::TieredBpsPrice::TieredBpsConfig::Tier] } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # bps: Float, + # minimum_amount: String, + # maximum_amount: String, + # per_unit_maximum: String + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute bps + # Per-event basis point rate + # + # @return [Float] + required :bps, Float + + # @!attribute minimum_amount + # Inclusive tier starting value + # + # @return [String] + required :minimum_amount, String + + # @!attribute maximum_amount + # Exclusive tier ending value + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute per_unit_maximum + # Per unit maximum to charge + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param minimum_amount [String] + # # @param maximum_amount [String, nil] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # bps_price => { + # id: String, + # billable_metric: Orb::Models::Price::BpsPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::BpsPrice::BillingCycleConfiguration, + # bps_config: Orb::Models::Price::BpsPrice::BpsConfig, + # cadence: Orb::Models::Price::BpsPrice::Cadence, + # **_ + # } + # ``` + class BpsPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::BpsPrice::BillableMetric, nil] + required :billable_metric, -> { Orb::Models::Price::BpsPrice::BillableMetric }, nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::BpsPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, -> { Orb::Models::Price::BpsPrice::BillingCycleConfiguration } + + # @!attribute bps_config + # + # @return [Orb::Models::Price::BpsPrice::BpsConfig] + required :bps_config, -> { Orb::Models::Price::BpsPrice::BpsConfig } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::BpsPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::BpsPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::BpsPrice::CreditAllocation, nil] + required :credit_allocation, -> { Orb::Models::Price::BpsPrice::CreditAllocation }, nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::BpsPrice::Item] + required :item, -> { Orb::Models::Price::BpsPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::BpsPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::BpsPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::BpsPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::BpsPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :bps] + required :model_type, const: :bps + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::BpsPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::BpsPrice::PriceType } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::BpsPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::BpsPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::BpsPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::BpsPrice::BillingCycleConfiguration] + # # @param bps_config [Orb::Models::Price::BpsPrice::BpsConfig] + # # @param cadence [Symbol, Orb::Models::Price::BpsPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::BpsPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::BpsPrice::Item] + # # @param maximum [Orb::Models::Price::BpsPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::BpsPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::BpsPrice::PriceType] + # # @param dimensional_price_configuration [Orb::Models::Price::BpsPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :bps] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # bps_config:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # dimensional_price_configuration: nil, + # model_type: :bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::BpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::BpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::Price::BpsPrice::BillingCycleConfiguration::DurationUnit } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::BpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # bps_config => { + # bps: Float, + # per_unit_maximum: String + # } + # ``` + class BpsConfig < Orb::BaseModel + # @!attribute bps + # Basis point take rate per event + # + # @return [Float] + required :bps, Float + + # @!attribute per_unit_maximum + # Optional currency amount maximum to cap spend per event + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration::DurationUnit } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # bulk_bps_price => { + # id: String, + # billable_metric: Orb::Models::Price::BulkBpsPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration, + # bulk_bps_config: Orb::Models::Price::BulkBpsPrice::BulkBpsConfig, + # cadence: Orb::Models::Price::BulkBpsPrice::Cadence, + # **_ + # } + # ``` + class BulkBpsPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::BulkBpsPrice::BillableMetric, nil] + required :billable_metric, -> { Orb::Models::Price::BulkBpsPrice::BillableMetric }, nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { + Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration + } + + # @!attribute bulk_bps_config + # + # @return [Orb::Models::Price::BulkBpsPrice::BulkBpsConfig] + required :bulk_bps_config, -> { Orb::Models::Price::BulkBpsPrice::BulkBpsConfig } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::BulkBpsPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::BulkBpsPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::BulkBpsPrice::CreditAllocation, nil] + required :credit_allocation, -> { Orb::Models::Price::BulkBpsPrice::CreditAllocation }, nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::BulkBpsPrice::Item] + required :item, -> { Orb::Models::Price::BulkBpsPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::BulkBpsPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::BulkBpsPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::BulkBpsPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::BulkBpsPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :bulk_bps] + required :model_type, const: :bulk_bps + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::BulkBpsPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::BulkBpsPrice::PriceType } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::BulkBpsPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::BulkBpsPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::BulkBpsPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration] + # # @param bulk_bps_config [Orb::Models::Price::BulkBpsPrice::BulkBpsConfig] + # # @param cadence [Symbol, Orb::Models::Price::BulkBpsPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::BulkBpsPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::BulkBpsPrice::Item] + # # @param maximum [Orb::Models::Price::BulkBpsPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::BulkBpsPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::BulkBpsPrice::PriceType] + # # @param dimensional_price_configuration [Orb::Models::Price::BulkBpsPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :bulk_bps] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # bulk_bps_config:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # dimensional_price_configuration: nil, + # model_type: :bulk_bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration::DurationUnit } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # bulk_bps_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::Price::BulkBpsPrice::BulkBpsConfig::Tier] === _1 } + # } + # ``` + class BulkBpsConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for a bulk BPS pricing model where all usage is aggregated to a single + # tier based on total volume + # + # @return [Array] + required :tiers, -> { Orb::ArrayOf[Orb::Models::Price::BulkBpsPrice::BulkBpsConfig::Tier] } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # bps: Float, + # maximum_amount: String, + # per_unit_maximum: String + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute bps + # Basis points to rate on + # + # @return [Float] + required :bps, Float + + # @!attribute maximum_amount + # Upper bound for tier + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute per_unit_maximum + # The maximum amount to charge for any one event + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param maximum_amount [String, nil] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, maximum_amount: nil, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration::DurationUnit } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # bulk_price => { + # id: String, + # billable_metric: Orb::Models::Price::BulkPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::BulkPrice::BillingCycleConfiguration, + # bulk_config: Orb::Models::Price::BulkPrice::BulkConfig, + # cadence: Orb::Models::Price::BulkPrice::Cadence, + # **_ + # } + # ``` + class BulkPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::BulkPrice::BillableMetric, nil] + required :billable_metric, -> { Orb::Models::Price::BulkPrice::BillableMetric }, nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::BulkPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, -> { Orb::Models::Price::BulkPrice::BillingCycleConfiguration } + + # @!attribute bulk_config + # + # @return [Orb::Models::Price::BulkPrice::BulkConfig] + required :bulk_config, -> { Orb::Models::Price::BulkPrice::BulkConfig } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::BulkPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::BulkPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::BulkPrice::CreditAllocation, nil] + required :credit_allocation, -> { Orb::Models::Price::BulkPrice::CreditAllocation }, nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::BulkPrice::Item] + required :item, -> { Orb::Models::Price::BulkPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::BulkPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::BulkPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::BulkPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::BulkPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :bulk] + required :model_type, const: :bulk + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::BulkPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::BulkPrice::PriceType } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::BulkPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::BulkPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::BulkPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::BulkPrice::BillingCycleConfiguration] + # # @param bulk_config [Orb::Models::Price::BulkPrice::BulkConfig] + # # @param cadence [Symbol, Orb::Models::Price::BulkPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::BulkPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::BulkPrice::Item] + # # @param maximum [Orb::Models::Price::BulkPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::BulkPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::BulkPrice::PriceType] + # # @param dimensional_price_configuration [Orb::Models::Price::BulkPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :bulk] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # bulk_config:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # dimensional_price_configuration: nil, + # model_type: :bulk, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::BulkPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::BulkPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::Price::BulkPrice::BillingCycleConfiguration::DurationUnit } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::BulkPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # bulk_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::Price::BulkPrice::BulkConfig::Tier] === _1 } + # } + # ``` + class BulkConfig < Orb::BaseModel + # @!attribute tiers + # Bulk tiers for rating based on total usage volume + # + # @return [Array] + required :tiers, -> { Orb::ArrayOf[Orb::Models::Price::BulkPrice::BulkConfig::Tier] } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # unit_amount: String, + # maximum_units: Float + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute maximum_units + # Upper bound for this tier + # + # @return [Float, nil] + optional :maximum_units, Float, nil?: true + + # @!parse + # # @param unit_amount [String] + # # @param maximum_units [Float, nil] + # # + # def initialize(unit_amount:, maximum_units: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration::DurationUnit } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # threshold_total_amount_price => { + # id: String, + # billable_metric: Orb::Models::Price::ThresholdTotalAmountPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::ThresholdTotalAmountPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class ThresholdTotalAmountPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::ThresholdTotalAmountPrice::BillableMetric, nil] + required :billable_metric, + -> { Orb::Models::Price::ThresholdTotalAmountPrice::BillableMetric }, + nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::ThresholdTotalAmountPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::ThresholdTotalAmountPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::ThresholdTotalAmountPrice::CreditAllocation, nil] + required :credit_allocation, + -> { Orb::Models::Price::ThresholdTotalAmountPrice::CreditAllocation }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::ThresholdTotalAmountPrice::Item] + required :item, -> { Orb::Models::Price::ThresholdTotalAmountPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::ThresholdTotalAmountPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::ThresholdTotalAmountPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::ThresholdTotalAmountPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::ThresholdTotalAmountPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :threshold_total_amount] + required :model_type, const: :threshold_total_amount + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::ThresholdTotalAmountPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::ThresholdTotalAmountPrice::PriceType } + + # @!attribute threshold_total_amount_config + # + # @return [Hash{Symbol=>Object}] + required :threshold_total_amount_config, Orb::HashOf[Orb::Unknown] + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::ThresholdTotalAmountPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::ThresholdTotalAmountPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::ThresholdTotalAmountPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::ThresholdTotalAmountPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::ThresholdTotalAmountPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::ThresholdTotalAmountPrice::Item] + # # @param maximum [Orb::Models::Price::ThresholdTotalAmountPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::ThresholdTotalAmountPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::ThresholdTotalAmountPrice::PriceType] + # # @param threshold_total_amount_config [Hash{Symbol=>Object}] + # # @param dimensional_price_configuration [Orb::Models::Price::ThresholdTotalAmountPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :threshold_total_amount] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # threshold_total_amount_config:, + # dimensional_price_configuration: nil, + # model_type: :threshold_total_amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # tiered_package_price => { + # id: String, + # billable_metric: Orb::Models::Price::TieredPackagePrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::TieredPackagePrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class TieredPackagePrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::TieredPackagePrice::BillableMetric, nil] + required :billable_metric, -> { Orb::Models::Price::TieredPackagePrice::BillableMetric }, nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::TieredPackagePrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::TieredPackagePrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::TieredPackagePrice::CreditAllocation, nil] + required :credit_allocation, + -> { + Orb::Models::Price::TieredPackagePrice::CreditAllocation + }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::TieredPackagePrice::Item] + required :item, -> { Orb::Models::Price::TieredPackagePrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::TieredPackagePrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::TieredPackagePrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::TieredPackagePrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::TieredPackagePrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :tiered_package] + required :model_type, const: :tiered_package + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::TieredPackagePrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::TieredPackagePrice::PriceType } + + # @!attribute tiered_package_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_package_config, Orb::HashOf[Orb::Unknown] + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::TieredPackagePrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::TieredPackagePrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::TieredPackagePrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::TieredPackagePrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::TieredPackagePrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::TieredPackagePrice::Item] + # # @param maximum [Orb::Models::Price::TieredPackagePrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::TieredPackagePrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::TieredPackagePrice::PriceType] + # # @param tiered_package_config [Hash{Symbol=>Object}] + # # @param dimensional_price_configuration [Orb::Models::Price::TieredPackagePrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :tiered_package] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # tiered_package_config:, + # dimensional_price_configuration: nil, + # model_type: :tiered_package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # grouped_tiered_price => { + # id: String, + # billable_metric: Orb::Models::Price::GroupedTieredPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::GroupedTieredPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class GroupedTieredPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::GroupedTieredPrice::BillableMetric, nil] + required :billable_metric, -> { Orb::Models::Price::GroupedTieredPrice::BillableMetric }, nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::GroupedTieredPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::GroupedTieredPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::GroupedTieredPrice::CreditAllocation, nil] + required :credit_allocation, + -> { + Orb::Models::Price::GroupedTieredPrice::CreditAllocation + }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute grouped_tiered_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_tiered_config, Orb::HashOf[Orb::Unknown] + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::GroupedTieredPrice::Item] + required :item, -> { Orb::Models::Price::GroupedTieredPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::GroupedTieredPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::GroupedTieredPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::GroupedTieredPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::GroupedTieredPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :grouped_tiered] + required :model_type, const: :grouped_tiered + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::GroupedTieredPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::GroupedTieredPrice::PriceType } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::GroupedTieredPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::GroupedTieredPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::GroupedTieredPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::GroupedTieredPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::GroupedTieredPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param grouped_tiered_config [Hash{Symbol=>Object}] + # # @param invoicing_cycle_configuration [Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::GroupedTieredPrice::Item] + # # @param maximum [Orb::Models::Price::GroupedTieredPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::GroupedTieredPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::GroupedTieredPrice::PriceType] + # # @param dimensional_price_configuration [Orb::Models::Price::GroupedTieredPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :grouped_tiered] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # grouped_tiered_config:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # dimensional_price_configuration: nil, + # model_type: :grouped_tiered, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # tiered_with_minimum_price => { + # id: String, + # billable_metric: Orb::Models::Price::TieredWithMinimumPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::TieredWithMinimumPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class TieredWithMinimumPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::TieredWithMinimumPrice::BillableMetric, nil] + required :billable_metric, + -> { + Orb::Models::Price::TieredWithMinimumPrice::BillableMetric + }, + nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::TieredWithMinimumPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::TieredWithMinimumPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::TieredWithMinimumPrice::CreditAllocation, nil] + required :credit_allocation, + -> { Orb::Models::Price::TieredWithMinimumPrice::CreditAllocation }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::TieredWithMinimumPrice::Item] + required :item, -> { Orb::Models::Price::TieredWithMinimumPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::TieredWithMinimumPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::TieredWithMinimumPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::TieredWithMinimumPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::TieredWithMinimumPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :tiered_with_minimum] + required :model_type, const: :tiered_with_minimum + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::TieredWithMinimumPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::TieredWithMinimumPrice::PriceType } + + # @!attribute tiered_with_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_with_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::TieredWithMinimumPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::TieredWithMinimumPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::TieredWithMinimumPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::TieredWithMinimumPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::TieredWithMinimumPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::TieredWithMinimumPrice::Item] + # # @param maximum [Orb::Models::Price::TieredWithMinimumPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::TieredWithMinimumPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::TieredWithMinimumPrice::PriceType] + # # @param tiered_with_minimum_config [Hash{Symbol=>Object}] + # # @param dimensional_price_configuration [Orb::Models::Price::TieredWithMinimumPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :tiered_with_minimum] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # tiered_with_minimum_config:, + # dimensional_price_configuration: nil, + # model_type: :tiered_with_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # tiered_package_with_minimum_price => { + # id: String, + # billable_metric: Orb::Models::Price::TieredPackageWithMinimumPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::TieredPackageWithMinimumPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class TieredPackageWithMinimumPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::TieredPackageWithMinimumPrice::BillableMetric, nil] + required :billable_metric, + -> { Orb::Models::Price::TieredPackageWithMinimumPrice::BillableMetric }, + nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::TieredPackageWithMinimumPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::TieredPackageWithMinimumPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::TieredPackageWithMinimumPrice::CreditAllocation, nil] + required :credit_allocation, + -> { Orb::Models::Price::TieredPackageWithMinimumPrice::CreditAllocation }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::TieredPackageWithMinimumPrice::Item] + required :item, -> { Orb::Models::Price::TieredPackageWithMinimumPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::TieredPackageWithMinimumPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::TieredPackageWithMinimumPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::TieredPackageWithMinimumPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::TieredPackageWithMinimumPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :tiered_package_with_minimum] + required :model_type, const: :tiered_package_with_minimum + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::TieredPackageWithMinimumPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::TieredPackageWithMinimumPrice::PriceType } + + # @!attribute tiered_package_with_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_package_with_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::TieredPackageWithMinimumPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::TieredPackageWithMinimumPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::TieredPackageWithMinimumPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::TieredPackageWithMinimumPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::TieredPackageWithMinimumPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::TieredPackageWithMinimumPrice::Item] + # # @param maximum [Orb::Models::Price::TieredPackageWithMinimumPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::TieredPackageWithMinimumPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::TieredPackageWithMinimumPrice::PriceType] + # # @param tiered_package_with_minimum_config [Hash{Symbol=>Object}] + # # @param dimensional_price_configuration [Orb::Models::Price::TieredPackageWithMinimumPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :tiered_package_with_minimum] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # tiered_package_with_minimum_config:, + # dimensional_price_configuration: nil, + # model_type: :tiered_package_with_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # package_with_allocation_price => { + # id: String, + # billable_metric: Orb::Models::Price::PackageWithAllocationPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::PackageWithAllocationPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class PackageWithAllocationPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::PackageWithAllocationPrice::BillableMetric, nil] + required :billable_metric, + -> { Orb::Models::Price::PackageWithAllocationPrice::BillableMetric }, + nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::PackageWithAllocationPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::PackageWithAllocationPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::PackageWithAllocationPrice::CreditAllocation, nil] + required :credit_allocation, + -> { Orb::Models::Price::PackageWithAllocationPrice::CreditAllocation }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::PackageWithAllocationPrice::Item] + required :item, -> { Orb::Models::Price::PackageWithAllocationPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::PackageWithAllocationPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::PackageWithAllocationPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::PackageWithAllocationPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::PackageWithAllocationPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :package_with_allocation] + required :model_type, const: :package_with_allocation + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute package_with_allocation_config + # + # @return [Hash{Symbol=>Object}] + required :package_with_allocation_config, Orb::HashOf[Orb::Unknown] + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::PackageWithAllocationPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::PackageWithAllocationPrice::PriceType } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::PackageWithAllocationPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::PackageWithAllocationPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::PackageWithAllocationPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::PackageWithAllocationPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::PackageWithAllocationPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::PackageWithAllocationPrice::Item] + # # @param maximum [Orb::Models::Price::PackageWithAllocationPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::PackageWithAllocationPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param package_with_allocation_config [Hash{Symbol=>Object}] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::PackageWithAllocationPrice::PriceType] + # # @param dimensional_price_configuration [Orb::Models::Price::PackageWithAllocationPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :package_with_allocation] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # package_with_allocation_config:, + # plan_phase_order:, + # price_type:, + # dimensional_price_configuration: nil, + # model_type: :package_with_allocation, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # unit_with_percent_price => { + # id: String, + # billable_metric: Orb::Models::Price::UnitWithPercentPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::UnitWithPercentPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class UnitWithPercentPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::UnitWithPercentPrice::BillableMetric, nil] + required :billable_metric, -> { Orb::Models::Price::UnitWithPercentPrice::BillableMetric }, nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::UnitWithPercentPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::UnitWithPercentPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::UnitWithPercentPrice::CreditAllocation, nil] + required :credit_allocation, + -> { + Orb::Models::Price::UnitWithPercentPrice::CreditAllocation + }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::UnitWithPercentPrice::Item] + required :item, -> { Orb::Models::Price::UnitWithPercentPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::UnitWithPercentPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::UnitWithPercentPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::UnitWithPercentPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::UnitWithPercentPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :unit_with_percent] + required :model_type, const: :unit_with_percent + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::UnitWithPercentPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::UnitWithPercentPrice::PriceType } + + # @!attribute unit_with_percent_config + # + # @return [Hash{Symbol=>Object}] + required :unit_with_percent_config, Orb::HashOf[Orb::Unknown] + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::UnitWithPercentPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::UnitWithPercentPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::UnitWithPercentPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::UnitWithPercentPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::UnitWithPercentPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::UnitWithPercentPrice::Item] + # # @param maximum [Orb::Models::Price::UnitWithPercentPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::UnitWithPercentPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::UnitWithPercentPrice::PriceType] + # # @param unit_with_percent_config [Hash{Symbol=>Object}] + # # @param dimensional_price_configuration [Orb::Models::Price::UnitWithPercentPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :unit_with_percent] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # unit_with_percent_config:, + # dimensional_price_configuration: nil, + # model_type: :unit_with_percent, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # matrix_with_allocation_price => { + # id: String, + # billable_metric: Orb::Models::Price::MatrixWithAllocationPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::MatrixWithAllocationPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class MatrixWithAllocationPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::MatrixWithAllocationPrice::BillableMetric, nil] + required :billable_metric, + -> { Orb::Models::Price::MatrixWithAllocationPrice::BillableMetric }, + nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::MatrixWithAllocationPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::MatrixWithAllocationPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::MatrixWithAllocationPrice::CreditAllocation, nil] + required :credit_allocation, + -> { Orb::Models::Price::MatrixWithAllocationPrice::CreditAllocation }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::MatrixWithAllocationPrice::Item] + required :item, -> { Orb::Models::Price::MatrixWithAllocationPrice::Item } + + # @!attribute matrix_with_allocation_config + # + # @return [Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig] + required :matrix_with_allocation_config, + -> { Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig } + + # @!attribute maximum + # + # @return [Orb::Models::Price::MatrixWithAllocationPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::MatrixWithAllocationPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::MatrixWithAllocationPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::MatrixWithAllocationPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :matrix_with_allocation] + required :model_type, const: :matrix_with_allocation + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::MatrixWithAllocationPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::MatrixWithAllocationPrice::PriceType } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::MatrixWithAllocationPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::MatrixWithAllocationPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::MatrixWithAllocationPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::MatrixWithAllocationPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::MatrixWithAllocationPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::MatrixWithAllocationPrice::Item] + # # @param matrix_with_allocation_config [Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig] + # # @param maximum [Orb::Models::Price::MatrixWithAllocationPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::MatrixWithAllocationPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::MatrixWithAllocationPrice::PriceType] + # # @param dimensional_price_configuration [Orb::Models::Price::MatrixWithAllocationPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :matrix_with_allocation] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # matrix_with_allocation_config:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # dimensional_price_configuration: nil, + # model_type: :matrix_with_allocation, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # matrix_with_allocation_config => { + # allocation: Float, + # default_unit_amount: String, + # dimensions: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # matrix_values: -> { Orb::ArrayOf[Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue] === _1 } + # } + # ``` + class MatrixWithAllocationConfig < Orb::BaseModel + # @!attribute allocation + # Allocation to be used to calculate the price + # + # @return [Float] + required :allocation, Float + + # @!attribute default_unit_amount + # Default per unit rate for any usage not bucketed into a specified matrix_value + # + # @return [String] + required :default_unit_amount, String + + # @!attribute dimensions + # One or two event property values to evaluate matrix groups by + # + # @return [Array] + required :dimensions, Orb::ArrayOf[String, nil?: true] + + # @!attribute matrix_values + # Matrix values for specified matrix grouping keys + # + # @return [Array] + required :matrix_values, + -> { + Orb::ArrayOf[Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue] + } + + # @!parse + # # @param allocation [Float] + # # @param default_unit_amount [String] + # # @param dimensions [Array] + # # @param matrix_values [Array] + # # + # def initialize(allocation:, default_unit_amount:, dimensions:, matrix_values:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # matrix_value => { + # dimension_values: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # unit_amount: String + # } + # ``` + class MatrixValue < Orb::BaseModel + # @!attribute dimension_values + # One or two matrix keys to filter usage to this Matrix value by. For example, + # ["region", "tier"] could be used to filter cloud usage by a cloud region and an + # instance tier. + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String, nil?: true] + + # @!attribute unit_amount + # Unit price for the specified dimension_values + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param dimension_values [Array] + # # @param unit_amount [String] + # # + # def initialize(dimension_values:, unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # tiered_with_proration_price => { + # id: String, + # billable_metric: Orb::Models::Price::TieredWithProrationPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::TieredWithProrationPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class TieredWithProrationPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::TieredWithProrationPrice::BillableMetric, nil] + required :billable_metric, + -> { + Orb::Models::Price::TieredWithProrationPrice::BillableMetric + }, + nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::TieredWithProrationPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::TieredWithProrationPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::TieredWithProrationPrice::CreditAllocation, nil] + required :credit_allocation, + -> { Orb::Models::Price::TieredWithProrationPrice::CreditAllocation }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::TieredWithProrationPrice::Item] + required :item, -> { Orb::Models::Price::TieredWithProrationPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::TieredWithProrationPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::TieredWithProrationPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::TieredWithProrationPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::TieredWithProrationPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::TieredWithProrationPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::TieredWithProrationPrice::PriceType } + + # @!attribute tiered_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::TieredWithProrationPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::TieredWithProrationPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::TieredWithProrationPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::TieredWithProrationPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::TieredWithProrationPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::TieredWithProrationPrice::Item] + # # @param maximum [Orb::Models::Price::TieredWithProrationPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::TieredWithProrationPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::TieredWithProrationPrice::PriceType] + # # @param tiered_with_proration_config [Hash{Symbol=>Object}] + # # @param dimensional_price_configuration [Orb::Models::Price::TieredWithProrationPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :tiered_with_proration] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # tiered_with_proration_config:, + # dimensional_price_configuration: nil, + # model_type: :tiered_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # unit_with_proration_price => { + # id: String, + # billable_metric: Orb::Models::Price::UnitWithProrationPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::UnitWithProrationPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class UnitWithProrationPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::UnitWithProrationPrice::BillableMetric, nil] + required :billable_metric, + -> { + Orb::Models::Price::UnitWithProrationPrice::BillableMetric + }, + nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::UnitWithProrationPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::UnitWithProrationPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::UnitWithProrationPrice::CreditAllocation, nil] + required :credit_allocation, + -> { Orb::Models::Price::UnitWithProrationPrice::CreditAllocation }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::UnitWithProrationPrice::Item] + required :item, -> { Orb::Models::Price::UnitWithProrationPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::UnitWithProrationPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::UnitWithProrationPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::UnitWithProrationPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::UnitWithProrationPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :unit_with_proration] + required :model_type, const: :unit_with_proration + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::UnitWithProrationPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::UnitWithProrationPrice::PriceType } + + # @!attribute unit_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :unit_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::UnitWithProrationPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::UnitWithProrationPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::UnitWithProrationPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::UnitWithProrationPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::UnitWithProrationPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::UnitWithProrationPrice::Item] + # # @param maximum [Orb::Models::Price::UnitWithProrationPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::UnitWithProrationPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::UnitWithProrationPrice::PriceType] + # # @param unit_with_proration_config [Hash{Symbol=>Object}] + # # @param dimensional_price_configuration [Orb::Models::Price::UnitWithProrationPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :unit_with_proration] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # unit_with_proration_config:, + # dimensional_price_configuration: nil, + # model_type: :unit_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # grouped_allocation_price => { + # id: String, + # billable_metric: Orb::Models::Price::GroupedAllocationPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::GroupedAllocationPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class GroupedAllocationPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::GroupedAllocationPrice::BillableMetric, nil] + required :billable_metric, + -> { + Orb::Models::Price::GroupedAllocationPrice::BillableMetric + }, + nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::GroupedAllocationPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::GroupedAllocationPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::GroupedAllocationPrice::CreditAllocation, nil] + required :credit_allocation, + -> { Orb::Models::Price::GroupedAllocationPrice::CreditAllocation }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute grouped_allocation_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_allocation_config, Orb::HashOf[Orb::Unknown] + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::GroupedAllocationPrice::Item] + required :item, -> { Orb::Models::Price::GroupedAllocationPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::GroupedAllocationPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::GroupedAllocationPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::GroupedAllocationPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::GroupedAllocationPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :grouped_allocation] + required :model_type, const: :grouped_allocation + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::GroupedAllocationPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::GroupedAllocationPrice::PriceType } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::GroupedAllocationPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::GroupedAllocationPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::GroupedAllocationPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::GroupedAllocationPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::GroupedAllocationPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param grouped_allocation_config [Hash{Symbol=>Object}] + # # @param invoicing_cycle_configuration [Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::GroupedAllocationPrice::Item] + # # @param maximum [Orb::Models::Price::GroupedAllocationPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::GroupedAllocationPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::GroupedAllocationPrice::PriceType] + # # @param dimensional_price_configuration [Orb::Models::Price::GroupedAllocationPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :grouped_allocation] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # grouped_allocation_config:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # dimensional_price_configuration: nil, + # model_type: :grouped_allocation, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # grouped_with_prorated_minimum_price => { + # id: String, + # billable_metric: Orb::Models::Price::GroupedWithProratedMinimumPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::GroupedWithProratedMinimumPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class GroupedWithProratedMinimumPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::GroupedWithProratedMinimumPrice::BillableMetric, nil] + required :billable_metric, + -> { Orb::Models::Price::GroupedWithProratedMinimumPrice::BillableMetric }, + nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::GroupedWithProratedMinimumPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::GroupedWithProratedMinimumPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::GroupedWithProratedMinimumPrice::CreditAllocation, nil] + required :credit_allocation, + -> { Orb::Models::Price::GroupedWithProratedMinimumPrice::CreditAllocation }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute grouped_with_prorated_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_with_prorated_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::GroupedWithProratedMinimumPrice::Item] + required :item, -> { Orb::Models::Price::GroupedWithProratedMinimumPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::GroupedWithProratedMinimumPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::GroupedWithProratedMinimumPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::GroupedWithProratedMinimumPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::GroupedWithProratedMinimumPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :grouped_with_prorated_minimum] + required :model_type, const: :grouped_with_prorated_minimum + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::GroupedWithProratedMinimumPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::GroupedWithProratedMinimumPrice::PriceType } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::GroupedWithProratedMinimumPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::GroupedWithProratedMinimumPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::GroupedWithProratedMinimumPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::GroupedWithProratedMinimumPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::GroupedWithProratedMinimumPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param grouped_with_prorated_minimum_config [Hash{Symbol=>Object}] + # # @param invoicing_cycle_configuration [Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::GroupedWithProratedMinimumPrice::Item] + # # @param maximum [Orb::Models::Price::GroupedWithProratedMinimumPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::GroupedWithProratedMinimumPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::GroupedWithProratedMinimumPrice::PriceType] + # # @param dimensional_price_configuration [Orb::Models::Price::GroupedWithProratedMinimumPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :grouped_with_prorated_minimum] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # grouped_with_prorated_minimum_config:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # dimensional_price_configuration: nil, + # model_type: :grouped_with_prorated_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # grouped_with_metered_minimum_price => { + # id: String, + # billable_metric: Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::GroupedWithMeteredMinimumPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class GroupedWithMeteredMinimumPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillableMetric, nil] + required :billable_metric, + -> { Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillableMetric }, + nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::GroupedWithMeteredMinimumPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::GroupedWithMeteredMinimumPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::GroupedWithMeteredMinimumPrice::CreditAllocation, nil] + required :credit_allocation, + -> { Orb::Models::Price::GroupedWithMeteredMinimumPrice::CreditAllocation }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute grouped_with_metered_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_with_metered_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::GroupedWithMeteredMinimumPrice::Item] + required :item, -> { Orb::Models::Price::GroupedWithMeteredMinimumPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::GroupedWithMeteredMinimumPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::GroupedWithMeteredMinimumPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::GroupedWithMeteredMinimumPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::GroupedWithMeteredMinimumPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :grouped_with_metered_minimum] + required :model_type, const: :grouped_with_metered_minimum + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::GroupedWithMeteredMinimumPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::GroupedWithMeteredMinimumPrice::PriceType } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::GroupedWithMeteredMinimumPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::GroupedWithMeteredMinimumPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::GroupedWithMeteredMinimumPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::GroupedWithMeteredMinimumPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param grouped_with_metered_minimum_config [Hash{Symbol=>Object}] + # # @param invoicing_cycle_configuration [Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::GroupedWithMeteredMinimumPrice::Item] + # # @param maximum [Orb::Models::Price::GroupedWithMeteredMinimumPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::GroupedWithMeteredMinimumPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::GroupedWithMeteredMinimumPrice::PriceType] + # # @param dimensional_price_configuration [Orb::Models::Price::GroupedWithMeteredMinimumPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :grouped_with_metered_minimum] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # grouped_with_metered_minimum_config:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # dimensional_price_configuration: nil, + # model_type: :grouped_with_metered_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # matrix_with_display_name_price => { + # id: String, + # billable_metric: Orb::Models::Price::MatrixWithDisplayNamePrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::MatrixWithDisplayNamePrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class MatrixWithDisplayNamePrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::MatrixWithDisplayNamePrice::BillableMetric, nil] + required :billable_metric, + -> { Orb::Models::Price::MatrixWithDisplayNamePrice::BillableMetric }, + nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::MatrixWithDisplayNamePrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::MatrixWithDisplayNamePrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::MatrixWithDisplayNamePrice::CreditAllocation, nil] + required :credit_allocation, + -> { Orb::Models::Price::MatrixWithDisplayNamePrice::CreditAllocation }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::MatrixWithDisplayNamePrice::Item] + required :item, -> { Orb::Models::Price::MatrixWithDisplayNamePrice::Item } + + # @!attribute matrix_with_display_name_config + # + # @return [Hash{Symbol=>Object}] + required :matrix_with_display_name_config, Orb::HashOf[Orb::Unknown] + + # @!attribute maximum + # + # @return [Orb::Models::Price::MatrixWithDisplayNamePrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::MatrixWithDisplayNamePrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::MatrixWithDisplayNamePrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::MatrixWithDisplayNamePrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :matrix_with_display_name] + required :model_type, const: :matrix_with_display_name + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::MatrixWithDisplayNamePrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::MatrixWithDisplayNamePrice::PriceType } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::MatrixWithDisplayNamePrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::MatrixWithDisplayNamePrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::MatrixWithDisplayNamePrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::MatrixWithDisplayNamePrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::MatrixWithDisplayNamePrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::MatrixWithDisplayNamePrice::Item] + # # @param matrix_with_display_name_config [Hash{Symbol=>Object}] + # # @param maximum [Orb::Models::Price::MatrixWithDisplayNamePrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::MatrixWithDisplayNamePrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::MatrixWithDisplayNamePrice::PriceType] + # # @param dimensional_price_configuration [Orb::Models::Price::MatrixWithDisplayNamePrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :matrix_with_display_name] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # matrix_with_display_name_config:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # dimensional_price_configuration: nil, + # model_type: :matrix_with_display_name, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # bulk_with_proration_price => { + # id: String, + # billable_metric: Orb::Models::Price::BulkWithProrationPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration, + # bulk_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # cadence: Orb::Models::Price::BulkWithProrationPrice::Cadence, + # **_ + # } + # ``` + class BulkWithProrationPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::BulkWithProrationPrice::BillableMetric, nil] + required :billable_metric, + -> { + Orb::Models::Price::BulkWithProrationPrice::BillableMetric + }, + nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration } + + # @!attribute bulk_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :bulk_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::BulkWithProrationPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::BulkWithProrationPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::BulkWithProrationPrice::CreditAllocation, nil] + required :credit_allocation, + -> { Orb::Models::Price::BulkWithProrationPrice::CreditAllocation }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::BulkWithProrationPrice::Item] + required :item, -> { Orb::Models::Price::BulkWithProrationPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::BulkWithProrationPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::BulkWithProrationPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::BulkWithProrationPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::BulkWithProrationPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :bulk_with_proration] + required :model_type, const: :bulk_with_proration + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::BulkWithProrationPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::BulkWithProrationPrice::PriceType } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::BulkWithProrationPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::BulkWithProrationPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::BulkWithProrationPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration] + # # @param bulk_with_proration_config [Hash{Symbol=>Object}] + # # @param cadence [Symbol, Orb::Models::Price::BulkWithProrationPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::BulkWithProrationPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::BulkWithProrationPrice::Item] + # # @param maximum [Orb::Models::Price::BulkWithProrationPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::BulkWithProrationPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::BulkWithProrationPrice::PriceType] + # # @param dimensional_price_configuration [Orb::Models::Price::BulkWithProrationPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :bulk_with_proration] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # bulk_with_proration_config:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # dimensional_price_configuration: nil, + # model_type: :bulk_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # grouped_tiered_package_price => { + # id: String, + # billable_metric: Orb::Models::Price::GroupedTieredPackagePrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::GroupedTieredPackagePrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class GroupedTieredPackagePrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::GroupedTieredPackagePrice::BillableMetric, nil] + required :billable_metric, + -> { Orb::Models::Price::GroupedTieredPackagePrice::BillableMetric }, + nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::GroupedTieredPackagePrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::GroupedTieredPackagePrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::GroupedTieredPackagePrice::CreditAllocation, nil] + required :credit_allocation, + -> { Orb::Models::Price::GroupedTieredPackagePrice::CreditAllocation }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute grouped_tiered_package_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_tiered_package_config, Orb::HashOf[Orb::Unknown] + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::GroupedTieredPackagePrice::Item] + required :item, -> { Orb::Models::Price::GroupedTieredPackagePrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::GroupedTieredPackagePrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::GroupedTieredPackagePrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::GroupedTieredPackagePrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::GroupedTieredPackagePrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :grouped_tiered_package] + required :model_type, const: :grouped_tiered_package + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::GroupedTieredPackagePrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::GroupedTieredPackagePrice::PriceType } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::GroupedTieredPackagePrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::GroupedTieredPackagePrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::GroupedTieredPackagePrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::GroupedTieredPackagePrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::GroupedTieredPackagePrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param grouped_tiered_package_config [Hash{Symbol=>Object}] + # # @param invoicing_cycle_configuration [Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::GroupedTieredPackagePrice::Item] + # # @param maximum [Orb::Models::Price::GroupedTieredPackagePrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::GroupedTieredPackagePrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::GroupedTieredPackagePrice::PriceType] + # # @param dimensional_price_configuration [Orb::Models::Price::GroupedTieredPackagePrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :grouped_tiered_package] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # grouped_tiered_package_config:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # dimensional_price_configuration: nil, + # model_type: :grouped_tiered_package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # max_group_tiered_package_price => { + # id: String, + # billable_metric: Orb::Models::Price::MaxGroupTieredPackagePrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::MaxGroupTieredPackagePrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class MaxGroupTieredPackagePrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::MaxGroupTieredPackagePrice::BillableMetric, nil] + required :billable_metric, + -> { Orb::Models::Price::MaxGroupTieredPackagePrice::BillableMetric }, + nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::MaxGroupTieredPackagePrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::MaxGroupTieredPackagePrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::MaxGroupTieredPackagePrice::CreditAllocation, nil] + required :credit_allocation, + -> { Orb::Models::Price::MaxGroupTieredPackagePrice::CreditAllocation }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::MaxGroupTieredPackagePrice::Item] + required :item, -> { Orb::Models::Price::MaxGroupTieredPackagePrice::Item } + + # @!attribute max_group_tiered_package_config + # + # @return [Hash{Symbol=>Object}] + required :max_group_tiered_package_config, Orb::HashOf[Orb::Unknown] + + # @!attribute maximum + # + # @return [Orb::Models::Price::MaxGroupTieredPackagePrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::MaxGroupTieredPackagePrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::MaxGroupTieredPackagePrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::MaxGroupTieredPackagePrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :max_group_tiered_package] + required :model_type, const: :max_group_tiered_package + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::MaxGroupTieredPackagePrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::MaxGroupTieredPackagePrice::PriceType } + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::MaxGroupTieredPackagePrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::MaxGroupTieredPackagePrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::MaxGroupTieredPackagePrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::MaxGroupTieredPackagePrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::MaxGroupTieredPackagePrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::MaxGroupTieredPackagePrice::Item] + # # @param max_group_tiered_package_config [Hash{Symbol=>Object}] + # # @param maximum [Orb::Models::Price::MaxGroupTieredPackagePrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::MaxGroupTieredPackagePrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::MaxGroupTieredPackagePrice::PriceType] + # # @param dimensional_price_configuration [Orb::Models::Price::MaxGroupTieredPackagePrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :max_group_tiered_package] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # max_group_tiered_package_config:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # dimensional_price_configuration: nil, + # model_type: :max_group_tiered_package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # scalable_matrix_with_unit_pricing_price => { + # id: String, + # billable_metric: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class ScalableMatrixWithUnitPricingPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillableMetric, nil] + required :billable_metric, + -> { Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillableMetric }, + nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::CreditAllocation, nil] + required :credit_allocation, + -> { Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::CreditAllocation }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Item] + required :item, -> { Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Maximum, nil] + required :maximum, -> { Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Maximum }, nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Minimum, nil] + required :minimum, -> { Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Minimum }, nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :scalable_matrix_with_unit_pricing] + required :model_type, const: :scalable_matrix_with_unit_pricing + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::PriceType } + + # @!attribute scalable_matrix_with_unit_pricing_config + # + # @return [Hash{Symbol=>Object}] + required :scalable_matrix_with_unit_pricing_config, Orb::HashOf[Orb::Unknown] + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::DimensionalPriceConfiguration }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Item] + # # @param maximum [Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::PriceType] + # # @param scalable_matrix_with_unit_pricing_config [Hash{Symbol=>Object}] + # # @param dimensional_price_configuration [Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :scalable_matrix_with_unit_pricing] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # scalable_matrix_with_unit_pricing_config:, + # dimensional_price_configuration: nil, + # model_type: :scalable_matrix_with_unit_pricing, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # scalable_matrix_with_tiered_pricing_price => { + # id: String, + # billable_metric: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillableMetric, + # billing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration, + # cadence: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Cadence, + # conversion_rate: Float, + # **_ + # } + # ``` + class ScalableMatrixWithTieredPricingPrice < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billable_metric + # + # @return [Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillableMetric, nil] + required :billable_metric, + -> { Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillableMetric }, + nil?: true + + # @!attribute billing_cycle_configuration + # + # @return [Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration] + required :billing_cycle_configuration, + -> { Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration } + + # @!attribute cadence + # + # @return [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Cadence] + required :cadence, enum: -> { Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Cadence } + + # @!attribute conversion_rate + # + # @return [Float, nil] + required :conversion_rate, Float, nil?: true + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute credit_allocation + # + # @return [Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::CreditAllocation, nil] + required :credit_allocation, + -> { Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::CreditAllocation }, + nil?: true + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute discount + # + # @return [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + required :discount, union: -> { Orb::Models::Discount }, nil?: true + + # @!attribute external_price_id + # + # @return [String, nil] + required :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # + # @return [Float, nil] + required :fixed_price_quantity, Float, nil?: true + + # @!attribute invoicing_cycle_configuration + # + # @return [Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration, nil] + required :invoicing_cycle_configuration, + -> { Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute item + # + # @return [Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Item] + required :item, -> { Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Item } + + # @!attribute maximum + # + # @return [Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Maximum, nil] + required :maximum, + -> { + Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Maximum + }, + nil?: true + + # @!attribute maximum_amount + # + # @return [String, nil] + required :maximum_amount, String, nil?: true + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum + # + # @return [Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Minimum, nil] + required :minimum, + -> { + Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Minimum + }, + nil?: true + + # @!attribute minimum_amount + # + # @return [String, nil] + required :minimum_amount, String, nil?: true + + # @!attribute model_type + # + # @return [Symbol, :scalable_matrix_with_tiered_pricing] + required :model_type, const: :scalable_matrix_with_tiered_pricing + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute plan_phase_order + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute price_type + # + # @return [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::PriceType] + required :price_type, enum: -> { Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::PriceType } + + # @!attribute scalable_matrix_with_tiered_pricing_config + # + # @return [Hash{Symbol=>Object}] + required :scalable_matrix_with_tiered_pricing_config, Orb::HashOf[Orb::Unknown] + + # @!attribute dimensional_price_configuration + # + # @return [Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::DimensionalPriceConfiguration, nil] + optional :dimensional_price_configuration, + -> { + Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::DimensionalPriceConfiguration + }, + nil?: true + + # @!parse + # # @param id [String] + # # @param billable_metric [Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillableMetric, nil] + # # @param billing_cycle_configuration [Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration] + # # @param cadence [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Cadence] + # # @param conversion_rate [Float, nil] + # # @param created_at [Time] + # # @param credit_allocation [Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::CreditAllocation, nil] + # # @param currency [String] + # # @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoicing_cycle_configuration [Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration, nil] + # # @param item [Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Item] + # # @param maximum [Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Maximum, nil] + # # @param maximum_amount [String, nil] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum [Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Minimum, nil] + # # @param minimum_amount [String, nil] + # # @param name [String] + # # @param plan_phase_order [Integer, nil] + # # @param price_type [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::PriceType] + # # @param scalable_matrix_with_tiered_pricing_config [Hash{Symbol=>Object}] + # # @param dimensional_price_configuration [Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::DimensionalPriceConfiguration, nil] + # # @param model_type [Symbol, :scalable_matrix_with_tiered_pricing] + # # + # def initialize( + # id:, + # billable_metric:, + # billing_cycle_configuration:, + # cadence:, + # conversion_rate:, + # created_at:, + # credit_allocation:, + # currency:, + # discount:, + # external_price_id:, + # fixed_price_quantity:, + # invoicing_cycle_configuration:, + # item:, + # maximum:, + # maximum_amount:, + # metadata:, + # minimum:, + # minimum_amount:, + # name:, + # plan_phase_order:, + # price_type:, + # scalable_matrix_with_tiered_pricing_config:, + # dimensional_price_configuration: nil, + # model_type: :scalable_matrix_with_tiered_pricing, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!parse + # # @param id [String] + # # + # def initialize(id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # credit_allocation => { + # allows_rollover: Orb::BooleanModel, + # currency: String + # } + # ``` + class CreditAllocation < Orb::BaseModel + # @!attribute allows_rollover + # + # @return [Boolean] + required :allows_rollover, Orb::BooleanModel + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param allows_rollover [Boolean] + # # @param currency [String] + # # + # def initialize(allows_rollover:, currency:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # + # @return [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # item => { + # id: String, + # name: String + # } + # ``` + class Item < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String + # } + # ``` + class Maximum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this maximum amount applies to. For plan/plan phase + # maximums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # Maximum amount applied + # + # @return [String] + required :maximum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # minimum_amount: String + # } + # ``` + class Minimum < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this minimum amount applies to. For plan/plan phase + # minimums, this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute minimum_amount + # Minimum amount applied + # + # @return [String] + required :minimum_amount, String + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param minimum_amount [String] + # # + # def initialize(applies_to_price_ids:, minimum_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case price_type + # in :usage_price + # # ... + # in :fixed_price + # # ... + # end + # ``` + class PriceType < Orb::Enum + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # dimensional_price_configuration => { + # dimension_values: -> { Orb::ArrayOf[String] === _1 }, + # dimensional_price_group_id: String + # } + # ``` + class DimensionalPriceConfiguration < Orb::BaseModel + # @!attribute dimension_values + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String] + + # @!attribute dimensional_price_group_id + # + # @return [String] + required :dimensional_price_group_id, String + + # @!parse + # # @param dimension_values [Array] + # # @param dimensional_price_group_id [String] + # # + # def initialize(dimension_values:, dimensional_price_group_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + end +end diff --git a/lib/orb/models/price_create_params.rb b/lib/orb/models/price_create_params.rb new file mode 100644 index 00000000..f67f5c1f --- /dev/null +++ b/lib/orb/models/price_create_params.rb @@ -0,0 +1,972 @@ +# frozen_string_literal: true + +module Orb + module Models + class PriceCreateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::PriceCreateParams::Cadence] + required :cadence, enum: -> { Orb::Models::PriceCreateParams::Cadence } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, Orb::Models::PriceCreateParams::ModelType] + required :model_type, enum: -> { Orb::Models::PriceCreateParams::ModelType } + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_config + # + # @return [Orb::Models::PriceCreateParams::UnitConfig] + required :unit_config, -> { Orb::Models::PriceCreateParams::UnitConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::PriceCreateParams::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { Orb::Models::PriceCreateParams::BillingCycleConfiguration }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::PriceCreateParams::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { Orb::Models::PriceCreateParams::InvoicingCycleConfiguration }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute package_config + # + # @return [Orb::Models::PriceCreateParams::PackageConfig] + required :package_config, -> { Orb::Models::PriceCreateParams::PackageConfig } + + # @!attribute matrix_config + # + # @return [Orb::Models::PriceCreateParams::MatrixConfig] + required :matrix_config, -> { Orb::Models::PriceCreateParams::MatrixConfig } + + # @!attribute matrix_with_allocation_config + # + # @return [Orb::Models::PriceCreateParams::MatrixWithAllocationConfig] + required :matrix_with_allocation_config, + -> { + Orb::Models::PriceCreateParams::MatrixWithAllocationConfig + } + + # @!attribute tiered_config + # + # @return [Orb::Models::PriceCreateParams::TieredConfig] + required :tiered_config, -> { Orb::Models::PriceCreateParams::TieredConfig } + + # @!attribute tiered_bps_config + # + # @return [Orb::Models::PriceCreateParams::TieredBpsConfig] + required :tiered_bps_config, -> { Orb::Models::PriceCreateParams::TieredBpsConfig } + + # @!attribute bps_config + # + # @return [Orb::Models::PriceCreateParams::BpsConfig] + required :bps_config, -> { Orb::Models::PriceCreateParams::BpsConfig } + + # @!attribute bulk_bps_config + # + # @return [Orb::Models::PriceCreateParams::BulkBpsConfig] + required :bulk_bps_config, -> { Orb::Models::PriceCreateParams::BulkBpsConfig } + + # @!attribute bulk_config + # + # @return [Orb::Models::PriceCreateParams::BulkConfig] + required :bulk_config, -> { Orb::Models::PriceCreateParams::BulkConfig } + + # @!attribute threshold_total_amount_config + # + # @return [Hash{Symbol=>Object}] + required :threshold_total_amount_config, Orb::HashOf[Orb::Unknown] + + # @!attribute tiered_package_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_package_config, Orb::HashOf[Orb::Unknown] + + # @!attribute grouped_tiered_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_tiered_config, Orb::HashOf[Orb::Unknown] + + # @!attribute max_group_tiered_package_config + # + # @return [Hash{Symbol=>Object}] + required :max_group_tiered_package_config, Orb::HashOf[Orb::Unknown] + + # @!attribute tiered_with_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_with_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute package_with_allocation_config + # + # @return [Hash{Symbol=>Object}] + required :package_with_allocation_config, Orb::HashOf[Orb::Unknown] + + # @!attribute tiered_package_with_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_package_with_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute unit_with_percent_config + # + # @return [Hash{Symbol=>Object}] + required :unit_with_percent_config, Orb::HashOf[Orb::Unknown] + + # @!attribute tiered_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute unit_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :unit_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute grouped_allocation_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_allocation_config, Orb::HashOf[Orb::Unknown] + + # @!attribute grouped_with_prorated_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_with_prorated_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute grouped_with_metered_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_with_metered_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute matrix_with_display_name_config + # + # @return [Hash{Symbol=>Object}] + required :matrix_with_display_name_config, Orb::HashOf[Orb::Unknown] + + # @!attribute bulk_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :bulk_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute grouped_tiered_package_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_tiered_package_config, Orb::HashOf[Orb::Unknown] + + # @!attribute scalable_matrix_with_unit_pricing_config + # + # @return [Hash{Symbol=>Object}] + required :scalable_matrix_with_unit_pricing_config, Orb::HashOf[Orb::Unknown] + + # @!attribute scalable_matrix_with_tiered_pricing_config + # + # @return [Hash{Symbol=>Object}] + required :scalable_matrix_with_tiered_pricing_config, Orb::HashOf[Orb::Unknown] + + # @!parse + # # @param cadence [Symbol, Orb::Models::PriceCreateParams::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param model_type [Symbol, Orb::Models::PriceCreateParams::ModelType] + # # @param name [String] + # # @param unit_config [Orb::Models::PriceCreateParams::UnitConfig] + # # @param package_config [Orb::Models::PriceCreateParams::PackageConfig] + # # @param matrix_config [Orb::Models::PriceCreateParams::MatrixConfig] + # # @param matrix_with_allocation_config [Orb::Models::PriceCreateParams::MatrixWithAllocationConfig] + # # @param tiered_config [Orb::Models::PriceCreateParams::TieredConfig] + # # @param tiered_bps_config [Orb::Models::PriceCreateParams::TieredBpsConfig] + # # @param bps_config [Orb::Models::PriceCreateParams::BpsConfig] + # # @param bulk_bps_config [Orb::Models::PriceCreateParams::BulkBpsConfig] + # # @param bulk_config [Orb::Models::PriceCreateParams::BulkConfig] + # # @param threshold_total_amount_config [Hash{Symbol=>Object}] + # # @param tiered_package_config [Hash{Symbol=>Object}] + # # @param grouped_tiered_config [Hash{Symbol=>Object}] + # # @param max_group_tiered_package_config [Hash{Symbol=>Object}] + # # @param tiered_with_minimum_config [Hash{Symbol=>Object}] + # # @param package_with_allocation_config [Hash{Symbol=>Object}] + # # @param tiered_package_with_minimum_config [Hash{Symbol=>Object}] + # # @param unit_with_percent_config [Hash{Symbol=>Object}] + # # @param tiered_with_proration_config [Hash{Symbol=>Object}] + # # @param unit_with_proration_config [Hash{Symbol=>Object}] + # # @param grouped_allocation_config [Hash{Symbol=>Object}] + # # @param grouped_with_prorated_minimum_config [Hash{Symbol=>Object}] + # # @param grouped_with_metered_minimum_config [Hash{Symbol=>Object}] + # # @param matrix_with_display_name_config [Hash{Symbol=>Object}] + # # @param bulk_with_proration_config [Hash{Symbol=>Object}] + # # @param grouped_tiered_package_config [Hash{Symbol=>Object}] + # # @param scalable_matrix_with_unit_pricing_config [Hash{Symbol=>Object}] + # # @param scalable_matrix_with_tiered_pricing_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::PriceCreateParams::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::PriceCreateParams::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # model_type:, + # name:, + # unit_config:, + # package_config:, + # matrix_config:, + # matrix_with_allocation_config:, + # tiered_config:, + # tiered_bps_config:, + # bps_config:, + # bulk_bps_config:, + # bulk_config:, + # threshold_total_amount_config:, + # tiered_package_config:, + # grouped_tiered_config:, + # max_group_tiered_package_config:, + # tiered_with_minimum_config:, + # package_with_allocation_config:, + # tiered_package_with_minimum_config:, + # unit_with_percent_config:, + # tiered_with_proration_config:, + # unit_with_proration_config:, + # grouped_allocation_config:, + # grouped_with_prorated_minimum_config:, + # grouped_with_metered_minimum_config:, + # matrix_with_display_name_config:, + # bulk_with_proration_config:, + # grouped_tiered_package_config:, + # scalable_matrix_with_unit_pricing_config:, + # scalable_matrix_with_tiered_pricing_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # @example + # ```ruby + # case model_type + # in :scalable_matrix_with_tiered_pricing + # # ... + # end + # ``` + class ModelType < Orb::Enum + SCALABLE_MATRIX_WITH_TIERED_PRICING = :scalable_matrix_with_tiered_pricing + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # unit_config => { + # unit_amount: String + # } + # ``` + class UnitConfig < Orb::BaseModel + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param unit_amount [String] + # # + # def initialize(unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PriceCreateParams::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PriceCreateParams::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::PriceCreateParams::BillingCycleConfiguration::DurationUnit } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PriceCreateParams::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::PriceCreateParams::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::PriceCreateParams::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { Orb::Models::PriceCreateParams::InvoicingCycleConfiguration::DurationUnit } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::PriceCreateParams::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # package_config => { + # package_amount: String, + # package_size: Integer + # } + # ``` + class PackageConfig < Orb::BaseModel + # @!attribute package_amount + # A currency amount to rate usage by + # + # @return [String] + required :package_amount, String + + # @!attribute package_size + # An integer amount to represent package size. For example, 1000 here would divide + # usage by 1000 before multiplying by package_amount in rating + # + # @return [Integer] + required :package_size, Integer + + # @!parse + # # @param package_amount [String] + # # @param package_size [Integer] + # # + # def initialize(package_amount:, package_size:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # matrix_config => { + # default_unit_amount: String, + # dimensions: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # matrix_values: -> { Orb::ArrayOf[Orb::Models::PriceCreateParams::MatrixConfig::MatrixValue] === _1 } + # } + # ``` + class MatrixConfig < Orb::BaseModel + # @!attribute default_unit_amount + # Default per unit rate for any usage not bucketed into a specified matrix_value + # + # @return [String] + required :default_unit_amount, String + + # @!attribute dimensions + # One or two event property values to evaluate matrix groups by + # + # @return [Array] + required :dimensions, Orb::ArrayOf[String, nil?: true] + + # @!attribute matrix_values + # Matrix values for specified matrix grouping keys + # + # @return [Array] + required :matrix_values, + -> { + Orb::ArrayOf[Orb::Models::PriceCreateParams::MatrixConfig::MatrixValue] + } + + # @!parse + # # @param default_unit_amount [String] + # # @param dimensions [Array] + # # @param matrix_values [Array] + # # + # def initialize(default_unit_amount:, dimensions:, matrix_values:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # matrix_value => { + # dimension_values: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # unit_amount: String + # } + # ``` + class MatrixValue < Orb::BaseModel + # @!attribute dimension_values + # One or two matrix keys to filter usage to this Matrix value by. For example, + # ["region", "tier"] could be used to filter cloud usage by a cloud region and an + # instance tier. + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String, nil?: true] + + # @!attribute unit_amount + # Unit price for the specified dimension_values + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param dimension_values [Array] + # # @param unit_amount [String] + # # + # def initialize(dimension_values:, unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # matrix_with_allocation_config => { + # allocation: Float, + # default_unit_amount: String, + # dimensions: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # matrix_values: -> { Orb::ArrayOf[Orb::Models::PriceCreateParams::MatrixWithAllocationConfig::MatrixValue] === _1 } + # } + # ``` + class MatrixWithAllocationConfig < Orb::BaseModel + # @!attribute allocation + # Allocation to be used to calculate the price + # + # @return [Float] + required :allocation, Float + + # @!attribute default_unit_amount + # Default per unit rate for any usage not bucketed into a specified matrix_value + # + # @return [String] + required :default_unit_amount, String + + # @!attribute dimensions + # One or two event property values to evaluate matrix groups by + # + # @return [Array] + required :dimensions, Orb::ArrayOf[String, nil?: true] + + # @!attribute matrix_values + # Matrix values for specified matrix grouping keys + # + # @return [Array] + required :matrix_values, + -> { Orb::ArrayOf[Orb::Models::PriceCreateParams::MatrixWithAllocationConfig::MatrixValue] } + + # @!parse + # # @param allocation [Float] + # # @param default_unit_amount [String] + # # @param dimensions [Array] + # # @param matrix_values [Array] + # # + # def initialize(allocation:, default_unit_amount:, dimensions:, matrix_values:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # matrix_value => { + # dimension_values: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # unit_amount: String + # } + # ``` + class MatrixValue < Orb::BaseModel + # @!attribute dimension_values + # One or two matrix keys to filter usage to this Matrix value by. For example, + # ["region", "tier"] could be used to filter cloud usage by a cloud region and an + # instance tier. + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String, nil?: true] + + # @!attribute unit_amount + # Unit price for the specified dimension_values + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param dimension_values [Array] + # # @param unit_amount [String] + # # + # def initialize(dimension_values:, unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # tiered_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::PriceCreateParams::TieredConfig::Tier] === _1 } + # } + # ``` + class TieredConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier + # + # @return [Array] + required :tiers, -> { Orb::ArrayOf[Orb::Models::PriceCreateParams::TieredConfig::Tier] } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # first_unit: Float, + # unit_amount: String, + # last_unit: Float + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute first_unit + # Inclusive tier starting value + # + # @return [Float] + required :first_unit, Float + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute last_unit + # Exclusive tier ending value. If null, this is treated as the last tier + # + # @return [Float, nil] + optional :last_unit, Float, nil?: true + + # @!parse + # # @param first_unit [Float] + # # @param unit_amount [String] + # # @param last_unit [Float, nil] + # # + # def initialize(first_unit:, unit_amount:, last_unit: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # tiered_bps_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::PriceCreateParams::TieredBpsConfig::Tier] === _1 } + # } + # ``` + class TieredBpsConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + # tiers + # + # @return [Array] + required :tiers, -> { Orb::ArrayOf[Orb::Models::PriceCreateParams::TieredBpsConfig::Tier] } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # bps: Float, + # minimum_amount: String, + # maximum_amount: String, + # per_unit_maximum: String + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute bps + # Per-event basis point rate + # + # @return [Float] + required :bps, Float + + # @!attribute minimum_amount + # Inclusive tier starting value + # + # @return [String] + required :minimum_amount, String + + # @!attribute maximum_amount + # Exclusive tier ending value + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute per_unit_maximum + # Per unit maximum to charge + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param minimum_amount [String] + # # @param maximum_amount [String, nil] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # bps_config => { + # bps: Float, + # per_unit_maximum: String + # } + # ``` + class BpsConfig < Orb::BaseModel + # @!attribute bps + # Basis point take rate per event + # + # @return [Float] + required :bps, Float + + # @!attribute per_unit_maximum + # Optional currency amount maximum to cap spend per event + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # bulk_bps_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::PriceCreateParams::BulkBpsConfig::Tier] === _1 } + # } + # ``` + class BulkBpsConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for a bulk BPS pricing model where all usage is aggregated to a single + # tier based on total volume + # + # @return [Array] + required :tiers, -> { Orb::ArrayOf[Orb::Models::PriceCreateParams::BulkBpsConfig::Tier] } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # bps: Float, + # maximum_amount: String, + # per_unit_maximum: String + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute bps + # Basis points to rate on + # + # @return [Float] + required :bps, Float + + # @!attribute maximum_amount + # Upper bound for tier + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute per_unit_maximum + # The maximum amount to charge for any one event + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param maximum_amount [String, nil] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, maximum_amount: nil, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # bulk_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::PriceCreateParams::BulkConfig::Tier] === _1 } + # } + # ``` + class BulkConfig < Orb::BaseModel + # @!attribute tiers + # Bulk tiers for rating based on total usage volume + # + # @return [Array] + required :tiers, -> { Orb::ArrayOf[Orb::Models::PriceCreateParams::BulkConfig::Tier] } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # unit_amount: String, + # maximum_units: Float + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute maximum_units + # Upper bound for this tier + # + # @return [Float, nil] + optional :maximum_units, Float, nil?: true + + # @!parse + # # @param unit_amount [String] + # # @param maximum_units [Float, nil] + # # + # def initialize(unit_amount:, maximum_units: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + end +end diff --git a/lib/orb/models/price_evaluate_params.rb b/lib/orb/models/price_evaluate_params.rb new file mode 100644 index 00000000..5277759e --- /dev/null +++ b/lib/orb/models/price_evaluate_params.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +module Orb + module Models + class PriceEvaluateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute timeframe_end + # The exclusive upper bound for event timestamps + # + # @return [Time] + required :timeframe_end, Time + + # @!attribute timeframe_start + # The inclusive lower bound for event timestamps + # + # @return [Time] + required :timeframe_start, Time + + # @!attribute customer_id + # The ID of the customer to which this evaluation is scoped. + # + # @return [String, nil] + optional :customer_id, String, nil?: true + + # @!attribute external_customer_id + # The external customer ID of the customer to which this evaluation is scoped. + # + # @return [String, nil] + optional :external_customer_id, String, nil?: true + + # @!attribute filter + # A boolean + # [computed property](/extensibility/advanced-metrics#computed-properties) used to + # filter the underlying billable metric + # + # @return [String, nil] + optional :filter, String, nil?: true + + # @!attribute [r] grouping_keys + # Properties (or + # [computed properties](/extensibility/advanced-metrics#computed-properties)) used + # to group the underlying billable metric + # + # @return [Array, nil] + optional :grouping_keys, Orb::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :grouping_keys + + # @!parse + # # @param timeframe_end [Time] + # # @param timeframe_start [Time] + # # @param customer_id [String, nil] + # # @param external_customer_id [String, nil] + # # @param filter [String, nil] + # # @param grouping_keys [Array] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # timeframe_end:, + # timeframe_start:, + # customer_id: nil, + # external_customer_id: nil, + # filter: nil, + # grouping_keys: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/price_evaluate_response.rb b/lib/orb/models/price_evaluate_response.rb new file mode 100644 index 00000000..48f1f12e --- /dev/null +++ b/lib/orb/models/price_evaluate_response.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # price_evaluate_response => { + # data: -> { Orb::ArrayOf[Orb::Models::EvaluatePriceGroup] === _1 } + # } + # ``` + class PriceEvaluateResponse < Orb::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Orb::ArrayOf[Orb::Models::EvaluatePriceGroup] } + + # @!parse + # # @param data [Array] + # # + # def initialize(data:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/price_fetch_params.rb b/lib/orb/models/price_fetch_params.rb new file mode 100644 index 00000000..a1c906ed --- /dev/null +++ b/lib/orb/models/price_fetch_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class PriceFetchParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/price_list_params.rb b/lib/orb/models/price_list_params.rb new file mode 100644 index 00000000..49eb0400 --- /dev/null +++ b/lib/orb/models/price_list_params.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Orb + module Models + class PriceListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!parse + # # @param cursor [String, nil] + # # @param limit [Integer] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(cursor: nil, limit: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/price_update_params.rb b/lib/orb/models/price_update_params.rb new file mode 100644 index 00000000..6b79c65f --- /dev/null +++ b/lib/orb/models/price_update_params.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Orb + module Models + class PriceUpdateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/prices/external_price_id_fetch_params.rb b/lib/orb/models/prices/external_price_id_fetch_params.rb new file mode 100644 index 00000000..5f095717 --- /dev/null +++ b/lib/orb/models/prices/external_price_id_fetch_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Orb + module Models + module Prices + class ExternalPriceIDFetchParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/prices/external_price_id_update_params.rb b/lib/orb/models/prices/external_price_id_update_params.rb new file mode 100644 index 00000000..568b6789 --- /dev/null +++ b/lib/orb/models/prices/external_price_id_update_params.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Orb + module Models + module Prices + class ExternalPriceIDUpdateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/subscription.rb b/lib/orb/models/subscription.rb index 168950d2..d60819cf 100644 --- a/lib/orb/models/subscription.rb +++ b/lib/orb/models/subscription.rb @@ -1,129 +1,1447 @@ -require "orb/model" -require "orb/models/customer" -require "orb/models/plan" +# frozen_string_literal: true + module Orb module Models - class Subscription < Orb::Model - class FixedFeeQuantitySchedule < Orb::Model - # @!attribute [rw] end_date - required :end_date, String - # @!attribute [rw] price_id + # @example + # ```ruby + # subscription => { + # id: String, + # active_plan_phase_order: Integer, + # adjustment_intervals: -> { Orb::ArrayOf[Orb::Models::Subscription::AdjustmentInterval] === _1 }, + # auto_collection: Orb::BooleanModel, + # billing_cycle_anchor_configuration: Orb::Models::Subscription::BillingCycleAnchorConfiguration, + # **_ + # } + # ``` + class Subscription < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute active_plan_phase_order + # The current plan phase that is active, only if the subscription's plan has + # phases. + # + # @return [Integer, nil] + required :active_plan_phase_order, Integer, nil?: true + + # @!attribute adjustment_intervals + # The adjustment intervals for this subscription. + # + # @return [Array] + required :adjustment_intervals, -> { Orb::ArrayOf[Orb::Models::Subscription::AdjustmentInterval] } + + # @!attribute auto_collection + # Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. This property defaults to + # the plan's behavior. If null, defaults to the customer's setting. + # + # @return [Boolean, nil] + required :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_anchor_configuration + # + # @return [Orb::Models::Subscription::BillingCycleAnchorConfiguration] + required :billing_cycle_anchor_configuration, + -> { Orb::Models::Subscription::BillingCycleAnchorConfiguration } + + # @!attribute billing_cycle_day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is not part of the billing period. Set to null for + # subscriptions that are not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if the subscription is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute customer + # A customer is a buyer of your products, and the other party to the billing + # relationship. + # + # In Orb, customers are assigned system generated identifiers automatically, but + # it's often desirable to have these match existing identifiers in your system. To + # avoid having to denormalize Orb ID information, you can pass in an + # `external_customer_id` with your own identifier. See + # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + # information about how these aliases work in Orb. + # + # In addition to having an identifier in your system, a customer may exist in a + # payment provider solution like Stripe. Use the `payment_provider_id` and the + # `payment_provider` enum field to express this mapping. + # + # A customer also has a timezone (from the standard + # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + # your account's timezone. See [Timezone localization](/essentials/timezones) for + # information on what this timezone parameter influences within Orb. + # + # @return [Orb::Models::Customer] + required :customer, -> { Orb::Models::Customer } + + # @!attribute default_invoice_memo + # Determines the default memo on this subscriptions' invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @return [String, nil] + required :default_invoice_memo, String, nil?: true + + # @!attribute discount_intervals + # The discount intervals for this subscription. + # + # @return [Array] + required :discount_intervals, -> { Orb::ArrayOf[union: Orb::Models::Subscription::DiscountInterval] } + + # @!attribute end_date + # The date Orb stops billing for this subscription. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_schedule + # + # @return [Array] + required :fixed_fee_quantity_schedule, + -> { Orb::ArrayOf[Orb::Models::Subscription::FixedFeeQuantitySchedule] } + + # @!attribute invoicing_threshold + # + # @return [String, nil] + required :invoicing_threshold, String, nil?: true + + # @!attribute maximum_intervals + # The maximum intervals for this subscription. + # + # @return [Array] + required :maximum_intervals, -> { Orb::ArrayOf[Orb::Models::Subscription::MaximumInterval] } + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum_intervals + # The minimum intervals for this subscription. + # + # @return [Array] + required :minimum_intervals, -> { Orb::ArrayOf[Orb::Models::Subscription::MinimumInterval] } + + # @!attribute net_terms + # Determines the difference between the invoice issue date for subscription + # invoices as the date that they are due. A value of `0` here represents that the + # invoice is due on issue, whereas a value of `30` represents that the customer + # has a month to pay the invoice. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute plan + # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + # subscribed to by a customer. Plans define the billing behavior of the + # subscription. You can see more about how to configure prices in the + # [Price resource](/reference/price). + # + # @return [Orb::Models::Plan] + required :plan, -> { Orb::Models::Plan } + + # @!attribute price_intervals + # The price intervals for this subscription. + # + # @return [Array] + required :price_intervals, -> { Orb::ArrayOf[Orb::Models::Subscription::PriceInterval] } + + # @!attribute redeemed_coupon + # + # @return [Orb::Models::Subscription::RedeemedCoupon, nil] + required :redeemed_coupon, -> { Orb::Models::Subscription::RedeemedCoupon }, nil?: true + + # @!attribute start_date + # The date Orb starts billing for this subscription. + # + # @return [Time] + required :start_date, Time + + # @!attribute status + # + # @return [Symbol, Orb::Models::Subscription::Status] + required :status, enum: -> { Orb::Models::Subscription::Status } + + # @!attribute trial_info + # + # @return [Orb::Models::Subscription::TrialInfo] + required :trial_info, -> { Orb::Models::Subscription::TrialInfo } + + # @!parse + # # A [subscription](/core-concepts#subscription) represents the purchase of a plan + # # by a customer. + # # + # # By default, subscriptions begin on the day that they're created and renew + # # automatically for each billing cycle at the cadence that's configured in the + # # plan definition. + # # + # # Subscriptions also default to **beginning of month alignment**, which means the + # # first invoice issued for the subscription will have pro-rated charges between + # # the `start_date` and the first of the following month. Subsequent billing + # # periods will always start and end on a month boundary (e.g. subsequent month + # # starts for monthly billing). + # # + # # Depending on the plan configuration, any _flat_ recurring fees will be billed + # # either at the beginning (in-advance) or end (in-arrears) of each billing cycle. + # # Plans default to **in-advance billing**. Usage-based fees are billed in arrears + # # as usage is accumulated. In the normal course of events, you can expect an + # # invoice to contain usage-based charges for the previous period, and a recurring + # # fee for the following period. + # # + # # @param id [String] + # # @param active_plan_phase_order [Integer, nil] + # # @param adjustment_intervals [Array] + # # @param auto_collection [Boolean, nil] + # # @param billing_cycle_anchor_configuration [Orb::Models::Subscription::BillingCycleAnchorConfiguration] + # # @param billing_cycle_day [Integer] + # # @param created_at [Time] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param customer [Orb::Models::Customer] + # # @param default_invoice_memo [String, nil] + # # @param discount_intervals [Array] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_schedule [Array] + # # @param invoicing_threshold [String, nil] + # # @param maximum_intervals [Array] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum_intervals [Array] + # # @param net_terms [Integer] + # # @param plan [Orb::Models::Plan] + # # @param price_intervals [Array] + # # @param redeemed_coupon [Orb::Models::Subscription::RedeemedCoupon, nil] + # # @param start_date [Time] + # # @param status [Symbol, Orb::Models::Subscription::Status] + # # @param trial_info [Orb::Models::Subscription::TrialInfo] + # # + # def initialize( + # id:, + # active_plan_phase_order:, + # adjustment_intervals:, + # auto_collection:, + # billing_cycle_anchor_configuration:, + # billing_cycle_day:, + # created_at:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # customer:, + # default_invoice_memo:, + # discount_intervals:, + # end_date:, + # fixed_fee_quantity_schedule:, + # invoicing_threshold:, + # maximum_intervals:, + # metadata:, + # minimum_intervals:, + # net_terms:, + # plan:, + # price_intervals:, + # redeemed_coupon:, + # start_date:, + # status:, + # trial_info:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # adjustment_interval => { + # id: String, + # adjustment: Orb::Models::Subscription::AdjustmentInterval::Adjustment, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # start_date: Time + # } + # ``` + class AdjustmentInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment + # + # @return [Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::Subscription::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::Subscription::AdjustmentInterval::Adjustment::MaximumAdjustment] + required :adjustment, union: -> { Orb::Models::Subscription::AdjustmentInterval::Adjustment } + + # @!attribute applies_to_price_interval_ids + # The price interval IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the adjustment interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the adjustment interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param id [String] + # # @param adjustment [Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::Subscription::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::Subscription::AdjustmentInterval::Adjustment::MaximumAdjustment] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "amount_discount", id: String, amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscountAdjustment ... + # in {adjustment_type: "percentage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment ... + # in {adjustment_type: "usage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscountAdjustment ... + # in {adjustment_type: "minimum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::Subscription::AdjustmentInterval::Adjustment::MinimumAdjustment ... + # in {adjustment_type: "maximum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::Subscription::AdjustmentInterval::Adjustment::MaximumAdjustment ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + # # ... + # in Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + # # ... + # in Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + # # ... + # in Orb::Models::Subscription::AdjustmentInterval::Adjustment::MinimumAdjustment + # # ... + # in Orb::Models::Subscription::AdjustmentInterval::Adjustment::MaximumAdjustment + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :amount_discount, + -> { Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscountAdjustment } + + variant :percentage_discount, + -> { Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment } + + variant :usage_discount, + -> { Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscountAdjustment } + + variant :minimum, + -> { + Orb::Models::Subscription::AdjustmentInterval::Adjustment::MinimumAdjustment + } + + variant :maximum, + -> { + Orb::Models::Subscription::AdjustmentInterval::Adjustment::MaximumAdjustment + } + + # @example + # ```ruby + # amount_discount_adjustment => { + # id: String, + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # **_ + # } + # ``` + class AmountDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # The amount by which to discount the prices this adjustment applies to in a given + # billing period. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize( + # id:, + # amount_discount:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # adjustment_type: :amount_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_adjustment => { + # id: String, + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # percentage_discount: Float, + # **_ + # } + # ``` + class PercentageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute percentage_discount + # The percentage (as a value between 0 and 1) by which to discount the price + # intervals this adjustment applies to in a given billing period. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param percentage_discount [Float] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # percentage_discount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_adjustment => { + # id: String, + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # plan_phase_order: Integer, + # **_ + # } + # ``` + class UsageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute usage_discount + # The number of usage units by which to discount the price this adjustment applies + # to in a given billing period. + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param usage_discount [Float] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # usage_discount:, + # adjustment_type: :usage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_adjustment => { + # id: String, + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # item_id: String, + # **_ + # } + # ``` + class MinimumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # item_id:, + # minimum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_adjustment => { + # id: String, + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # maximum_amount: String, + # **_ + # } + # ``` + class MaximumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param maximum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # maximum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :maximum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # billing_cycle_anchor_configuration => { + # day: Integer, + # month: Integer, + # year: Integer + # } + # ``` + class BillingCycleAnchorConfiguration < Orb::BaseModel + # @!attribute day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :day, Integer + + # @!attribute month + # The month on which the billing cycle is anchored (e.g. a quarterly price + # anchored in February would have cycles starting February, May, August, and + # November). + # + # @return [Integer, nil] + optional :month, Integer, nil?: true + + # @!attribute year + # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle + # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + # + # @return [Integer, nil] + optional :year, Integer, nil?: true + + # @!parse + # # @param day [Integer] + # # @param month [Integer, nil] + # # @param year [Integer, nil] + # # + # def initialize(day:, month: nil, year: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case discount_interval + # in {discount_type: "amount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::Subscription::DiscountInterval::AmountDiscountInterval ... + # in {discount_type: "percentage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::Subscription::DiscountInterval::PercentageDiscountInterval ... + # in {discount_type: "usage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::Subscription::DiscountInterval::UsageDiscountInterval ... + # end + # ``` + # + # @example + # ```ruby + # case discount_interval + # in Orb::Models::Subscription::DiscountInterval::AmountDiscountInterval + # # ... + # in Orb::Models::Subscription::DiscountInterval::PercentageDiscountInterval + # # ... + # in Orb::Models::Subscription::DiscountInterval::UsageDiscountInterval + # # ... + # end + # ``` + class DiscountInterval < Orb::Union + discriminator :discount_type + + variant :amount, -> { Orb::Models::Subscription::DiscountInterval::AmountDiscountInterval } + + variant :percentage, -> { Orb::Models::Subscription::DiscountInterval::PercentageDiscountInterval } + + variant :usage, -> { Orb::Models::Subscription::DiscountInterval::UsageDiscountInterval } + + # @example + # ```ruby + # amount_discount_interval => { + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :amount, + # end_date: Time + # } + # ``` + class AmountDiscountInterval < Orb::BaseModel + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :amount] + required :discount_type, const: :amount + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param discount_type [Symbol, :amount] + # # + # def initialize( + # amount_discount:, + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # discount_type: :amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :percentage, + # end_date: Time, + # percentage_discount: Float + # } + # ``` + class PercentageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :percentage] + required :discount_type, const: :percentage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`.This is a number between 0 + # and 1. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param percentage_discount [Float] + # # @param start_date [Time] + # # @param discount_type [Symbol, :percentage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # percentage_discount:, + # start_date:, + # discount_type: :percentage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :usage, + # end_date: Time, + # start_date: Time + # } + # ``` + class UsageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :usage] + required :discount_type, const: :usage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param usage_discount [Float] + # # @param discount_type [Symbol, :usage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # usage_discount:, + # discount_type: :usage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # fixed_fee_quantity_schedule => { + # end_date: Time, + # price_id: String, + # quantity: Float, + # start_date: Time + # } + # ``` + class FixedFeeQuantitySchedule < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute price_id + # + # @return [String] required :price_id, String - # @!attribute [rw] quantity + + # @!attribute quantity + # + # @return [Float] required :quantity, Float - # @!attribute [rw] start_date - required :start_date, String + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param end_date [Time, nil] + # # @param price_id [String] + # # @param quantity [Float] + # # @param start_date [Time] + # # + # def initialize(end_date:, price_id:, quantity:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class MaximumIntervals < Orb::Model - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] applies_to_price_interval_ids - required :applies_to_price_interval_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] end_date - required :end_date, String - # @!attribute [rw] maximum_amount + + # @example + # ```ruby + # maximum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # maximum_amount: String, + # start_date: Time + # } + # ``` + class MaximumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the maximum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the price intervals + # this transform applies to. + # + # @return [String] required :maximum_amount, String - # @!attribute [rw] start_date - required :start_date, String + + # @!attribute start_date + # The start date of the maximum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param maximum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, maximum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class MinimumIntervals < Orb::Model - # @!attribute [rw] applies_to_price_ids - required :applies_to_price_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] applies_to_price_interval_ids - required :applies_to_price_interval_ids, Orb::ArrayOf.new(String) - # @!attribute [rw] end_date - required :end_date, String - # @!attribute [rw] minimum_amount + + # @example + # ```ruby + # minimum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # minimum_amount: String, + # start_date: Time + # } + # ``` + class MinimumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the minimum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the price intervals + # this minimum applies to. + # + # @return [String] required :minimum_amount, String - # @!attribute [rw] start_date - required :start_date, String + + # @!attribute start_date + # The start date of the minimum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param minimum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, minimum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class PriceIntervals < Orb::Model - class FixedFeeQuantityTransitions < Orb::Model - # @!attribute [rw] effective_date - required :effective_date, String - # @!attribute [rw] price_id - required :price_id, String - # @!attribute [rw] quantity - required :quantity, Integer - end - # @!attribute [rw] id + + # @example + # ```ruby + # price_interval => { + # id: String, + # billing_cycle_day: Integer, + # current_billing_period_end_date: Time, + # current_billing_period_start_date: Time, + # end_date: Time, + # **_ + # } + # ``` + class PriceInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] required :id, String - # @!attribute [rw] billing_cycle_day + + # @!attribute billing_cycle_day + # The day of the month that Orb bills for this price + # + # @return [Integer] required :billing_cycle_day, Integer - # @!attribute [rw] current_billing_period_end_date - required :current_billing_period_end_date, String - # @!attribute [rw] current_billing_period_start_date - required :current_billing_period_start_date, String - # @!attribute [rw] end_date - required :end_date, String - # @!attribute [rw] fixed_fee_quantity_transitions + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is exactly the end of the billing period. Set to null if + # this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute end_date + # The end date of the price interval. This is the date that Orb stops billing for + # this price. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_transitions + # The fixed fee quantity transitions for this price interval. This is only + # relevant for fixed fees. + # + # @return [Array, nil] required :fixed_fee_quantity_transitions, - Orb::ArrayOf.new(FixedFeeQuantityTransitions) - # @!attribute [rw] price - required :price, Orb::Unknown - # @!attribute [rw] start_date - required :start_date, String + -> { Orb::ArrayOf[Orb::Models::Subscription::PriceInterval::FixedFeeQuantityTransition] }, + nil?: true + + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + required :price, union: -> { Orb::Models::Price } + + # @!attribute start_date + # The start date of the price interval. This is the date that Orb starts billing + # for this price. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # The Price Interval resource represents a period of time for which a price will + # # bill on a subscription. A subscription’s price intervals define its billing + # # behavior. + # # + # # @param id [String] + # # @param billing_cycle_day [Integer] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_transitions [Array, nil] + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # # @param start_date [Time] + # # + # def initialize( + # id:, + # billing_cycle_day:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # end_date:, + # fixed_fee_quantity_transitions:, + # price:, + # start_date:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # fixed_fee_quantity_transition => { + # effective_date: Time, + # price_id: String, + # quantity: Integer + # } + # ``` + class FixedFeeQuantityTransition < Orb::BaseModel + # @!attribute effective_date + # + # @return [Time] + required :effective_date, Time + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Integer] + required :quantity, Integer + + # @!parse + # # @param effective_date [Time] + # # @param price_id [String] + # # @param quantity [Integer] + # # + # def initialize(effective_date:, price_id:, quantity:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end end - class RedeemedCoupon < Orb::Model - # @!attribute [rw] coupon_id + + # @example + # ```ruby + # redeemed_coupon => { + # coupon_id: String, + # end_date: Time, + # start_date: Time + # } + # ``` + class RedeemedCoupon < Orb::BaseModel + # @!attribute coupon_id + # + # @return [String] required :coupon_id, String - # @!attribute [rw] end_date - required :end_date, String - # @!attribute [rw] start_date - required :start_date, String + + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param coupon_id [String] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(coupon_id:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - class TrialInfo < Orb::Model - # @!attribute [rw] end_date - required :end_date, String + + # @abstract + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :ended + # # ... + # in :upcoming + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # trial_info => { + # end_date: Time + # } + # ``` + class TrialInfo < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!parse + # # @param end_date [Time, nil] + # # + # def initialize(end_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - # @!attribute [rw] id - required :id, String - # @!attribute [rw] active_plan_phase_order - required :active_plan_phase_order, Integer - # @!attribute [rw] auto_collection - required :auto_collection, Orb::BooleanModel - # @!attribute [rw] billing_cycle_day - required :billing_cycle_day, Integer - # @!attribute [rw] created_at - required :created_at, String - # @!attribute [rw] current_billing_period_end_date - required :current_billing_period_end_date, String - # @!attribute [rw] current_billing_period_start_date - required :current_billing_period_start_date, String - # @!attribute [rw] customer - required :customer, Orb::Models::Customer - # @!attribute [rw] default_invoice_memo - required :default_invoice_memo, String - # @!attribute [rw] discount_intervals - required :discount_intervals, Orb::ArrayOf.new(Orb::Unknown) - # @!attribute [rw] end_date - required :end_date, String - # @!attribute [rw] fixed_fee_quantity_schedule - required :fixed_fee_quantity_schedule, - Orb::ArrayOf.new(FixedFeeQuantitySchedule) - # @!attribute [rw] invoicing_threshold - required :invoicing_threshold, String - # @!attribute [rw] maximum_intervals - required :maximum_intervals, Orb::ArrayOf.new(MaximumIntervals) - # @!attribute [rw] metadata - required :metadata, Orb::Unknown - # @!attribute [rw] minimum_intervals - required :minimum_intervals, Orb::ArrayOf.new(MinimumIntervals) - # @!attribute [rw] net_terms - required :net_terms, Integer - # @!attribute [rw] plan - required :plan, Orb::Models::Plan - # @!attribute [rw] price_intervals - required :price_intervals, Orb::ArrayOf.new(PriceIntervals) - # @!attribute [rw] redeemed_coupon - required :redeemed_coupon, RedeemedCoupon - # @!attribute [rw] start_date - required :start_date, String - # @!attribute [rw] status - required :status, Orb::Enum.new([:"active", :"ended", :"upcoming"]) - # @!attribute [rw] trial_info - required :trial_info, TrialInfo end end end diff --git a/lib/orb/models/subscription_cancel_params.rb b/lib/orb/models/subscription_cancel_params.rb new file mode 100644 index 00000000..91bcd385 --- /dev/null +++ b/lib/orb/models/subscription_cancel_params.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +module Orb + module Models + class SubscriptionCancelParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute cancel_option + # Determines the timing of subscription cancellation + # + # @return [Symbol, Orb::Models::SubscriptionCancelParams::CancelOption] + required :cancel_option, enum: -> { Orb::Models::SubscriptionCancelParams::CancelOption } + + # @!attribute cancellation_date + # The date that the cancellation should take effect. This parameter can only be + # passed if the `cancel_option` is `requested_date`. + # + # @return [Time, nil] + optional :cancellation_date, Time, nil?: true + + # @!parse + # # @param cancel_option [Symbol, Orb::Models::SubscriptionCancelParams::CancelOption] + # # @param cancellation_date [Time, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(cancel_option:, cancellation_date: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # Determines the timing of subscription cancellation + # + # @example + # ```ruby + # case cancel_option + # in :end_of_subscription_term + # # ... + # in :immediate + # # ... + # in :requested_date + # # ... + # end + # ``` + class CancelOption < Orb::Enum + END_OF_SUBSCRIPTION_TERM = :end_of_subscription_term + IMMEDIATE = :immediate + REQUESTED_DATE = :requested_date + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/orb/models/subscription_cancel_response.rb b/lib/orb/models/subscription_cancel_response.rb new file mode 100644 index 00000000..11056e97 --- /dev/null +++ b/lib/orb/models/subscription_cancel_response.rb @@ -0,0 +1,1441 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # subscription_cancel_response => { + # id: String, + # active_plan_phase_order: Integer, + # adjustment_intervals: -> { Orb::ArrayOf[Orb::Models::SubscriptionCancelResponse::AdjustmentInterval] === _1 }, + # auto_collection: Orb::BooleanModel, + # billing_cycle_anchor_configuration: Orb::Models::SubscriptionCancelResponse::BillingCycleAnchorConfiguration, + # **_ + # } + # ``` + class SubscriptionCancelResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute active_plan_phase_order + # The current plan phase that is active, only if the subscription's plan has + # phases. + # + # @return [Integer, nil] + required :active_plan_phase_order, Integer, nil?: true + + # @!attribute adjustment_intervals + # The adjustment intervals for this subscription. + # + # @return [Array] + required :adjustment_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionCancelResponse::AdjustmentInterval] } + + # @!attribute auto_collection + # Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. This property defaults to + # the plan's behavior. If null, defaults to the customer's setting. + # + # @return [Boolean, nil] + required :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_anchor_configuration + # + # @return [Orb::Models::SubscriptionCancelResponse::BillingCycleAnchorConfiguration] + required :billing_cycle_anchor_configuration, + -> { Orb::Models::SubscriptionCancelResponse::BillingCycleAnchorConfiguration } + + # @!attribute billing_cycle_day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is not part of the billing period. Set to null for + # subscriptions that are not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if the subscription is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute customer + # A customer is a buyer of your products, and the other party to the billing + # relationship. + # + # In Orb, customers are assigned system generated identifiers automatically, but + # it's often desirable to have these match existing identifiers in your system. To + # avoid having to denormalize Orb ID information, you can pass in an + # `external_customer_id` with your own identifier. See + # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + # information about how these aliases work in Orb. + # + # In addition to having an identifier in your system, a customer may exist in a + # payment provider solution like Stripe. Use the `payment_provider_id` and the + # `payment_provider` enum field to express this mapping. + # + # A customer also has a timezone (from the standard + # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + # your account's timezone. See [Timezone localization](/essentials/timezones) for + # information on what this timezone parameter influences within Orb. + # + # @return [Orb::Models::Customer] + required :customer, -> { Orb::Models::Customer } + + # @!attribute default_invoice_memo + # Determines the default memo on this subscriptions' invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @return [String, nil] + required :default_invoice_memo, String, nil?: true + + # @!attribute discount_intervals + # The discount intervals for this subscription. + # + # @return [Array] + required :discount_intervals, + -> { Orb::ArrayOf[union: Orb::Models::SubscriptionCancelResponse::DiscountInterval] } + + # @!attribute end_date + # The date Orb stops billing for this subscription. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_schedule + # + # @return [Array] + required :fixed_fee_quantity_schedule, + -> { Orb::ArrayOf[Orb::Models::SubscriptionCancelResponse::FixedFeeQuantitySchedule] } + + # @!attribute invoicing_threshold + # + # @return [String, nil] + required :invoicing_threshold, String, nil?: true + + # @!attribute maximum_intervals + # The maximum intervals for this subscription. + # + # @return [Array] + required :maximum_intervals, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionCancelResponse::MaximumInterval] + } + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum_intervals + # The minimum intervals for this subscription. + # + # @return [Array] + required :minimum_intervals, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionCancelResponse::MinimumInterval] + } + + # @!attribute net_terms + # Determines the difference between the invoice issue date for subscription + # invoices as the date that they are due. A value of `0` here represents that the + # invoice is due on issue, whereas a value of `30` represents that the customer + # has a month to pay the invoice. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute plan + # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + # subscribed to by a customer. Plans define the billing behavior of the + # subscription. You can see more about how to configure prices in the + # [Price resource](/reference/price). + # + # @return [Orb::Models::Plan] + required :plan, -> { Orb::Models::Plan } + + # @!attribute price_intervals + # The price intervals for this subscription. + # + # @return [Array] + required :price_intervals, -> { Orb::ArrayOf[Orb::Models::SubscriptionCancelResponse::PriceInterval] } + + # @!attribute redeemed_coupon + # + # @return [Orb::Models::SubscriptionCancelResponse::RedeemedCoupon, nil] + required :redeemed_coupon, -> { Orb::Models::SubscriptionCancelResponse::RedeemedCoupon }, nil?: true + + # @!attribute start_date + # The date Orb starts billing for this subscription. + # + # @return [Time] + required :start_date, Time + + # @!attribute status + # + # @return [Symbol, Orb::Models::SubscriptionCancelResponse::Status] + required :status, enum: -> { Orb::Models::SubscriptionCancelResponse::Status } + + # @!attribute trial_info + # + # @return [Orb::Models::SubscriptionCancelResponse::TrialInfo] + required :trial_info, -> { Orb::Models::SubscriptionCancelResponse::TrialInfo } + + # @!parse + # # @param id [String] + # # @param active_plan_phase_order [Integer, nil] + # # @param adjustment_intervals [Array] + # # @param auto_collection [Boolean, nil] + # # @param billing_cycle_anchor_configuration [Orb::Models::SubscriptionCancelResponse::BillingCycleAnchorConfiguration] + # # @param billing_cycle_day [Integer] + # # @param created_at [Time] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param customer [Orb::Models::Customer] + # # @param default_invoice_memo [String, nil] + # # @param discount_intervals [Array] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_schedule [Array] + # # @param invoicing_threshold [String, nil] + # # @param maximum_intervals [Array] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum_intervals [Array] + # # @param net_terms [Integer] + # # @param plan [Orb::Models::Plan] + # # @param price_intervals [Array] + # # @param redeemed_coupon [Orb::Models::SubscriptionCancelResponse::RedeemedCoupon, nil] + # # @param start_date [Time] + # # @param status [Symbol, Orb::Models::SubscriptionCancelResponse::Status] + # # @param trial_info [Orb::Models::SubscriptionCancelResponse::TrialInfo] + # # + # def initialize( + # id:, + # active_plan_phase_order:, + # adjustment_intervals:, + # auto_collection:, + # billing_cycle_anchor_configuration:, + # billing_cycle_day:, + # created_at:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # customer:, + # default_invoice_memo:, + # discount_intervals:, + # end_date:, + # fixed_fee_quantity_schedule:, + # invoicing_threshold:, + # maximum_intervals:, + # metadata:, + # minimum_intervals:, + # net_terms:, + # plan:, + # price_intervals:, + # redeemed_coupon:, + # start_date:, + # status:, + # trial_info:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # adjustment_interval => { + # id: String, + # adjustment: Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # start_date: Time + # } + # ``` + class AdjustmentInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment + # + # @return [Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + required :adjustment, + union: -> { Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment } + + # @!attribute applies_to_price_interval_ids + # The price interval IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the adjustment interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the adjustment interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param id [String] + # # @param adjustment [Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "amount_discount", id: String, amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment ... + # in {adjustment_type: "percentage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment ... + # in {adjustment_type: "usage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment ... + # in {adjustment_type: "minimum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MinimumAdjustment ... + # in {adjustment_type: "maximum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MaximumAdjustment ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + # # ... + # in Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :amount_discount, + -> { Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment } + + variant :percentage_discount, + -> { Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment } + + variant :usage_discount, + -> { Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment } + + variant :minimum, + -> { Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MinimumAdjustment } + + variant :maximum, + -> { Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MaximumAdjustment } + + # @example + # ```ruby + # amount_discount_adjustment => { + # id: String, + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # **_ + # } + # ``` + class AmountDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # The amount by which to discount the prices this adjustment applies to in a given + # billing period. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize( + # id:, + # amount_discount:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # adjustment_type: :amount_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_adjustment => { + # id: String, + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # percentage_discount: Float, + # **_ + # } + # ``` + class PercentageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute percentage_discount + # The percentage (as a value between 0 and 1) by which to discount the price + # intervals this adjustment applies to in a given billing period. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param percentage_discount [Float] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # percentage_discount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_adjustment => { + # id: String, + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # plan_phase_order: Integer, + # **_ + # } + # ``` + class UsageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute usage_discount + # The number of usage units by which to discount the price this adjustment applies + # to in a given billing period. + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param usage_discount [Float] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # usage_discount:, + # adjustment_type: :usage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_adjustment => { + # id: String, + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # item_id: String, + # **_ + # } + # ``` + class MinimumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # item_id:, + # minimum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_adjustment => { + # id: String, + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # maximum_amount: String, + # **_ + # } + # ``` + class MaximumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param maximum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # maximum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :maximum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # billing_cycle_anchor_configuration => { + # day: Integer, + # month: Integer, + # year: Integer + # } + # ``` + class BillingCycleAnchorConfiguration < Orb::BaseModel + # @!attribute day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :day, Integer + + # @!attribute month + # The month on which the billing cycle is anchored (e.g. a quarterly price + # anchored in February would have cycles starting February, May, August, and + # November). + # + # @return [Integer, nil] + optional :month, Integer, nil?: true + + # @!attribute year + # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle + # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + # + # @return [Integer, nil] + optional :year, Integer, nil?: true + + # @!parse + # # @param day [Integer] + # # @param month [Integer, nil] + # # @param year [Integer, nil] + # # + # def initialize(day:, month: nil, year: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case discount_interval + # in {discount_type: "amount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionCancelResponse::DiscountInterval::AmountDiscountInterval ... + # in {discount_type: "percentage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionCancelResponse::DiscountInterval::PercentageDiscountInterval ... + # in {discount_type: "usage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionCancelResponse::DiscountInterval::UsageDiscountInterval ... + # end + # ``` + # + # @example + # ```ruby + # case discount_interval + # in Orb::Models::SubscriptionCancelResponse::DiscountInterval::AmountDiscountInterval + # # ... + # in Orb::Models::SubscriptionCancelResponse::DiscountInterval::PercentageDiscountInterval + # # ... + # in Orb::Models::SubscriptionCancelResponse::DiscountInterval::UsageDiscountInterval + # # ... + # end + # ``` + class DiscountInterval < Orb::Union + discriminator :discount_type + + variant :amount, + -> { + Orb::Models::SubscriptionCancelResponse::DiscountInterval::AmountDiscountInterval + } + + variant :percentage, + -> { Orb::Models::SubscriptionCancelResponse::DiscountInterval::PercentageDiscountInterval } + + variant :usage, + -> { + Orb::Models::SubscriptionCancelResponse::DiscountInterval::UsageDiscountInterval + } + + # @example + # ```ruby + # amount_discount_interval => { + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :amount, + # end_date: Time + # } + # ``` + class AmountDiscountInterval < Orb::BaseModel + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :amount] + required :discount_type, const: :amount + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param discount_type [Symbol, :amount] + # # + # def initialize( + # amount_discount:, + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # discount_type: :amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :percentage, + # end_date: Time, + # percentage_discount: Float + # } + # ``` + class PercentageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :percentage] + required :discount_type, const: :percentage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`.This is a number between 0 + # and 1. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param percentage_discount [Float] + # # @param start_date [Time] + # # @param discount_type [Symbol, :percentage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # percentage_discount:, + # start_date:, + # discount_type: :percentage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :usage, + # end_date: Time, + # start_date: Time + # } + # ``` + class UsageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :usage] + required :discount_type, const: :usage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param usage_discount [Float] + # # @param discount_type [Symbol, :usage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # usage_discount:, + # discount_type: :usage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # fixed_fee_quantity_schedule => { + # end_date: Time, + # price_id: String, + # quantity: Float, + # start_date: Time + # } + # ``` + class FixedFeeQuantitySchedule < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param end_date [Time, nil] + # # @param price_id [String] + # # @param quantity [Float] + # # @param start_date [Time] + # # + # def initialize(end_date:, price_id:, quantity:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # maximum_amount: String, + # start_date: Time + # } + # ``` + class MaximumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the maximum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the price intervals + # this transform applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute start_date + # The start date of the maximum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param maximum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, maximum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # minimum_amount: String, + # start_date: Time + # } + # ``` + class MinimumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the minimum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the price intervals + # this minimum applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute start_date + # The start date of the minimum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param minimum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, minimum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # price_interval => { + # id: String, + # billing_cycle_day: Integer, + # current_billing_period_end_date: Time, + # current_billing_period_start_date: Time, + # end_date: Time, + # **_ + # } + # ``` + class PriceInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billing_cycle_day + # The day of the month that Orb bills for this price + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is exactly the end of the billing period. Set to null if + # this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute end_date + # The end date of the price interval. This is the date that Orb stops billing for + # this price. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_transitions + # The fixed fee quantity transitions for this price interval. This is only + # relevant for fixed fees. + # + # @return [Array, nil] + required :fixed_fee_quantity_transitions, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionCancelResponse::PriceInterval::FixedFeeQuantityTransition] + }, + nil?: true + + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + required :price, union: -> { Orb::Models::Price } + + # @!attribute start_date + # The start date of the price interval. This is the date that Orb starts billing + # for this price. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # The Price Interval resource represents a period of time for which a price will + # # bill on a subscription. A subscription’s price intervals define its billing + # # behavior. + # # + # # @param id [String] + # # @param billing_cycle_day [Integer] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_transitions [Array, nil] + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # # @param start_date [Time] + # # + # def initialize( + # id:, + # billing_cycle_day:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # end_date:, + # fixed_fee_quantity_transitions:, + # price:, + # start_date:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # fixed_fee_quantity_transition => { + # effective_date: Time, + # price_id: String, + # quantity: Integer + # } + # ``` + class FixedFeeQuantityTransition < Orb::BaseModel + # @!attribute effective_date + # + # @return [Time] + required :effective_date, Time + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Integer] + required :quantity, Integer + + # @!parse + # # @param effective_date [Time] + # # @param price_id [String] + # # @param quantity [Integer] + # # + # def initialize(effective_date:, price_id:, quantity:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # redeemed_coupon => { + # coupon_id: String, + # end_date: Time, + # start_date: Time + # } + # ``` + class RedeemedCoupon < Orb::BaseModel + # @!attribute coupon_id + # + # @return [String] + required :coupon_id, String + + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param coupon_id [String] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(coupon_id:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :ended + # # ... + # in :upcoming + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # trial_info => { + # end_date: Time + # } + # ``` + class TrialInfo < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!parse + # # @param end_date [Time, nil] + # # + # def initialize(end_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/subscription_create_params.rb b/lib/orb/models/subscription_create_params.rb new file mode 100644 index 00000000..459f629e --- /dev/null +++ b/lib/orb/models/subscription_create_params.rb @@ -0,0 +1,14317 @@ +# frozen_string_literal: true + +module Orb + module Models + class SubscriptionCreateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute add_adjustments + # Additional adjustments to be added to the subscription. (Only available for + # accounts that have migrated off of legacy subscription overrides) + # + # @return [Array, nil] + optional :add_adjustments, + -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::AddAdjustment] }, + nil?: true + + # @!attribute add_prices + # Additional prices to be added to the subscription. (Only available for accounts + # that have migrated off of legacy subscription overrides) + # + # @return [Array, nil] + optional :add_prices, -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::AddPrice] }, nil?: true + + # @!attribute [r] align_billing_with_subscription_start_date + # + # @return [Boolean, nil] + optional :align_billing_with_subscription_start_date, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :align_billing_with_subscription_start_date + + # @!attribute auto_collection + # Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. If not specified, this + # defaults to the behavior configured for this customer. + # + # @return [Boolean, nil] + optional :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute aws_region + # + # @return [String, nil] + optional :aws_region, String, nil?: true + + # @!attribute billing_cycle_anchor_configuration + # + # @return [Orb::Models::SubscriptionCreateParams::BillingCycleAnchorConfiguration, nil] + optional :billing_cycle_anchor_configuration, + -> { Orb::Models::SubscriptionCreateParams::BillingCycleAnchorConfiguration }, + nil?: true + + # @!attribute coupon_redemption_code + # Redemption code to be used for this subscription. If the coupon cannot be found + # by its redemption code, or cannot be redeemed, an error response will be + # returned and the subscription creation or plan change will not be scheduled. + # + # @return [String, nil] + optional :coupon_redemption_code, String, nil?: true + + # @!attribute credits_overage_rate + # + # @return [Float, nil] + optional :credits_overage_rate, Float, nil?: true + + # @!attribute customer_id + # + # @return [String, nil] + optional :customer_id, String, nil?: true + + # @!attribute default_invoice_memo + # Determines the default memo on this subscription's invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @return [String, nil] + optional :default_invoice_memo, String, nil?: true + + # @!attribute end_date + # + # @return [Time, nil] + optional :end_date, Time, nil?: true + + # @!attribute external_customer_id + # + # @return [String, nil] + optional :external_customer_id, String, nil?: true + + # @!attribute external_marketplace + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ExternalMarketplace, nil] + optional :external_marketplace, + enum: -> { Orb::Models::SubscriptionCreateParams::ExternalMarketplace }, + nil?: true + + # @!attribute external_marketplace_reporting_id + # + # @return [String, nil] + optional :external_marketplace_reporting_id, String, nil?: true + + # @!attribute external_plan_id + # The external_plan_id of the plan that the given subscription should be switched + # to. Note that either this property or `plan_id` must be specified. + # + # @return [String, nil] + optional :external_plan_id, String, nil?: true + + # @!attribute filter + # An additional filter to apply to usage queries. This filter must be expressed as + # a boolean + # [computed property](/extensibility/advanced-metrics#computed-properties). If + # null, usage queries will not include any additional filter. + # + # @return [String, nil] + optional :filter, String, nil?: true + + # @!attribute initial_phase_order + # The phase of the plan to start with + # + # @return [Integer, nil] + optional :initial_phase_order, Integer, nil?: true + + # @!attribute invoicing_threshold + # When this subscription's accrued usage reaches this threshold, an invoice will + # be issued for the subscription. If not specified, invoices will only be issued + # at the end of the billing period. + # + # @return [String, nil] + optional :invoicing_threshold, String, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute net_terms + # The net terms determines the difference between the invoice date and the issue + # date for the invoice. If you intend the invoice to be due on issue, set this + # to 0. If not provided, this defaults to the value specified in the plan. + # + # @return [Integer, nil] + optional :net_terms, Integer, nil?: true + + # @!attribute per_credit_overage_amount + # + # @return [Float, nil] + optional :per_credit_overage_amount, Float, nil?: true + + # @!attribute plan_id + # The plan that the given subscription should be switched to. Note that either + # this property or `external_plan_id` must be specified. + # + # @return [String, nil] + optional :plan_id, String, nil?: true + + # @!attribute plan_version_number + # Specifies which version of the plan to subscribe to. If null, the default + # version will be used. + # + # @return [Integer, nil] + optional :plan_version_number, Integer, nil?: true + + # @!attribute price_overrides + # Optionally provide a list of overrides for prices on the plan + # + # @return [Array, nil] + optional :price_overrides, Orb::ArrayOf[Orb::Unknown], nil?: true + + # @!attribute remove_adjustments + # Plan adjustments to be removed from the subscription. (Only available for + # accounts that have migrated off of legacy subscription overrides) + # + # @return [Array, nil] + optional :remove_adjustments, + -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::RemoveAdjustment] }, + nil?: true + + # @!attribute remove_prices + # Plan prices to be removed from the subscription. (Only available for accounts + # that have migrated off of legacy subscription overrides) + # + # @return [Array, nil] + optional :remove_prices, + -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::RemovePrice] }, + nil?: true + + # @!attribute replace_adjustments + # Plan adjustments to be replaced with additional adjustments on the subscription. + # (Only available for accounts that have migrated off of legacy subscription + # overrides) + # + # @return [Array, nil] + optional :replace_adjustments, + -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::ReplaceAdjustment] }, + nil?: true + + # @!attribute replace_prices + # Plan prices to be replaced with additional prices on the subscription. (Only + # available for accounts that have migrated off of legacy subscription overrides) + # + # @return [Array, nil] + optional :replace_prices, + -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::ReplacePrice] }, + nil?: true + + # @!attribute start_date + # + # @return [Time, nil] + optional :start_date, Time, nil?: true + + # @!attribute trial_duration_days + # The duration of the trial period in days. If not provided, this defaults to the + # value specified in the plan. If `0` is provided, the trial on the plan will be + # skipped. + # + # @return [Integer, nil] + optional :trial_duration_days, Integer, nil?: true + + # @!parse + # # @param add_adjustments [Array, nil] + # # @param add_prices [Array, nil] + # # @param align_billing_with_subscription_start_date [Boolean] + # # @param auto_collection [Boolean, nil] + # # @param aws_region [String, nil] + # # @param billing_cycle_anchor_configuration [Orb::Models::SubscriptionCreateParams::BillingCycleAnchorConfiguration, nil] + # # @param coupon_redemption_code [String, nil] + # # @param credits_overage_rate [Float, nil] + # # @param customer_id [String, nil] + # # @param default_invoice_memo [String, nil] + # # @param end_date [Time, nil] + # # @param external_customer_id [String, nil] + # # @param external_marketplace [Symbol, Orb::Models::SubscriptionCreateParams::ExternalMarketplace, nil] + # # @param external_marketplace_reporting_id [String, nil] + # # @param external_plan_id [String, nil] + # # @param filter [String, nil] + # # @param initial_phase_order [Integer, nil] + # # @param invoicing_threshold [String, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param net_terms [Integer, nil] + # # @param per_credit_overage_amount [Float, nil] + # # @param plan_id [String, nil] + # # @param plan_version_number [Integer, nil] + # # @param price_overrides [Array, nil] + # # @param remove_adjustments [Array, nil] + # # @param remove_prices [Array, nil] + # # @param replace_adjustments [Array, nil] + # # @param replace_prices [Array, nil] + # # @param start_date [Time, nil] + # # @param trial_duration_days [Integer, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # add_adjustments: nil, + # add_prices: nil, + # align_billing_with_subscription_start_date: nil, + # auto_collection: nil, + # aws_region: nil, + # billing_cycle_anchor_configuration: nil, + # coupon_redemption_code: nil, + # credits_overage_rate: nil, + # customer_id: nil, + # default_invoice_memo: nil, + # end_date: nil, + # external_customer_id: nil, + # external_marketplace: nil, + # external_marketplace_reporting_id: nil, + # external_plan_id: nil, + # filter: nil, + # initial_phase_order: nil, + # invoicing_threshold: nil, + # metadata: nil, + # net_terms: nil, + # per_credit_overage_amount: nil, + # plan_id: nil, + # plan_version_number: nil, + # price_overrides: nil, + # remove_adjustments: nil, + # remove_prices: nil, + # replace_adjustments: nil, + # replace_prices: nil, + # start_date: nil, + # trial_duration_days: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # add_adjustment => { + # adjustment: Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment, + # end_date: Time, + # plan_phase_order: Integer, + # start_date: Time + # } + # ``` + class AddAdjustment < Orb::BaseModel + # @!attribute adjustment + # The definition of a new adjustment to create and add to the subscription. + # + # @return [Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewPercentageDiscount, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewUsageDiscount, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewAmountDiscount, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMinimum, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMaximum] + required :adjustment, union: -> { Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment } + + # @!attribute end_date + # The end date of the adjustment interval. This is the date that the adjustment + # will stop affecting prices on the subscription. If null, the adjustment will + # start when the phase or subscription starts. + # + # @return [Time, nil] + optional :end_date, Time, nil?: true + + # @!attribute plan_phase_order + # The phase to add this adjustment to. + # + # @return [Integer, nil] + optional :plan_phase_order, Integer, nil?: true + + # @!attribute start_date + # The start date of the adjustment interval. This is the date that the adjustment + # will start affecting prices on the subscription. If null, the adjustment will + # start when the phase or subscription starts. + # + # @return [Time, nil] + optional :start_date, Time, nil?: true + + # @!parse + # # @param adjustment [Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewPercentageDiscount, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewUsageDiscount, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewAmountDiscount, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMinimum, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMaximum] + # # @param end_date [Time, nil] + # # @param plan_phase_order [Integer, nil] + # # @param start_date [Time, nil] + # # + # def initialize(adjustment:, end_date: nil, plan_phase_order: nil, start_date: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The definition of a new adjustment to create and add to the subscription. + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "percentage_discount", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, percentage_discount: Float, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewPercentageDiscount ... + # in {adjustment_type: "usage_discount", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, usage_discount: Float, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewUsageDiscount ... + # in {adjustment_type: "amount_discount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewAmountDiscount ... + # in {adjustment_type: "minimum", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, item_id: String, minimum_amount: String} + # # Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMinimum ... + # in {adjustment_type: "maximum", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, maximum_amount: String, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMaximum ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewPercentageDiscount + # # ... + # in Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewUsageDiscount + # # ... + # in Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewAmountDiscount + # # ... + # in Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMinimum + # # ... + # in Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMaximum + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :percentage_discount, + -> { Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewPercentageDiscount } + + variant :usage_discount, + -> { Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewUsageDiscount } + + variant :amount_discount, + -> { Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewAmountDiscount } + + variant :minimum, + -> { + Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMinimum + } + + variant :maximum, + -> { + Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMaximum + } + + # @example + # ```ruby + # new_percentage_discount => { + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # percentage_discount: Float, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewPercentageDiscount < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute percentage_discount + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param percentage_discount [Float] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # applies_to_price_ids:, + # percentage_discount:, + # is_invoice_level: nil, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_usage_discount => { + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # usage_discount: Float, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewUsageDiscount < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute usage_discount + # + # @return [Float] + required :usage_discount, Float + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param usage_discount [Float] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize(applies_to_price_ids:, usage_discount:, is_invoice_level: nil, adjustment_type: :usage_discount, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_amount_discount => { + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewAmountDiscount < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize(amount_discount:, applies_to_price_ids:, is_invoice_level: nil, adjustment_type: :amount_discount, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_minimum => { + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # item_id: String, + # minimum_amount: String, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewMinimum < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # + # @return [String] + required :minimum_amount, String + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize(applies_to_price_ids:, item_id:, minimum_amount:, is_invoice_level: nil, adjustment_type: :minimum, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_maximum => { + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewMaximum < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # + # @return [String] + required :maximum_amount, String + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, is_invoice_level: nil, adjustment_type: :maximum, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # add_price => { + # discounts: -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::AddPrice::Discount] === _1 }, + # end_date: Time, + # external_price_id: String, + # maximum_amount: String, + # minimum_amount: String, + # **_ + # } + # ``` + class AddPrice < Orb::BaseModel + # @!attribute discounts + # [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this + # price. + # + # @return [Array, nil] + optional :discounts, + -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::AddPrice::Discount] }, + nil?: true + + # @!attribute end_date + # The end date of the price interval. This is the date that the price will stop + # billing on the subscription. If null, billing will end when the phase or + # subscription ends. + # + # @return [Time, nil] + optional :end_date, Time, nil?: true + + # @!attribute external_price_id + # The external price id of the price to add to the subscription. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute maximum_amount + # [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for + # this price. + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute minimum_amount + # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for + # this price. + # + # @return [String, nil] + optional :minimum_amount, String, nil?: true + + # @!attribute plan_phase_order + # The phase to add this price to. + # + # @return [Integer, nil] + optional :plan_phase_order, Integer, nil?: true + + # @!attribute price + # The definition of a new price to create and add to the subscription. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice, nil] + optional :price, union: -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price }, nil?: true + + # @!attribute price_id + # The id of the price to add to the subscription. + # + # @return [String, nil] + optional :price_id, String, nil?: true + + # @!attribute start_date + # The start date of the price interval. This is the date that the price will start + # billing on the subscription. If null, billing will start when the phase or + # subscription starts. + # + # @return [Time, nil] + optional :start_date, Time, nil?: true + + # @!parse + # # @param discounts [Array, nil] + # # @param end_date [Time, nil] + # # @param external_price_id [String, nil] + # # @param maximum_amount [String, nil] + # # @param minimum_amount [String, nil] + # # @param plan_phase_order [Integer, nil] + # # @param price [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice, nil] + # # @param price_id [String, nil] + # # @param start_date [Time, nil] + # # + # def initialize( + # discounts: nil, + # end_date: nil, + # external_price_id: nil, + # maximum_amount: nil, + # minimum_amount: nil, + # plan_phase_order: nil, + # price: nil, + # price_id: nil, + # start_date: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # discount => { + # discount_type: Orb::Models::SubscriptionCreateParams::AddPrice::Discount::DiscountType, + # amount_discount: String, + # percentage_discount: Float, + # usage_discount: Float + # } + # ``` + class Discount < Orb::BaseModel + # @!attribute discount_type + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Discount::DiscountType] + required :discount_type, + enum: -> { Orb::Models::SubscriptionCreateParams::AddPrice::Discount::DiscountType } + + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [String, nil] + optional :amount_discount, String, nil?: true + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`. This is a number between 0 + # and 1. + # + # @return [Float, nil] + optional :percentage_discount, Float, nil?: true + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for + # + # @return [Float, nil] + optional :usage_discount, Float, nil?: true + + # @!parse + # # @param discount_type [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Discount::DiscountType] + # # @param amount_discount [String, nil] + # # @param percentage_discount [Float, nil] + # # @param usage_discount [Float, nil] + # # + # def initialize(discount_type:, amount_discount: nil, percentage_discount: nil, usage_discount: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case discount_type + # in :percentage + # # ... + # in :usage + # # ... + # in :amount + # # ... + # end + # ``` + class DiscountType < Orb::Enum + PERCENTAGE = :percentage + USAGE = :usage + AMOUNT = :amount + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # The definition of a new price to create and add to the subscription. + # + # @example + # ```ruby + # case price + # in {model_type: "unit", cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice ... + # in {model_type: "package", cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice ... + # in {model_type: "matrix", cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::Cadence, item_id: String, matrix_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice ... + # in {model_type: "tiered", cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice ... + # in {model_type: "tiered_bps", cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice ... + # in {model_type: "bps", bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig, cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::Cadence, item_id: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice ... + # in {model_type: "bulk_bps", bulk_bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::Cadence, item_id: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice ... + # in {model_type: "bulk", bulk_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig, cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::Cadence, item_id: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice ... + # in {model_type: "threshold_total_amount", cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice ... + # in {model_type: "tiered_package", cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice ... + # in {model_type: "tiered_with_minimum", cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice ... + # in {model_type: "unit_with_percent", cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice ... + # in {model_type: "package_with_allocation", cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice ... + # in {model_type: "tiered_with_proration", cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice ... + # in {model_type: "unit_with_proration", cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice ... + # in {model_type: "grouped_allocation", cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence, grouped_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, item_id: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice ... + # in {model_type: "grouped_with_prorated_minimum", cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence, grouped_with_prorated_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, item_id: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice ... + # in {model_type: "bulk_with_proration", bulk_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence, item_id: String} + # # Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice ... + # end + # ``` + # + # @example + # ```ruby + # case price + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice + # # ... + # end + # ``` + class Price < Orb::Union + discriminator :model_type + + variant :unit, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice + } + + variant :package, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice } + + variant :matrix, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice + } + + variant :tiered, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice + } + + variant :tiered_bps, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice } + + variant :bps, -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice } + + variant :bulk_bps, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice } + + variant :bulk, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice + } + + variant :threshold_total_amount, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice } + + variant :tiered_package, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice } + + variant :tiered_with_minimum, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice } + + variant :unit_with_percent, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice } + + variant :package_with_allocation, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice } + + variant :tiered_with_proration, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice } + + variant :unit_with_proration, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice } + + variant :grouped_allocation, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice } + + variant :grouped_with_prorated_minimum, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice } + + variant :bulk_with_proration, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice } + + # @example + # ```ruby + # new_subscription_unit_price => { + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::Cadence, + # item_id: String, + # model_type: :unit, + # name: String, + # unit_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig, + # **_ + # } + # ``` + class NewSubscriptionUnitPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit] + required :model_type, const: :unit + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_config + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig] + required :unit_config, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param unit_config [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :unit] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # unit_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :unit, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # unit_config => { + # unit_amount: String + # } + # ``` + class UnitConfig < Orb::BaseModel + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param unit_amount [String] + # # + # def initialize(unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_package_price => { + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::Cadence, + # item_id: String, + # model_type: :package, + # name: String, + # package_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig, + # **_ + # } + # ``` + class NewSubscriptionPackagePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :package] + required :model_type, const: :package + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute package_config + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig] + required :package_config, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param package_config [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :package] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # package_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # package_config => { + # package_amount: String, + # package_size: Integer + # } + # ``` + class PackageConfig < Orb::BaseModel + # @!attribute package_amount + # A currency amount to rate usage by + # + # @return [String] + required :package_amount, String + + # @!attribute package_size + # An integer amount to represent package size. For example, 1000 here would divide + # usage by 1000 before multiplying by package_amount in rating + # + # @return [Integer] + required :package_size, Integer + + # @!parse + # # @param package_amount [String] + # # @param package_size [Integer] + # # + # def initialize(package_amount:, package_size:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_matrix_price => { + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::Cadence, + # item_id: String, + # matrix_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + # model_type: :matrix, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionMatrixPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute matrix_config + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig] + required :matrix_config, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig } + + # @!attribute model_type + # + # @return [Symbol, :matrix] + required :model_type, const: :matrix + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::Cadence] + # # @param item_id [String] + # # @param matrix_config [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :matrix] + # # + # def initialize( + # cadence:, + # item_id:, + # matrix_config:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :matrix, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # matrix_config => { + # default_unit_amount: String, + # dimensions: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # matrix_values: -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] === _1 } + # } + # ``` + class MatrixConfig < Orb::BaseModel + # @!attribute default_unit_amount + # Default per unit rate for any usage not bucketed into a specified matrix_value + # + # @return [String] + required :default_unit_amount, String + + # @!attribute dimensions + # One or two event property values to evaluate matrix groups by + # + # @return [Array] + required :dimensions, Orb::ArrayOf[String, nil?: true] + + # @!attribute matrix_values + # Matrix values for specified matrix grouping keys + # + # @return [Array] + required :matrix_values, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + } + + # @!parse + # # @param default_unit_amount [String] + # # @param dimensions [Array] + # # @param matrix_values [Array] + # # + # def initialize(default_unit_amount:, dimensions:, matrix_values:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # matrix_value => { + # dimension_values: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # unit_amount: String + # } + # ``` + class MatrixValue < Orb::BaseModel + # @!attribute dimension_values + # One or two matrix keys to filter usage to this Matrix value by. For example, + # ["region", "tier"] could be used to filter cloud usage by a cloud region and an + # instance tier. + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String, nil?: true] + + # @!attribute unit_amount + # Unit price for the specified dimension_values + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param dimension_values [Array] + # # @param unit_amount [String] + # # + # def initialize(dimension_values:, unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tiered_price => { + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::Cadence, + # item_id: String, + # model_type: :tiered, + # name: String, + # tiered_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig, + # **_ + # } + # ``` + class NewSubscriptionTieredPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered] + required :model_type, const: :tiered + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_config + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig] + required :tiered_config, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_config [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # tiered_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] === _1 } + # } + # ``` + class TieredConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # first_unit: Float, + # unit_amount: String, + # last_unit: Float + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute first_unit + # Inclusive tier starting value + # + # @return [Float] + required :first_unit, Float + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute last_unit + # Exclusive tier ending value. If null, this is treated as the last tier + # + # @return [Float, nil] + optional :last_unit, Float, nil?: true + + # @!parse + # # @param first_unit [Float] + # # @param unit_amount [String] + # # @param last_unit [Float, nil] + # # + # def initialize(first_unit:, unit_amount:, last_unit: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tiered_bps_price => { + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::Cadence, + # item_id: String, + # model_type: :tiered_bps, + # name: String, + # tiered_bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + # **_ + # } + # ``` + class NewSubscriptionTieredBpsPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_bps] + required :model_type, const: :tiered_bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_bps_config + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig] + required :tiered_bps_config, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_bps_config [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered_bps] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_bps_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered_bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # tiered_bps_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] === _1 } + # } + # ``` + class TieredBpsConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + # tiers + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # bps: Float, + # minimum_amount: String, + # maximum_amount: String, + # per_unit_maximum: String + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute bps + # Per-event basis point rate + # + # @return [Float] + required :bps, Float + + # @!attribute minimum_amount + # Inclusive tier starting value + # + # @return [String] + required :minimum_amount, String + + # @!attribute maximum_amount + # Exclusive tier ending value + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute per_unit_maximum + # Per unit maximum to charge + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param minimum_amount [String] + # # @param maximum_amount [String, nil] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_bps_price => { + # bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig, + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::Cadence, + # item_id: String, + # model_type: :bps, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionBpsPrice < Orb::BaseModel + # @!attribute bps_config + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig] + required :bps_config, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bps] + required :model_type, const: :bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param bps_config [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig] + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :bps] + # # + # def initialize( + # bps_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bps_config => { + # bps: Float, + # per_unit_maximum: String + # } + # ``` + class BpsConfig < Orb::BaseModel + # @!attribute bps + # Basis point take rate per event + # + # @return [Float] + required :bps, Float + + # @!attribute per_unit_maximum + # Optional currency amount maximum to cap spend per event + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_bulk_bps_price => { + # bulk_bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::Cadence, + # item_id: String, + # model_type: :bulk_bps, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionBulkBpsPrice < Orb::BaseModel + # @!attribute bulk_bps_config + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig] + required :bulk_bps_config, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk_bps] + required :model_type, const: :bulk_bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param bulk_bps_config [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig] + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :bulk_bps] + # # + # def initialize( + # bulk_bps_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :bulk_bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bulk_bps_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] === _1 } + # } + # ``` + class BulkBpsConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for a bulk BPS pricing model where all usage is aggregated to a single + # tier based on total volume + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # bps: Float, + # maximum_amount: String, + # per_unit_maximum: String + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute bps + # Basis points to rate on + # + # @return [Float] + required :bps, Float + + # @!attribute maximum_amount + # Upper bound for tier + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute per_unit_maximum + # The maximum amount to charge for any one event + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param maximum_amount [String, nil] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, maximum_amount: nil, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_bulk_price => { + # bulk_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig, + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::Cadence, + # item_id: String, + # model_type: :bulk, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionBulkPrice < Orb::BaseModel + # @!attribute bulk_config + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig] + required :bulk_config, + -> { Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk] + required :model_type, const: :bulk + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param bulk_config [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig] + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :bulk] + # # + # def initialize( + # bulk_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :bulk, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bulk_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] === _1 } + # } + # ``` + class BulkConfig < Orb::BaseModel + # @!attribute tiers + # Bulk tiers for rating based on total usage volume + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # unit_amount: String, + # maximum_units: Float + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute maximum_units + # Upper bound for this tier + # + # @return [Float, nil] + optional :maximum_units, Float, nil?: true + + # @!parse + # # @param unit_amount [String] + # # @param maximum_units [Float, nil] + # # + # def initialize(unit_amount:, maximum_units: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_threshold_total_amount_price => { + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence, + # item_id: String, + # model_type: :threshold_total_amount, + # name: String, + # threshold_total_amount_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionThresholdTotalAmountPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :threshold_total_amount] + required :model_type, const: :threshold_total_amount + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute threshold_total_amount_config + # + # @return [Hash{Symbol=>Object}] + required :threshold_total_amount_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param threshold_total_amount_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :threshold_total_amount] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # threshold_total_amount_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :threshold_total_amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tiered_package_price => { + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::Cadence, + # item_id: String, + # model_type: :tiered_package, + # name: String, + # tiered_package_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionTieredPackagePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_package] + required :model_type, const: :tiered_package + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_package_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_package_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_package_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered_package] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_package_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered_package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tiered_with_minimum_price => { + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence, + # item_id: String, + # model_type: :tiered_with_minimum, + # name: String, + # tiered_with_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionTieredWithMinimumPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_with_minimum] + required :model_type, const: :tiered_with_minimum + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_with_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_with_minimum_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered_with_minimum] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_with_minimum_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered_with_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_unit_with_percent_price => { + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence, + # item_id: String, + # model_type: :unit_with_percent, + # name: String, + # unit_with_percent_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionUnitWithPercentPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit_with_percent] + required :model_type, const: :unit_with_percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_with_percent_config + # + # @return [Hash{Symbol=>Object}] + required :unit_with_percent_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param unit_with_percent_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :unit_with_percent] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # unit_with_percent_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :unit_with_percent, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_package_with_allocation_price => { + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence, + # item_id: String, + # model_type: :package_with_allocation, + # name: String, + # package_with_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionPackageWithAllocationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :package_with_allocation] + required :model_type, const: :package_with_allocation + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute package_with_allocation_config + # + # @return [Hash{Symbol=>Object}] + required :package_with_allocation_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param package_with_allocation_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :package_with_allocation] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # package_with_allocation_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :package_with_allocation, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tier_with_proration_price => { + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::Cadence, + # item_id: String, + # model_type: :tiered_with_proration, + # name: String, + # tiered_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionTierWithProrationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_with_proration_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered_with_proration] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_with_proration_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_unit_with_proration_price => { + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence, + # item_id: String, + # model_type: :unit_with_proration, + # name: String, + # unit_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionUnitWithProrationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit_with_proration] + required :model_type, const: :unit_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :unit_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param unit_with_proration_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :unit_with_proration] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # unit_with_proration_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :unit_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_grouped_allocation_price => { + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence, + # grouped_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_allocation, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionGroupedAllocationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence + } + + # @!attribute grouped_allocation_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_allocation_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_allocation] + required :model_type, const: :grouped_allocation + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence] + # # @param grouped_allocation_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :grouped_allocation] + # # + # def initialize( + # cadence:, + # grouped_allocation_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :grouped_allocation, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_grouped_with_prorated_minimum_price => { + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence, + # grouped_with_prorated_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_with_prorated_minimum, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionGroupedWithProratedMinimumPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence + } + + # @!attribute grouped_with_prorated_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_with_prorated_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_with_prorated_minimum] + required :model_type, const: :grouped_with_prorated_minimum + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence] + # # @param grouped_with_prorated_minimum_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :grouped_with_prorated_minimum] + # # + # def initialize( + # cadence:, + # grouped_with_prorated_minimum_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :grouped_with_prorated_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_bulk_with_proration_price => { + # bulk_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence, + # item_id: String, + # model_type: :bulk_with_proration, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionBulkWithProrationPrice < Orb::BaseModel + # @!attribute bulk_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :bulk_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk_with_proration] + required :model_type, const: :bulk_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param bulk_with_proration_config [Hash{Symbol=>Object}] + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :bulk_with_proration] + # # + # def initialize( + # bulk_with_proration_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :bulk_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end + + # @example + # ```ruby + # billing_cycle_anchor_configuration => { + # day: Integer, + # month: Integer, + # year: Integer + # } + # ``` + class BillingCycleAnchorConfiguration < Orb::BaseModel + # @!attribute day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :day, Integer + + # @!attribute month + # The month on which the billing cycle is anchored (e.g. a quarterly price + # anchored in February would have cycles starting February, May, August, and + # November). + # + # @return [Integer, nil] + optional :month, Integer, nil?: true + + # @!attribute year + # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle + # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + # + # @return [Integer, nil] + optional :year, Integer, nil?: true + + # @!parse + # # @param day [Integer] + # # @param month [Integer, nil] + # # @param year [Integer, nil] + # # + # def initialize(day:, month: nil, year: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @deprecated + # + # @example + # ```ruby + # case external_marketplace + # in :google + # # ... + # in :aws + # # ... + # in :azure + # # ... + # end + # ``` + class ExternalMarketplace < Orb::Enum + GOOGLE = :google + AWS = :aws + AZURE = :azure + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # remove_adjustment => { + # adjustment_id: String + # } + # ``` + class RemoveAdjustment < Orb::BaseModel + # @!attribute adjustment_id + # The id of the adjustment to remove on the subscription. + # + # @return [String] + required :adjustment_id, String + + # @!parse + # # @param adjustment_id [String] + # # + # def initialize(adjustment_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # remove_price => { + # external_price_id: String, + # price_id: String + # } + # ``` + class RemovePrice < Orb::BaseModel + # @!attribute external_price_id + # The external price id of the price to remove on the subscription. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute price_id + # The id of the price to remove on the subscription. + # + # @return [String, nil] + optional :price_id, String, nil?: true + + # @!parse + # # @param external_price_id [String, nil] + # # @param price_id [String, nil] + # # + # def initialize(external_price_id: nil, price_id: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # replace_adjustment => { + # adjustment: Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment, + # replaces_adjustment_id: String + # } + # ``` + class ReplaceAdjustment < Orb::BaseModel + # @!attribute adjustment + # The definition of a new adjustment to create and add to the subscription. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount, Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewUsageDiscount, Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewAmountDiscount, Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMinimum, Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMaximum] + required :adjustment, + union: -> { + Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment + } + + # @!attribute replaces_adjustment_id + # The id of the adjustment on the plan to replace in the subscription. + # + # @return [String] + required :replaces_adjustment_id, String + + # @!parse + # # @param adjustment [Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount, Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewUsageDiscount, Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewAmountDiscount, Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMinimum, Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMaximum] + # # @param replaces_adjustment_id [String] + # # + # def initialize(adjustment:, replaces_adjustment_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The definition of a new adjustment to create and add to the subscription. + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "percentage_discount", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, percentage_discount: Float, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount ... + # in {adjustment_type: "usage_discount", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, usage_discount: Float, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewUsageDiscount ... + # in {adjustment_type: "amount_discount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewAmountDiscount ... + # in {adjustment_type: "minimum", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, item_id: String, minimum_amount: String} + # # Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMinimum ... + # in {adjustment_type: "maximum", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, maximum_amount: String, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMaximum ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewUsageDiscount + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewAmountDiscount + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMinimum + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMaximum + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :percentage_discount, + -> { Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount } + + variant :usage_discount, + -> { Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewUsageDiscount } + + variant :amount_discount, + -> { Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewAmountDiscount } + + variant :minimum, + -> { + Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMinimum + } + + variant :maximum, + -> { + Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMaximum + } + + # @example + # ```ruby + # new_percentage_discount => { + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # percentage_discount: Float, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewPercentageDiscount < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute percentage_discount + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param percentage_discount [Float] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # applies_to_price_ids:, + # percentage_discount:, + # is_invoice_level: nil, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_usage_discount => { + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # usage_discount: Float, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewUsageDiscount < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute usage_discount + # + # @return [Float] + required :usage_discount, Float + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param usage_discount [Float] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize(applies_to_price_ids:, usage_discount:, is_invoice_level: nil, adjustment_type: :usage_discount, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_amount_discount => { + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewAmountDiscount < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize(amount_discount:, applies_to_price_ids:, is_invoice_level: nil, adjustment_type: :amount_discount, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_minimum => { + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # item_id: String, + # minimum_amount: String, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewMinimum < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # + # @return [String] + required :minimum_amount, String + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize(applies_to_price_ids:, item_id:, minimum_amount:, is_invoice_level: nil, adjustment_type: :minimum, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_maximum => { + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewMaximum < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # + # @return [String] + required :maximum_amount, String + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, is_invoice_level: nil, adjustment_type: :maximum, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # replace_price => { + # replaces_price_id: String, + # discounts: -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount] === _1 }, + # external_price_id: String, + # fixed_price_quantity: Float, + # maximum_amount: String, + # **_ + # } + # ``` + class ReplacePrice < Orb::BaseModel + # @!attribute replaces_price_id + # The id of the price on the plan to replace in the subscription. + # + # @return [String] + required :replaces_price_id, String + + # @!attribute discounts + # [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the + # replacement price. + # + # @return [Array, nil] + optional :discounts, + -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount] }, + nil?: true + + # @!attribute external_price_id + # The external price id of the price to add to the subscription. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # The new quantity of the price, if the price is a fixed price. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute maximum_amount + # [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for + # the replacement price. + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute minimum_amount + # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for + # the replacement price. + # + # @return [String, nil] + optional :minimum_amount, String, nil?: true + + # @!attribute price + # The definition of a new price to create and add to the subscription. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice, nil] + optional :price, union: -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price }, nil?: true + + # @!attribute price_id + # The id of the price to add to the subscription. + # + # @return [String, nil] + optional :price_id, String, nil?: true + + # @!parse + # # @param replaces_price_id [String] + # # @param discounts [Array, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param maximum_amount [String, nil] + # # @param minimum_amount [String, nil] + # # @param price [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice, nil] + # # @param price_id [String, nil] + # # + # def initialize( + # replaces_price_id:, + # discounts: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # maximum_amount: nil, + # minimum_amount: nil, + # price: nil, + # price_id: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # discount => { + # discount_type: Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount::DiscountType, + # amount_discount: String, + # percentage_discount: Float, + # usage_discount: Float + # } + # ``` + class Discount < Orb::BaseModel + # @!attribute discount_type + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount::DiscountType] + required :discount_type, + enum: -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount::DiscountType } + + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [String, nil] + optional :amount_discount, String, nil?: true + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`. This is a number between 0 + # and 1. + # + # @return [Float, nil] + optional :percentage_discount, Float, nil?: true + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for + # + # @return [Float, nil] + optional :usage_discount, Float, nil?: true + + # @!parse + # # @param discount_type [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount::DiscountType] + # # @param amount_discount [String, nil] + # # @param percentage_discount [Float, nil] + # # @param usage_discount [Float, nil] + # # + # def initialize(discount_type:, amount_discount: nil, percentage_discount: nil, usage_discount: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case discount_type + # in :percentage + # # ... + # in :usage + # # ... + # in :amount + # # ... + # end + # ``` + class DiscountType < Orb::Enum + PERCENTAGE = :percentage + USAGE = :usage + AMOUNT = :amount + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # The definition of a new price to create and add to the subscription. + # + # @example + # ```ruby + # case price + # in {model_type: "unit", cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice ... + # in {model_type: "package", cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice ... + # in {model_type: "matrix", cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::Cadence, item_id: String, matrix_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice ... + # in {model_type: "tiered", cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice ... + # in {model_type: "tiered_bps", cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice ... + # in {model_type: "bps", bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig, cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::Cadence, item_id: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice ... + # in {model_type: "bulk_bps", bulk_bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::Cadence, item_id: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice ... + # in {model_type: "bulk", bulk_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig, cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::Cadence, item_id: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice ... + # in {model_type: "threshold_total_amount", cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice ... + # in {model_type: "tiered_package", cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice ... + # in {model_type: "tiered_with_minimum", cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice ... + # in {model_type: "unit_with_percent", cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice ... + # in {model_type: "package_with_allocation", cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice ... + # in {model_type: "tiered_with_proration", cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice ... + # in {model_type: "unit_with_proration", cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice ... + # in {model_type: "grouped_allocation", cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence, grouped_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, item_id: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice ... + # in {model_type: "grouped_with_prorated_minimum", cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence, grouped_with_prorated_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, item_id: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice ... + # in {model_type: "bulk_with_proration", bulk_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence, item_id: String} + # # Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice ... + # end + # ``` + # + # @example + # ```ruby + # case price + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice + # # ... + # in Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice + # # ... + # end + # ``` + class Price < Orb::Union + discriminator :model_type + + variant :unit, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice + } + + variant :package, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice } + + variant :matrix, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice } + + variant :tiered, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice } + + variant :tiered_bps, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice } + + variant :bps, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice + } + + variant :bulk_bps, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice } + + variant :bulk, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice + } + + variant :threshold_total_amount, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice } + + variant :tiered_package, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice } + + variant :tiered_with_minimum, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice } + + variant :unit_with_percent, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice } + + variant :package_with_allocation, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice } + + variant :tiered_with_proration, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice } + + variant :unit_with_proration, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice } + + variant :grouped_allocation, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice } + + variant :grouped_with_prorated_minimum, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice } + + variant :bulk_with_proration, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice } + + # @example + # ```ruby + # new_subscription_unit_price => { + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::Cadence, + # item_id: String, + # model_type: :unit, + # name: String, + # unit_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig, + # **_ + # } + # ``` + class NewSubscriptionUnitPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit] + required :model_type, const: :unit + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_config + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig] + required :unit_config, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param unit_config [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :unit] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # unit_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :unit, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # unit_config => { + # unit_amount: String + # } + # ``` + class UnitConfig < Orb::BaseModel + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param unit_amount [String] + # # + # def initialize(unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_package_price => { + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::Cadence, + # item_id: String, + # model_type: :package, + # name: String, + # package_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig, + # **_ + # } + # ``` + class NewSubscriptionPackagePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :package] + required :model_type, const: :package + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute package_config + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig] + required :package_config, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param package_config [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :package] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # package_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # package_config => { + # package_amount: String, + # package_size: Integer + # } + # ``` + class PackageConfig < Orb::BaseModel + # @!attribute package_amount + # A currency amount to rate usage by + # + # @return [String] + required :package_amount, String + + # @!attribute package_size + # An integer amount to represent package size. For example, 1000 here would divide + # usage by 1000 before multiplying by package_amount in rating + # + # @return [Integer] + required :package_size, Integer + + # @!parse + # # @param package_amount [String] + # # @param package_size [Integer] + # # + # def initialize(package_amount:, package_size:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_matrix_price => { + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::Cadence, + # item_id: String, + # matrix_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + # model_type: :matrix, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionMatrixPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute matrix_config + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig] + required :matrix_config, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig } + + # @!attribute model_type + # + # @return [Symbol, :matrix] + required :model_type, const: :matrix + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::Cadence] + # # @param item_id [String] + # # @param matrix_config [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :matrix] + # # + # def initialize( + # cadence:, + # item_id:, + # matrix_config:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :matrix, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # matrix_config => { + # default_unit_amount: String, + # dimensions: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # matrix_values: -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] === _1 } + # } + # ``` + class MatrixConfig < Orb::BaseModel + # @!attribute default_unit_amount + # Default per unit rate for any usage not bucketed into a specified matrix_value + # + # @return [String] + required :default_unit_amount, String + + # @!attribute dimensions + # One or two event property values to evaluate matrix groups by + # + # @return [Array] + required :dimensions, Orb::ArrayOf[String, nil?: true] + + # @!attribute matrix_values + # Matrix values for specified matrix grouping keys + # + # @return [Array] + required :matrix_values, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + } + + # @!parse + # # @param default_unit_amount [String] + # # @param dimensions [Array] + # # @param matrix_values [Array] + # # + # def initialize(default_unit_amount:, dimensions:, matrix_values:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # matrix_value => { + # dimension_values: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # unit_amount: String + # } + # ``` + class MatrixValue < Orb::BaseModel + # @!attribute dimension_values + # One or two matrix keys to filter usage to this Matrix value by. For example, + # ["region", "tier"] could be used to filter cloud usage by a cloud region and an + # instance tier. + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String, nil?: true] + + # @!attribute unit_amount + # Unit price for the specified dimension_values + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param dimension_values [Array] + # # @param unit_amount [String] + # # + # def initialize(dimension_values:, unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tiered_price => { + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::Cadence, + # item_id: String, + # model_type: :tiered, + # name: String, + # tiered_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig, + # **_ + # } + # ``` + class NewSubscriptionTieredPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered] + required :model_type, const: :tiered + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_config + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig] + required :tiered_config, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_config [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # tiered_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] === _1 } + # } + # ``` + class TieredConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # first_unit: Float, + # unit_amount: String, + # last_unit: Float + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute first_unit + # Inclusive tier starting value + # + # @return [Float] + required :first_unit, Float + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute last_unit + # Exclusive tier ending value. If null, this is treated as the last tier + # + # @return [Float, nil] + optional :last_unit, Float, nil?: true + + # @!parse + # # @param first_unit [Float] + # # @param unit_amount [String] + # # @param last_unit [Float, nil] + # # + # def initialize(first_unit:, unit_amount:, last_unit: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tiered_bps_price => { + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::Cadence, + # item_id: String, + # model_type: :tiered_bps, + # name: String, + # tiered_bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + # **_ + # } + # ``` + class NewSubscriptionTieredBpsPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_bps] + required :model_type, const: :tiered_bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_bps_config + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig] + required :tiered_bps_config, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_bps_config [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered_bps] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_bps_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered_bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # tiered_bps_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] === _1 } + # } + # ``` + class TieredBpsConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + # tiers + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # bps: Float, + # minimum_amount: String, + # maximum_amount: String, + # per_unit_maximum: String + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute bps + # Per-event basis point rate + # + # @return [Float] + required :bps, Float + + # @!attribute minimum_amount + # Inclusive tier starting value + # + # @return [String] + required :minimum_amount, String + + # @!attribute maximum_amount + # Exclusive tier ending value + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute per_unit_maximum + # Per unit maximum to charge + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param minimum_amount [String] + # # @param maximum_amount [String, nil] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_bps_price => { + # bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig, + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::Cadence, + # item_id: String, + # model_type: :bps, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionBpsPrice < Orb::BaseModel + # @!attribute bps_config + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig] + required :bps_config, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bps] + required :model_type, const: :bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param bps_config [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig] + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :bps] + # # + # def initialize( + # bps_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bps_config => { + # bps: Float, + # per_unit_maximum: String + # } + # ``` + class BpsConfig < Orb::BaseModel + # @!attribute bps + # Basis point take rate per event + # + # @return [Float] + required :bps, Float + + # @!attribute per_unit_maximum + # Optional currency amount maximum to cap spend per event + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_bulk_bps_price => { + # bulk_bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::Cadence, + # item_id: String, + # model_type: :bulk_bps, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionBulkBpsPrice < Orb::BaseModel + # @!attribute bulk_bps_config + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig] + required :bulk_bps_config, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk_bps] + required :model_type, const: :bulk_bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param bulk_bps_config [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig] + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :bulk_bps] + # # + # def initialize( + # bulk_bps_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :bulk_bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bulk_bps_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] === _1 } + # } + # ``` + class BulkBpsConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for a bulk BPS pricing model where all usage is aggregated to a single + # tier based on total volume + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # bps: Float, + # maximum_amount: String, + # per_unit_maximum: String + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute bps + # Basis points to rate on + # + # @return [Float] + required :bps, Float + + # @!attribute maximum_amount + # Upper bound for tier + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute per_unit_maximum + # The maximum amount to charge for any one event + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param maximum_amount [String, nil] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, maximum_amount: nil, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_bulk_price => { + # bulk_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig, + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::Cadence, + # item_id: String, + # model_type: :bulk, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionBulkPrice < Orb::BaseModel + # @!attribute bulk_config + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig] + required :bulk_config, + -> { Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk] + required :model_type, const: :bulk + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param bulk_config [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig] + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :bulk] + # # + # def initialize( + # bulk_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :bulk, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bulk_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] === _1 } + # } + # ``` + class BulkConfig < Orb::BaseModel + # @!attribute tiers + # Bulk tiers for rating based on total usage volume + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # unit_amount: String, + # maximum_units: Float + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute maximum_units + # Upper bound for this tier + # + # @return [Float, nil] + optional :maximum_units, Float, nil?: true + + # @!parse + # # @param unit_amount [String] + # # @param maximum_units [Float, nil] + # # + # def initialize(unit_amount:, maximum_units: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_threshold_total_amount_price => { + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence, + # item_id: String, + # model_type: :threshold_total_amount, + # name: String, + # threshold_total_amount_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionThresholdTotalAmountPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :threshold_total_amount] + required :model_type, const: :threshold_total_amount + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute threshold_total_amount_config + # + # @return [Hash{Symbol=>Object}] + required :threshold_total_amount_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param threshold_total_amount_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :threshold_total_amount] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # threshold_total_amount_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :threshold_total_amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tiered_package_price => { + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::Cadence, + # item_id: String, + # model_type: :tiered_package, + # name: String, + # tiered_package_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionTieredPackagePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_package] + required :model_type, const: :tiered_package + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_package_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_package_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_package_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered_package] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_package_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered_package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tiered_with_minimum_price => { + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence, + # item_id: String, + # model_type: :tiered_with_minimum, + # name: String, + # tiered_with_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionTieredWithMinimumPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_with_minimum] + required :model_type, const: :tiered_with_minimum + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_with_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_with_minimum_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered_with_minimum] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_with_minimum_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered_with_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_unit_with_percent_price => { + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence, + # item_id: String, + # model_type: :unit_with_percent, + # name: String, + # unit_with_percent_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionUnitWithPercentPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit_with_percent] + required :model_type, const: :unit_with_percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_with_percent_config + # + # @return [Hash{Symbol=>Object}] + required :unit_with_percent_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param unit_with_percent_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :unit_with_percent] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # unit_with_percent_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :unit_with_percent, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_package_with_allocation_price => { + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence, + # item_id: String, + # model_type: :package_with_allocation, + # name: String, + # package_with_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionPackageWithAllocationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :package_with_allocation] + required :model_type, const: :package_with_allocation + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute package_with_allocation_config + # + # @return [Hash{Symbol=>Object}] + required :package_with_allocation_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param package_with_allocation_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :package_with_allocation] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # package_with_allocation_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :package_with_allocation, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tier_with_proration_price => { + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::Cadence, + # item_id: String, + # model_type: :tiered_with_proration, + # name: String, + # tiered_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionTierWithProrationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_with_proration_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered_with_proration] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_with_proration_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_unit_with_proration_price => { + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence, + # item_id: String, + # model_type: :unit_with_proration, + # name: String, + # unit_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionUnitWithProrationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit_with_proration] + required :model_type, const: :unit_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :unit_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param unit_with_proration_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :unit_with_proration] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # unit_with_proration_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :unit_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_grouped_allocation_price => { + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence, + # grouped_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_allocation, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionGroupedAllocationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence + } + + # @!attribute grouped_allocation_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_allocation_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_allocation] + required :model_type, const: :grouped_allocation + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence] + # # @param grouped_allocation_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :grouped_allocation] + # # + # def initialize( + # cadence:, + # grouped_allocation_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :grouped_allocation, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_grouped_with_prorated_minimum_price => { + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence, + # grouped_with_prorated_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_with_prorated_minimum, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionGroupedWithProratedMinimumPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence + } + + # @!attribute grouped_with_prorated_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_with_prorated_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_with_prorated_minimum] + required :model_type, const: :grouped_with_prorated_minimum + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence] + # # @param grouped_with_prorated_minimum_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :grouped_with_prorated_minimum] + # # + # def initialize( + # cadence:, + # grouped_with_prorated_minimum_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :grouped_with_prorated_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_bulk_with_proration_price => { + # bulk_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence, + # item_id: String, + # model_type: :bulk_with_proration, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionBulkWithProrationPrice < Orb::BaseModel + # @!attribute bulk_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :bulk_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk_with_proration] + required :model_type, const: :bulk_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param bulk_with_proration_config [Hash{Symbol=>Object}] + # # @param cadence [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :bulk_with_proration] + # # + # def initialize( + # bulk_with_proration_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :bulk_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end + end + end +end diff --git a/lib/orb/models/subscription_create_response.rb b/lib/orb/models/subscription_create_response.rb new file mode 100644 index 00000000..14f0ee08 --- /dev/null +++ b/lib/orb/models/subscription_create_response.rb @@ -0,0 +1,1441 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # subscription_create_response => { + # id: String, + # active_plan_phase_order: Integer, + # adjustment_intervals: -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateResponse::AdjustmentInterval] === _1 }, + # auto_collection: Orb::BooleanModel, + # billing_cycle_anchor_configuration: Orb::Models::SubscriptionCreateResponse::BillingCycleAnchorConfiguration, + # **_ + # } + # ``` + class SubscriptionCreateResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute active_plan_phase_order + # The current plan phase that is active, only if the subscription's plan has + # phases. + # + # @return [Integer, nil] + required :active_plan_phase_order, Integer, nil?: true + + # @!attribute adjustment_intervals + # The adjustment intervals for this subscription. + # + # @return [Array] + required :adjustment_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateResponse::AdjustmentInterval] } + + # @!attribute auto_collection + # Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. This property defaults to + # the plan's behavior. If null, defaults to the customer's setting. + # + # @return [Boolean, nil] + required :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_anchor_configuration + # + # @return [Orb::Models::SubscriptionCreateResponse::BillingCycleAnchorConfiguration] + required :billing_cycle_anchor_configuration, + -> { Orb::Models::SubscriptionCreateResponse::BillingCycleAnchorConfiguration } + + # @!attribute billing_cycle_day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is not part of the billing period. Set to null for + # subscriptions that are not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if the subscription is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute customer + # A customer is a buyer of your products, and the other party to the billing + # relationship. + # + # In Orb, customers are assigned system generated identifiers automatically, but + # it's often desirable to have these match existing identifiers in your system. To + # avoid having to denormalize Orb ID information, you can pass in an + # `external_customer_id` with your own identifier. See + # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + # information about how these aliases work in Orb. + # + # In addition to having an identifier in your system, a customer may exist in a + # payment provider solution like Stripe. Use the `payment_provider_id` and the + # `payment_provider` enum field to express this mapping. + # + # A customer also has a timezone (from the standard + # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + # your account's timezone. See [Timezone localization](/essentials/timezones) for + # information on what this timezone parameter influences within Orb. + # + # @return [Orb::Models::Customer] + required :customer, -> { Orb::Models::Customer } + + # @!attribute default_invoice_memo + # Determines the default memo on this subscriptions' invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @return [String, nil] + required :default_invoice_memo, String, nil?: true + + # @!attribute discount_intervals + # The discount intervals for this subscription. + # + # @return [Array] + required :discount_intervals, + -> { Orb::ArrayOf[union: Orb::Models::SubscriptionCreateResponse::DiscountInterval] } + + # @!attribute end_date + # The date Orb stops billing for this subscription. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_schedule + # + # @return [Array] + required :fixed_fee_quantity_schedule, + -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateResponse::FixedFeeQuantitySchedule] } + + # @!attribute invoicing_threshold + # + # @return [String, nil] + required :invoicing_threshold, String, nil?: true + + # @!attribute maximum_intervals + # The maximum intervals for this subscription. + # + # @return [Array] + required :maximum_intervals, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionCreateResponse::MaximumInterval] + } + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum_intervals + # The minimum intervals for this subscription. + # + # @return [Array] + required :minimum_intervals, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionCreateResponse::MinimumInterval] + } + + # @!attribute net_terms + # Determines the difference between the invoice issue date for subscription + # invoices as the date that they are due. A value of `0` here represents that the + # invoice is due on issue, whereas a value of `30` represents that the customer + # has a month to pay the invoice. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute plan + # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + # subscribed to by a customer. Plans define the billing behavior of the + # subscription. You can see more about how to configure prices in the + # [Price resource](/reference/price). + # + # @return [Orb::Models::Plan] + required :plan, -> { Orb::Models::Plan } + + # @!attribute price_intervals + # The price intervals for this subscription. + # + # @return [Array] + required :price_intervals, -> { Orb::ArrayOf[Orb::Models::SubscriptionCreateResponse::PriceInterval] } + + # @!attribute redeemed_coupon + # + # @return [Orb::Models::SubscriptionCreateResponse::RedeemedCoupon, nil] + required :redeemed_coupon, -> { Orb::Models::SubscriptionCreateResponse::RedeemedCoupon }, nil?: true + + # @!attribute start_date + # The date Orb starts billing for this subscription. + # + # @return [Time] + required :start_date, Time + + # @!attribute status + # + # @return [Symbol, Orb::Models::SubscriptionCreateResponse::Status] + required :status, enum: -> { Orb::Models::SubscriptionCreateResponse::Status } + + # @!attribute trial_info + # + # @return [Orb::Models::SubscriptionCreateResponse::TrialInfo] + required :trial_info, -> { Orb::Models::SubscriptionCreateResponse::TrialInfo } + + # @!parse + # # @param id [String] + # # @param active_plan_phase_order [Integer, nil] + # # @param adjustment_intervals [Array] + # # @param auto_collection [Boolean, nil] + # # @param billing_cycle_anchor_configuration [Orb::Models::SubscriptionCreateResponse::BillingCycleAnchorConfiguration] + # # @param billing_cycle_day [Integer] + # # @param created_at [Time] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param customer [Orb::Models::Customer] + # # @param default_invoice_memo [String, nil] + # # @param discount_intervals [Array] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_schedule [Array] + # # @param invoicing_threshold [String, nil] + # # @param maximum_intervals [Array] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum_intervals [Array] + # # @param net_terms [Integer] + # # @param plan [Orb::Models::Plan] + # # @param price_intervals [Array] + # # @param redeemed_coupon [Orb::Models::SubscriptionCreateResponse::RedeemedCoupon, nil] + # # @param start_date [Time] + # # @param status [Symbol, Orb::Models::SubscriptionCreateResponse::Status] + # # @param trial_info [Orb::Models::SubscriptionCreateResponse::TrialInfo] + # # + # def initialize( + # id:, + # active_plan_phase_order:, + # adjustment_intervals:, + # auto_collection:, + # billing_cycle_anchor_configuration:, + # billing_cycle_day:, + # created_at:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # customer:, + # default_invoice_memo:, + # discount_intervals:, + # end_date:, + # fixed_fee_quantity_schedule:, + # invoicing_threshold:, + # maximum_intervals:, + # metadata:, + # minimum_intervals:, + # net_terms:, + # plan:, + # price_intervals:, + # redeemed_coupon:, + # start_date:, + # status:, + # trial_info:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # adjustment_interval => { + # id: String, + # adjustment: Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # start_date: Time + # } + # ``` + class AdjustmentInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment + # + # @return [Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + required :adjustment, + union: -> { Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment } + + # @!attribute applies_to_price_interval_ids + # The price interval IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the adjustment interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the adjustment interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param id [String] + # # @param adjustment [Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "amount_discount", id: String, amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment ... + # in {adjustment_type: "percentage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment ... + # in {adjustment_type: "usage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment ... + # in {adjustment_type: "minimum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MinimumAdjustment ... + # in {adjustment_type: "maximum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MaximumAdjustment ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + # # ... + # in Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :amount_discount, + -> { Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment } + + variant :percentage_discount, + -> { Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment } + + variant :usage_discount, + -> { Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment } + + variant :minimum, + -> { Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MinimumAdjustment } + + variant :maximum, + -> { Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MaximumAdjustment } + + # @example + # ```ruby + # amount_discount_adjustment => { + # id: String, + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # **_ + # } + # ``` + class AmountDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # The amount by which to discount the prices this adjustment applies to in a given + # billing period. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize( + # id:, + # amount_discount:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # adjustment_type: :amount_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_adjustment => { + # id: String, + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # percentage_discount: Float, + # **_ + # } + # ``` + class PercentageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute percentage_discount + # The percentage (as a value between 0 and 1) by which to discount the price + # intervals this adjustment applies to in a given billing period. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param percentage_discount [Float] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # percentage_discount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_adjustment => { + # id: String, + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # plan_phase_order: Integer, + # **_ + # } + # ``` + class UsageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute usage_discount + # The number of usage units by which to discount the price this adjustment applies + # to in a given billing period. + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param usage_discount [Float] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # usage_discount:, + # adjustment_type: :usage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_adjustment => { + # id: String, + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # item_id: String, + # **_ + # } + # ``` + class MinimumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # item_id:, + # minimum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_adjustment => { + # id: String, + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # maximum_amount: String, + # **_ + # } + # ``` + class MaximumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param maximum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # maximum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :maximum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # billing_cycle_anchor_configuration => { + # day: Integer, + # month: Integer, + # year: Integer + # } + # ``` + class BillingCycleAnchorConfiguration < Orb::BaseModel + # @!attribute day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :day, Integer + + # @!attribute month + # The month on which the billing cycle is anchored (e.g. a quarterly price + # anchored in February would have cycles starting February, May, August, and + # November). + # + # @return [Integer, nil] + optional :month, Integer, nil?: true + + # @!attribute year + # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle + # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + # + # @return [Integer, nil] + optional :year, Integer, nil?: true + + # @!parse + # # @param day [Integer] + # # @param month [Integer, nil] + # # @param year [Integer, nil] + # # + # def initialize(day:, month: nil, year: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case discount_interval + # in {discount_type: "amount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionCreateResponse::DiscountInterval::AmountDiscountInterval ... + # in {discount_type: "percentage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionCreateResponse::DiscountInterval::PercentageDiscountInterval ... + # in {discount_type: "usage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionCreateResponse::DiscountInterval::UsageDiscountInterval ... + # end + # ``` + # + # @example + # ```ruby + # case discount_interval + # in Orb::Models::SubscriptionCreateResponse::DiscountInterval::AmountDiscountInterval + # # ... + # in Orb::Models::SubscriptionCreateResponse::DiscountInterval::PercentageDiscountInterval + # # ... + # in Orb::Models::SubscriptionCreateResponse::DiscountInterval::UsageDiscountInterval + # # ... + # end + # ``` + class DiscountInterval < Orb::Union + discriminator :discount_type + + variant :amount, + -> { + Orb::Models::SubscriptionCreateResponse::DiscountInterval::AmountDiscountInterval + } + + variant :percentage, + -> { Orb::Models::SubscriptionCreateResponse::DiscountInterval::PercentageDiscountInterval } + + variant :usage, + -> { + Orb::Models::SubscriptionCreateResponse::DiscountInterval::UsageDiscountInterval + } + + # @example + # ```ruby + # amount_discount_interval => { + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :amount, + # end_date: Time + # } + # ``` + class AmountDiscountInterval < Orb::BaseModel + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :amount] + required :discount_type, const: :amount + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param discount_type [Symbol, :amount] + # # + # def initialize( + # amount_discount:, + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # discount_type: :amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :percentage, + # end_date: Time, + # percentage_discount: Float + # } + # ``` + class PercentageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :percentage] + required :discount_type, const: :percentage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`.This is a number between 0 + # and 1. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param percentage_discount [Float] + # # @param start_date [Time] + # # @param discount_type [Symbol, :percentage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # percentage_discount:, + # start_date:, + # discount_type: :percentage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :usage, + # end_date: Time, + # start_date: Time + # } + # ``` + class UsageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :usage] + required :discount_type, const: :usage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param usage_discount [Float] + # # @param discount_type [Symbol, :usage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # usage_discount:, + # discount_type: :usage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # fixed_fee_quantity_schedule => { + # end_date: Time, + # price_id: String, + # quantity: Float, + # start_date: Time + # } + # ``` + class FixedFeeQuantitySchedule < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param end_date [Time, nil] + # # @param price_id [String] + # # @param quantity [Float] + # # @param start_date [Time] + # # + # def initialize(end_date:, price_id:, quantity:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # maximum_amount: String, + # start_date: Time + # } + # ``` + class MaximumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the maximum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the price intervals + # this transform applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute start_date + # The start date of the maximum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param maximum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, maximum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # minimum_amount: String, + # start_date: Time + # } + # ``` + class MinimumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the minimum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the price intervals + # this minimum applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute start_date + # The start date of the minimum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param minimum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, minimum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # price_interval => { + # id: String, + # billing_cycle_day: Integer, + # current_billing_period_end_date: Time, + # current_billing_period_start_date: Time, + # end_date: Time, + # **_ + # } + # ``` + class PriceInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billing_cycle_day + # The day of the month that Orb bills for this price + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is exactly the end of the billing period. Set to null if + # this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute end_date + # The end date of the price interval. This is the date that Orb stops billing for + # this price. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_transitions + # The fixed fee quantity transitions for this price interval. This is only + # relevant for fixed fees. + # + # @return [Array, nil] + required :fixed_fee_quantity_transitions, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionCreateResponse::PriceInterval::FixedFeeQuantityTransition] + }, + nil?: true + + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + required :price, union: -> { Orb::Models::Price } + + # @!attribute start_date + # The start date of the price interval. This is the date that Orb starts billing + # for this price. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # The Price Interval resource represents a period of time for which a price will + # # bill on a subscription. A subscription’s price intervals define its billing + # # behavior. + # # + # # @param id [String] + # # @param billing_cycle_day [Integer] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_transitions [Array, nil] + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # # @param start_date [Time] + # # + # def initialize( + # id:, + # billing_cycle_day:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # end_date:, + # fixed_fee_quantity_transitions:, + # price:, + # start_date:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # fixed_fee_quantity_transition => { + # effective_date: Time, + # price_id: String, + # quantity: Integer + # } + # ``` + class FixedFeeQuantityTransition < Orb::BaseModel + # @!attribute effective_date + # + # @return [Time] + required :effective_date, Time + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Integer] + required :quantity, Integer + + # @!parse + # # @param effective_date [Time] + # # @param price_id [String] + # # @param quantity [Integer] + # # + # def initialize(effective_date:, price_id:, quantity:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # redeemed_coupon => { + # coupon_id: String, + # end_date: Time, + # start_date: Time + # } + # ``` + class RedeemedCoupon < Orb::BaseModel + # @!attribute coupon_id + # + # @return [String] + required :coupon_id, String + + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param coupon_id [String] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(coupon_id:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :ended + # # ... + # in :upcoming + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # trial_info => { + # end_date: Time + # } + # ``` + class TrialInfo < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!parse + # # @param end_date [Time, nil] + # # + # def initialize(end_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/subscription_fetch_costs_params.rb b/lib/orb/models/subscription_fetch_costs_params.rb new file mode 100644 index 00000000..91b8853e --- /dev/null +++ b/lib/orb/models/subscription_fetch_costs_params.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module Orb + module Models + class SubscriptionFetchCostsParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute currency + # The currency or custom pricing unit to use. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute timeframe_end + # Costs returned are exclusive of `timeframe_end`. + # + # @return [Time, nil] + optional :timeframe_end, Time, nil?: true + + # @!attribute timeframe_start + # Costs returned are inclusive of `timeframe_start`. + # + # @return [Time, nil] + optional :timeframe_start, Time, nil?: true + + # @!attribute view_mode + # Controls whether Orb returns cumulative costs since the start of the billing + # period, or incremental day-by-day costs. If your customer has minimums or + # discounts, it's strongly recommended that you use the default cumulative + # behavior. + # + # @return [Symbol, Orb::Models::SubscriptionFetchCostsParams::ViewMode, nil] + optional :view_mode, enum: -> { Orb::Models::SubscriptionFetchCostsParams::ViewMode }, nil?: true + + # @!parse + # # @param currency [String, nil] + # # @param timeframe_end [Time, nil] + # # @param timeframe_start [Time, nil] + # # @param view_mode [Symbol, Orb::Models::SubscriptionFetchCostsParams::ViewMode, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(currency: nil, timeframe_end: nil, timeframe_start: nil, view_mode: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # Controls whether Orb returns cumulative costs since the start of the billing + # period, or incremental day-by-day costs. If your customer has minimums or + # discounts, it's strongly recommended that you use the default cumulative + # behavior. + # + # @example + # ```ruby + # case view_mode + # in :periodic + # # ... + # in :cumulative + # # ... + # end + # ``` + class ViewMode < Orb::Enum + PERIODIC = :periodic + CUMULATIVE = :cumulative + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/orb/models/subscription_fetch_costs_response.rb b/lib/orb/models/subscription_fetch_costs_response.rb index 68650a85..7bc8abf2 100644 --- a/lib/orb/models/subscription_fetch_costs_response.rb +++ b/lib/orb/models/subscription_fetch_costs_response.rb @@ -1,45 +1,130 @@ -require "orb/model" +# frozen_string_literal: true + module Orb module Models - class SubscriptionFetchCostsResponse < Orb::Model - class Data < Orb::Model - class PerPriceCosts < Orb::Model - class PriceGroups < Orb::Model - # @!attribute [rw] grouping_key - required :grouping_key, String - # @!attribute [rw] grouping_value - required :grouping_value, String - # @!attribute [rw] secondary_grouping_key - required :secondary_grouping_key, String - # @!attribute [rw] secondary_grouping_value - required :secondary_grouping_value, String - # @!attribute [rw] total - required :total, String - end - # @!attribute [rw] price - required :price, Orb::Unknown - # @!attribute [rw] subtotal + # @example + # ```ruby + # subscription_fetch_costs_response => { + # data: -> { Orb::ArrayOf[Orb::Models::SubscriptionFetchCostsResponse::Data] === _1 } + # } + # ``` + class SubscriptionFetchCostsResponse < Orb::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Orb::ArrayOf[Orb::Models::SubscriptionFetchCostsResponse::Data] } + + # @!parse + # # @param data [Array] + # # + # def initialize(data:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # data => { + # per_price_costs: -> { Orb::ArrayOf[Orb::Models::SubscriptionFetchCostsResponse::Data::PerPriceCost] === _1 }, + # subtotal: String, + # timeframe_end: Time, + # timeframe_start: Time, + # total: String + # } + # ``` + class Data < Orb::BaseModel + # @!attribute per_price_costs + # + # @return [Array] + required :per_price_costs, + -> { Orb::ArrayOf[Orb::Models::SubscriptionFetchCostsResponse::Data::PerPriceCost] } + + # @!attribute subtotal + # Total costs for the timeframe, excluding any minimums and discounts. + # + # @return [String] + required :subtotal, String + + # @!attribute timeframe_end + # + # @return [Time] + required :timeframe_end, Time + + # @!attribute timeframe_start + # + # @return [Time] + required :timeframe_start, Time + + # @!attribute total + # Total costs for the timeframe, including any minimums and discounts. + # + # @return [String] + required :total, String + + # @!parse + # # @param per_price_costs [Array] + # # @param subtotal [String] + # # @param timeframe_end [Time] + # # @param timeframe_start [Time] + # # @param total [String] + # # + # def initialize(per_price_costs:, subtotal:, timeframe_end:, timeframe_start:, total:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # per_price_cost => { + # price: Orb::Models::Price, + # subtotal: String, + # total: String, + # quantity: Float + # } + # ``` + class PerPriceCost < Orb::BaseModel + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + required :price, union: -> { Orb::Models::Price } + + # @!attribute subtotal + # Price's contributions for the timeframe, excluding any minimums and discounts. + # + # @return [String] required :subtotal, String - # @!attribute [rw] total + + # @!attribute total + # Price's contributions for the timeframe, including minimums and discounts. + # + # @return [String] required :total, String - # @!attribute [rw] price_groups - optional :price_groups, Orb::ArrayOf.new(PriceGroups) - # @!attribute [rw] quantity - optional :quantity, Float + + # @!attribute quantity + # The price's quantity for the timeframe + # + # @return [Float, nil] + optional :quantity, Float, nil?: true + + # @!parse + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # # @param subtotal [String] + # # @param total [String] + # # @param quantity [Float, nil] + # # + # def initialize(price:, subtotal:, total:, quantity: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - # @!attribute [rw] per_price_costs - required :per_price_costs, Orb::ArrayOf.new(PerPriceCosts) - # @!attribute [rw] subtotal - required :subtotal, String - # @!attribute [rw] timeframe_end - required :timeframe_end, String - # @!attribute [rw] timeframe_start - required :timeframe_start, String - # @!attribute [rw] total - required :total, String end - # @!attribute [rw] data - required :data, Orb::ArrayOf.new(Data) end end end diff --git a/lib/orb/models/subscription_fetch_params.rb b/lib/orb/models/subscription_fetch_params.rb new file mode 100644 index 00000000..e94e5be0 --- /dev/null +++ b/lib/orb/models/subscription_fetch_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class SubscriptionFetchParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/subscription_fetch_schedule_params.rb b/lib/orb/models/subscription_fetch_schedule_params.rb new file mode 100644 index 00000000..5be672d3 --- /dev/null +++ b/lib/orb/models/subscription_fetch_schedule_params.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +module Orb + module Models + class SubscriptionFetchScheduleParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!attribute start_date_gt + # + # @return [Time, nil] + optional :start_date_gt, Time, api_name: :"start_date[gt]", nil?: true + + # @!attribute start_date_gte + # + # @return [Time, nil] + optional :start_date_gte, Time, api_name: :"start_date[gte]", nil?: true + + # @!attribute start_date_lt + # + # @return [Time, nil] + optional :start_date_lt, Time, api_name: :"start_date[lt]", nil?: true + + # @!attribute start_date_lte + # + # @return [Time, nil] + optional :start_date_lte, Time, api_name: :"start_date[lte]", nil?: true + + # @!parse + # # @param cursor [String, nil] + # # @param limit [Integer] + # # @param start_date_gt [Time, nil] + # # @param start_date_gte [Time, nil] + # # @param start_date_lt [Time, nil] + # # @param start_date_lte [Time, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # cursor: nil, + # limit: nil, + # start_date_gt: nil, + # start_date_gte: nil, + # start_date_lt: nil, + # start_date_lte: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/subscription_fetch_schedule_response.rb b/lib/orb/models/subscription_fetch_schedule_response.rb index 1f0ff296..84ab2b05 100644 --- a/lib/orb/models/subscription_fetch_schedule_response.rb +++ b/lib/orb/models/subscription_fetch_schedule_response.rb @@ -1,21 +1,83 @@ -require "orb/model" +# frozen_string_literal: true + module Orb module Models - class SubscriptionFetchScheduleResponse < Orb::Model - class Plan < Orb::Model - # @!attribute [rw] id - required :id, String - # @!attribute [rw] external_plan_id - required :external_plan_id, String - # @!attribute [rw] name_ - required :name_, String + # @example + # ```ruby + # subscription_fetch_schedule_response => { + # created_at: Time, + # end_date: Time, + # plan: Orb::Models::SubscriptionFetchScheduleResponse::Plan, + # start_date: Time + # } + # ``` + class SubscriptionFetchScheduleResponse < Orb::BaseModel + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute plan + # + # @return [Orb::Models::SubscriptionFetchScheduleResponse::Plan] + required :plan, -> { Orb::Models::SubscriptionFetchScheduleResponse::Plan } + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param created_at [Time] + # # @param end_date [Time, nil] + # # @param plan [Orb::Models::SubscriptionFetchScheduleResponse::Plan] + # # @param start_date [Time] + # # + # def initialize(created_at:, end_date:, plan:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # plan => { + # id: String, + # external_plan_id: String, + # name: String + # } + # ``` + class Plan < Orb::BaseModel + # @!attribute id + # + # @return [String, nil] + required :id, String, nil?: true + + # @!attribute external_plan_id + # An optional user-defined ID for this plan resource, used throughout the system + # as an alias for this Plan. Use this field to identify a plan by an existing + # identifier in your system. + # + # @return [String, nil] + required :external_plan_id, String, nil?: true + + # @!attribute name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!parse + # # @param id [String, nil] + # # @param external_plan_id [String, nil] + # # @param name [String, nil] + # # + # def initialize(id:, external_plan_id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end - # @!attribute [rw] end_date - required :end_date, String - # @!attribute [rw] plan - required :plan, Plan - # @!attribute [rw] start_date - required :start_date, String end end end diff --git a/lib/orb/models/subscription_fetch_usage_params.rb b/lib/orb/models/subscription_fetch_usage_params.rb new file mode 100644 index 00000000..61b7f339 --- /dev/null +++ b/lib/orb/models/subscription_fetch_usage_params.rb @@ -0,0 +1,154 @@ +# frozen_string_literal: true + +module Orb + module Models + class SubscriptionFetchUsageParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute billable_metric_id + # When specified in conjunction with `group_by`, this parameter filters usage to a + # single billable metric. Note that both `group_by` and `billable_metric_id` must + # be specified together. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute first_dimension_key + # + # @return [String, nil] + optional :first_dimension_key, String, nil?: true + + # @!attribute first_dimension_value + # + # @return [String, nil] + optional :first_dimension_value, String, nil?: true + + # @!attribute granularity + # This determines the windowing of usage reporting. + # + # @return [Symbol, Orb::Models::SubscriptionFetchUsageParams::Granularity, nil] + optional :granularity, enum: -> { Orb::Models::SubscriptionFetchUsageParams::Granularity }, nil?: true + + # @!attribute group_by + # Groups per-price usage by the key provided. + # + # @return [String, nil] + optional :group_by, String, nil?: true + + # @!attribute second_dimension_key + # + # @return [String, nil] + optional :second_dimension_key, String, nil?: true + + # @!attribute second_dimension_value + # + # @return [String, nil] + optional :second_dimension_value, String, nil?: true + + # @!attribute timeframe_end + # Usage returned is exclusive of `timeframe_end`. + # + # @return [Time, nil] + optional :timeframe_end, Time, nil?: true + + # @!attribute timeframe_start + # Usage returned is inclusive of `timeframe_start`. + # + # @return [Time, nil] + optional :timeframe_start, Time, nil?: true + + # @!attribute view_mode + # Controls whether Orb returns cumulative usage since the start of the billing + # period, or incremental day-by-day usage. If your customer has minimums or + # discounts, it's strongly recommended that you use the default cumulative + # behavior. + # + # @return [Symbol, Orb::Models::SubscriptionFetchUsageParams::ViewMode, nil] + optional :view_mode, enum: -> { Orb::Models::SubscriptionFetchUsageParams::ViewMode }, nil?: true + + # @!parse + # # @param billable_metric_id [String, nil] + # # @param first_dimension_key [String, nil] + # # @param first_dimension_value [String, nil] + # # @param granularity [Symbol, Orb::Models::SubscriptionFetchUsageParams::Granularity, nil] + # # @param group_by [String, nil] + # # @param second_dimension_key [String, nil] + # # @param second_dimension_value [String, nil] + # # @param timeframe_end [Time, nil] + # # @param timeframe_start [Time, nil] + # # @param view_mode [Symbol, Orb::Models::SubscriptionFetchUsageParams::ViewMode, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # billable_metric_id: nil, + # first_dimension_key: nil, + # first_dimension_value: nil, + # granularity: nil, + # group_by: nil, + # second_dimension_key: nil, + # second_dimension_value: nil, + # timeframe_end: nil, + # timeframe_start: nil, + # view_mode: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # This determines the windowing of usage reporting. + # + # @example + # ```ruby + # case granularity + # in :day + # # ... + # end + # ``` + class Granularity < Orb::Enum + DAY = :day + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # Controls whether Orb returns cumulative usage since the start of the billing + # period, or incremental day-by-day usage. If your customer has minimums or + # discounts, it's strongly recommended that you use the default cumulative + # behavior. + # + # @example + # ```ruby + # case view_mode + # in :periodic + # # ... + # in :cumulative + # # ... + # end + # ``` + class ViewMode < Orb::Enum + PERIODIC = :periodic + CUMULATIVE = :cumulative + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/orb/models/subscription_list_params.rb b/lib/orb/models/subscription_list_params.rb new file mode 100644 index 00000000..a91c4a23 --- /dev/null +++ b/lib/orb/models/subscription_list_params.rb @@ -0,0 +1,119 @@ +# frozen_string_literal: true + +module Orb + module Models + class SubscriptionListParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute created_at_gt + # + # @return [Time, nil] + optional :created_at_gt, Time, api_name: :"created_at[gt]", nil?: true + + # @!attribute created_at_gte + # + # @return [Time, nil] + optional :created_at_gte, Time, api_name: :"created_at[gte]", nil?: true + + # @!attribute created_at_lt + # + # @return [Time, nil] + optional :created_at_lt, Time, api_name: :"created_at[lt]", nil?: true + + # @!attribute created_at_lte + # + # @return [Time, nil] + optional :created_at_lte, Time, api_name: :"created_at[lte]", nil?: true + + # @!attribute cursor + # Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @return [String, nil] + optional :cursor, String, nil?: true + + # @!attribute customer_id + # + # @return [Array, nil] + optional :customer_id, Orb::ArrayOf[String], nil?: true + + # @!attribute external_customer_id + # + # @return [String, nil] + optional :external_customer_id, String, nil?: true + + # @!attribute [r] limit + # The number of items to fetch. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!attribute status + # + # @return [Symbol, Orb::Models::SubscriptionListParams::Status, nil] + optional :status, enum: -> { Orb::Models::SubscriptionListParams::Status }, nil?: true + + # @!parse + # # @param created_at_gt [Time, nil] + # # @param created_at_gte [Time, nil] + # # @param created_at_lt [Time, nil] + # # @param created_at_lte [Time, nil] + # # @param cursor [String, nil] + # # @param customer_id [Array, nil] + # # @param external_customer_id [String, nil] + # # @param limit [Integer] + # # @param status [Symbol, Orb::Models::SubscriptionListParams::Status, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # created_at_gt: nil, + # created_at_gte: nil, + # created_at_lt: nil, + # created_at_lte: nil, + # cursor: nil, + # customer_id: nil, + # external_customer_id: nil, + # limit: nil, + # status: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :ended + # # ... + # in :upcoming + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/orb/models/subscription_price_intervals_params.rb b/lib/orb/models/subscription_price_intervals_params.rb new file mode 100644 index 00000000..7a7d83a6 --- /dev/null +++ b/lib/orb/models/subscription_price_intervals_params.rb @@ -0,0 +1,10323 @@ +# frozen_string_literal: true + +module Orb + module Models + class SubscriptionPriceIntervalsParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute [r] add + # A list of price intervals to add to the subscription. + # + # @return [Array, nil] + optional :add, -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Add] } + + # @!parse + # # @return [Array] + # attr_writer :add + + # @!attribute [r] add_adjustments + # A list of adjustments to add to the subscription. + # + # @return [Array, nil] + optional :add_adjustments, + -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment] } + + # @!parse + # # @return [Array] + # attr_writer :add_adjustments + + # @!attribute [r] edit + # A list of price intervals to edit on the subscription. + # + # @return [Array, nil] + optional :edit, -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Edit] } + + # @!parse + # # @return [Array] + # attr_writer :edit + + # @!attribute [r] edit_adjustments + # A list of adjustments to edit on the subscription. + # + # @return [Array, nil] + optional :edit_adjustments, + -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment] } + + # @!parse + # # @return [Array] + # attr_writer :edit_adjustments + + # @!parse + # # @param add [Array] + # # @param add_adjustments [Array] + # # @param edit [Array] + # # @param edit_adjustments [Array] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(add: nil, add_adjustments: nil, edit: nil, edit_adjustments: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # add => { + # start_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::StartDate, + # allocation_price: Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice, + # discounts: -> { Orb::ArrayOf[union: Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount] === _1 }, + # end_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::EndDate, + # external_price_id: String, + # **_ + # } + # ``` + class Add < Orb::BaseModel + # @!attribute start_date + # The start date of the price interval. This is the date that the price will start + # billing on the subscription. + # + # @return [Time, Symbol, Orb::Models::BillingCycleRelativeDate] + required :start_date, union: -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::StartDate } + + # @!attribute allocation_price + # The definition of a new allocation price to create and add to the subscription. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice, nil] + optional :allocation_price, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice }, + nil?: true + + # @!attribute discounts + # A list of discounts to initialize on the price interval. + # + # @return [Array, nil] + optional :discounts, + -> { Orb::ArrayOf[union: Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount] }, + nil?: true + + # @!attribute end_date + # The end date of the price interval. This is the date that the price will stop + # billing on the subscription. + # + # @return [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] + optional :end_date, + union: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::EndDate + }, + nil?: true + + # @!attribute external_price_id + # The external price id of the price to add to the subscription. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_fee_quantity_transitions + # A list of fixed fee quantity transitions to initialize on the price interval. + # + # @return [Array, nil] + optional :fixed_fee_quantity_transitions, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Add::FixedFeeQuantityTransition] + }, + nil?: true + + # @!attribute maximum_amount + # The maximum amount that will be billed for this price interval for a given + # billing period. + # + # @return [Float, nil] + optional :maximum_amount, Float, nil?: true + + # @!attribute minimum_amount + # The minimum amount that will be billed for this price interval for a given + # billing period. + # + # @return [Float, nil] + optional :minimum_amount, Float, nil?: true + + # @!attribute price + # The definition of a new price to create and add to the subscription. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice, nil] + optional :price, union: -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price }, nil?: true + + # @!attribute price_id + # The id of the price to add to the subscription. + # + # @return [String, nil] + optional :price_id, String, nil?: true + + # @!parse + # # @param start_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate] + # # @param allocation_price [Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice, nil] + # # @param discounts [Array, nil] + # # @param end_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] + # # @param external_price_id [String, nil] + # # @param fixed_fee_quantity_transitions [Array, nil] + # # @param maximum_amount [Float, nil] + # # @param minimum_amount [Float, nil] + # # @param price [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice, nil] + # # @param price_id [String, nil] + # # + # def initialize( + # start_date:, + # allocation_price: nil, + # discounts: nil, + # end_date: nil, + # external_price_id: nil, + # fixed_fee_quantity_transitions: nil, + # maximum_amount: nil, + # minimum_amount: nil, + # price: nil, + # price_id: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The start date of the price interval. This is the date that the price will start + # billing on the subscription. + # + # @example + # ```ruby + # case start_date + # in Time + # # ... + # in Orb::Models::BillingCycleRelativeDate + # # ... + # end + # ``` + class StartDate < Orb::Union + variant Time + + variant enum: -> { Orb::Models::BillingCycleRelativeDate } + end + + # @example + # ```ruby + # allocation_price => { + # amount: String, + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice::Cadence, + # currency: String, + # expires_at_end_of_cadence: Orb::BooleanModel + # } + # ``` + class AllocationPrice < Orb::BaseModel + # @!attribute amount + # An amount of the currency to allocate to the customer at the specified cadence. + # + # @return [String] + required :amount, String + + # @!attribute cadence + # The cadence at which to allocate the amount to the customer. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice::Cadence] + required :cadence, + enum: -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice::Cadence } + + # @!attribute currency + # An ISO 4217 currency string or a custom pricing unit identifier in which to bill + # this price. + # + # @return [String] + required :currency, String + + # @!attribute expires_at_end_of_cadence + # Whether the allocated amount should expire at the end of the cadence or roll + # over to the next period. + # + # @return [Boolean] + required :expires_at_end_of_cadence, Orb::BooleanModel + + # @!parse + # # The definition of a new allocation price to create and add to the subscription. + # # + # # @param amount [String] + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice::Cadence] + # # @param currency [String] + # # @param expires_at_end_of_cadence [Boolean] + # # + # def initialize(amount:, cadence:, currency:, expires_at_end_of_cadence:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence at which to allocate the amount to the customer. + # + # @example + # ```ruby + # case cadence + # in :one_time + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :semi_annual + # # ... + # in :annual + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case discount + # in {discount_type: "amount", amount_discount: Float} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::AmountDiscountCreationParams ... + # in {discount_type: "percentage", percentage_discount: Float} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::PercentageDiscountCreationParams ... + # in {discount_type: "usage", usage_discount: Float} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::UsageDiscountCreationParams ... + # end + # ``` + # + # @example + # ```ruby + # case discount + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::AmountDiscountCreationParams + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::PercentageDiscountCreationParams + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::UsageDiscountCreationParams + # # ... + # end + # ``` + class Discount < Orb::Union + discriminator :discount_type + + variant :amount, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::AmountDiscountCreationParams } + + variant :percentage, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::PercentageDiscountCreationParams } + + variant :usage, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::UsageDiscountCreationParams } + + # @example + # ```ruby + # amount_discount_creation_params => { + # amount_discount: Float, + # discount_type: :amount + # } + # ``` + class AmountDiscountCreationParams < Orb::BaseModel + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [Float] + required :amount_discount, Float + + # @!attribute discount_type + # + # @return [Symbol, :amount] + required :discount_type, const: :amount + + # @!parse + # # @param amount_discount [Float] + # # @param discount_type [Symbol, :amount] + # # + # def initialize(amount_discount:, discount_type: :amount, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_creation_params => { + # discount_type: :percentage, + # percentage_discount: Float + # } + # ``` + class PercentageDiscountCreationParams < Orb::BaseModel + # @!attribute discount_type + # + # @return [Symbol, :percentage] + required :discount_type, const: :percentage + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`. This is a number between 0 + # and 1. + # + # @return [Float] + required :percentage_discount, Float + + # @!parse + # # @param percentage_discount [Float] + # # @param discount_type [Symbol, :percentage] + # # + # def initialize(percentage_discount:, discount_type: :percentage, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_creation_params => { + # discount_type: :usage, + # usage_discount: Float + # } + # ``` + class UsageDiscountCreationParams < Orb::BaseModel + # @!attribute discount_type + # + # @return [Symbol, :usage] + required :discount_type, const: :usage + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for. + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param usage_discount [Float] + # # @param discount_type [Symbol, :usage] + # # + # def initialize(usage_discount:, discount_type: :usage, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @abstract + # + # The end date of the price interval. This is the date that the price will stop + # billing on the subscription. + # + # @example + # ```ruby + # case end_date + # in Time + # # ... + # in Orb::Models::BillingCycleRelativeDate + # # ... + # end + # ``` + class EndDate < Orb::Union + variant Time + + variant enum: -> { Orb::Models::BillingCycleRelativeDate } + end + + # @example + # ```ruby + # fixed_fee_quantity_transition => { + # effective_date: Time, + # quantity: Integer + # } + # ``` + class FixedFeeQuantityTransition < Orb::BaseModel + # @!attribute effective_date + # The date that the fixed fee quantity transition should take effect. + # + # @return [Time] + required :effective_date, Time + + # @!attribute quantity + # The quantity of the fixed fee quantity transition. + # + # @return [Integer] + required :quantity, Integer + + # @!parse + # # @param effective_date [Time] + # # @param quantity [Integer] + # # + # def initialize(effective_date:, quantity:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # The definition of a new price to create and add to the subscription. + # + # @example + # ```ruby + # case price + # in {model_type: "unit", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice ... + # in {model_type: "package", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice ... + # in {model_type: "matrix", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice ... + # in {model_type: "matrix_with_allocation", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice ... + # in {model_type: "tiered", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice ... + # in {model_type: "tiered_bps", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice ... + # in {model_type: "bps", bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BpsConfig, cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::Cadence, currency: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice ... + # in {model_type: "bulk_bps", bulk_bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig, cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::Cadence, currency: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice ... + # in {model_type: "bulk", bulk_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig, cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::Cadence, currency: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice ... + # in {model_type: "threshold_total_amount", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice ... + # in {model_type: "tiered_package", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice ... + # in {model_type: "grouped_tiered", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::Cadence, currency: String, grouped_tiered_config: -> { Orb::HashOf[Orb::Unknown] === _1 }} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice ... + # in {model_type: "max_group_tiered_package", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice ... + # in {model_type: "tiered_with_minimum", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice ... + # in {model_type: "package_with_allocation", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice ... + # in {model_type: "tiered_package_with_minimum", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice ... + # in {model_type: "unit_with_percent", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice ... + # in {model_type: "tiered_with_proration", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice ... + # in {model_type: "unit_with_proration", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice ... + # in {model_type: "grouped_allocation", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::Cadence, currency: String, grouped_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice ... + # in {model_type: "grouped_with_prorated_minimum", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::Cadence, currency: String, grouped_with_prorated_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice ... + # in {model_type: "grouped_with_metered_minimum", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::Cadence, currency: String, grouped_with_metered_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice ... + # in {model_type: "matrix_with_display_name", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice ... + # in {model_type: "bulk_with_proration", bulk_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::Cadence, currency: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice ... + # in {model_type: "grouped_tiered_package", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::Cadence, currency: String, grouped_tiered_package_config: -> { Orb::HashOf[Orb::Unknown] === _1 }} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice ... + # in {model_type: "scalable_matrix_with_unit_pricing", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice ... + # in {model_type: "scalable_matrix_with_tiered_pricing", cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::Cadence, currency: String, item_id: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice ... + # end + # ``` + # + # @example + # ```ruby + # case price + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice + # # ... + # end + # ``` + class Price < Orb::Union + discriminator :model_type + + variant :unit, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice + } + + variant :package, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice } + + variant :matrix, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice + } + + variant :matrix_with_allocation, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice } + + variant :tiered, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice + } + + variant :tiered_bps, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice } + + variant :bps, -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice } + + variant :bulk_bps, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice } + + variant :bulk, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice + } + + variant :threshold_total_amount, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice } + + variant :tiered_package, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice } + + variant :grouped_tiered, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice } + + variant :max_group_tiered_package, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice } + + variant :tiered_with_minimum, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice } + + variant :package_with_allocation, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice } + + variant :tiered_package_with_minimum, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice } + + variant :unit_with_percent, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice } + + variant :tiered_with_proration, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice } + + variant :unit_with_proration, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice } + + variant :grouped_allocation, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice } + + variant :grouped_with_prorated_minimum, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice } + + variant :grouped_with_metered_minimum, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice } + + variant :matrix_with_display_name, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice } + + variant :bulk_with_proration, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice } + + variant :grouped_tiered_package, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice } + + variant :scalable_matrix_with_unit_pricing, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice } + + variant :scalable_matrix_with_tiered_pricing, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice } + + # @example + # ```ruby + # new_floating_unit_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :unit, + # name: String, + # **_ + # } + # ``` + class NewFloatingUnitPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit] + required :model_type, const: :unit + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_config + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::UnitConfig] + required :unit_config, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::UnitConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param unit_config [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::UnitConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :unit] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # name:, + # unit_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :unit, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # unit_config => { + # unit_amount: String + # } + # ``` + class UnitConfig < Orb::BaseModel + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param unit_amount [String] + # # + # def initialize(unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_package_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :package, + # name: String, + # **_ + # } + # ``` + class NewFloatingPackagePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :package] + required :model_type, const: :package + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute package_config + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::PackageConfig] + required :package_config, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::PackageConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param package_config [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::PackageConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :package] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # name:, + # package_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # package_config => { + # package_amount: String, + # package_size: Integer + # } + # ``` + class PackageConfig < Orb::BaseModel + # @!attribute package_amount + # A currency amount to rate usage by + # + # @return [String] + required :package_amount, String + + # @!attribute package_size + # An integer amount to represent package size. For example, 1000 here would divide + # usage by 1000 before multiplying by package_amount in rating + # + # @return [Integer] + required :package_size, Integer + + # @!parse + # # @param package_amount [String] + # # @param package_size [Integer] + # # + # def initialize(package_amount:, package_size:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_matrix_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::Cadence, + # currency: String, + # item_id: String, + # matrix_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig, + # model_type: :matrix, + # **_ + # } + # ``` + class NewFloatingMatrixPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute matrix_config + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig] + required :matrix_config, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig } + + # @!attribute model_type + # + # @return [Symbol, :matrix] + required :model_type, const: :matrix + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param matrix_config [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :matrix] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # matrix_config:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :matrix, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # matrix_config => { + # default_unit_amount: String, + # dimensions: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # matrix_values: -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig::MatrixValue] === _1 } + # } + # ``` + class MatrixConfig < Orb::BaseModel + # @!attribute default_unit_amount + # Default per unit rate for any usage not bucketed into a specified matrix_value + # + # @return [String] + required :default_unit_amount, String + + # @!attribute dimensions + # One or two event property values to evaluate matrix groups by + # + # @return [Array] + required :dimensions, Orb::ArrayOf[String, nil?: true] + + # @!attribute matrix_values + # Matrix values for specified matrix grouping keys + # + # @return [Array] + required :matrix_values, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig::MatrixValue] + } + + # @!parse + # # @param default_unit_amount [String] + # # @param dimensions [Array] + # # @param matrix_values [Array] + # # + # def initialize(default_unit_amount:, dimensions:, matrix_values:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # matrix_value => { + # dimension_values: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # unit_amount: String + # } + # ``` + class MatrixValue < Orb::BaseModel + # @!attribute dimension_values + # One or two matrix keys to filter usage to this Matrix value by. For example, + # ["region", "tier"] could be used to filter cloud usage by a cloud region and an + # instance tier. + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String, nil?: true] + + # @!attribute unit_amount + # Unit price for the specified dimension_values + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param dimension_values [Array] + # # @param unit_amount [String] + # # + # def initialize(dimension_values:, unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_matrix_with_allocation_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::Cadence, + # currency: String, + # item_id: String, + # matrix_with_allocation_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig, + # model_type: :matrix_with_allocation, + # **_ + # } + # ``` + class NewFloatingMatrixWithAllocationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute matrix_with_allocation_config + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig] + required :matrix_with_allocation_config, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig } + + # @!attribute model_type + # + # @return [Symbol, :matrix_with_allocation] + required :model_type, const: :matrix_with_allocation + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param matrix_with_allocation_config [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :matrix_with_allocation] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # matrix_with_allocation_config:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :matrix_with_allocation, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # matrix_with_allocation_config => { + # allocation: Float, + # default_unit_amount: String, + # dimensions: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # matrix_values: -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue] === _1 } + # } + # ``` + class MatrixWithAllocationConfig < Orb::BaseModel + # @!attribute allocation + # Allocation to be used to calculate the price + # + # @return [Float] + required :allocation, Float + + # @!attribute default_unit_amount + # Default per unit rate for any usage not bucketed into a specified matrix_value + # + # @return [String] + required :default_unit_amount, String + + # @!attribute dimensions + # One or two event property values to evaluate matrix groups by + # + # @return [Array] + required :dimensions, Orb::ArrayOf[String, nil?: true] + + # @!attribute matrix_values + # Matrix values for specified matrix grouping keys + # + # @return [Array] + required :matrix_values, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue] + } + + # @!parse + # # @param allocation [Float] + # # @param default_unit_amount [String] + # # @param dimensions [Array] + # # @param matrix_values [Array] + # # + # def initialize(allocation:, default_unit_amount:, dimensions:, matrix_values:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # matrix_value => { + # dimension_values: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # unit_amount: String + # } + # ``` + class MatrixValue < Orb::BaseModel + # @!attribute dimension_values + # One or two matrix keys to filter usage to this Matrix value by. For example, + # ["region", "tier"] could be used to filter cloud usage by a cloud region and an + # instance tier. + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String, nil?: true] + + # @!attribute unit_amount + # Unit price for the specified dimension_values + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param dimension_values [Array] + # # @param unit_amount [String] + # # + # def initialize(dimension_values:, unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_tiered_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :tiered, + # name: String, + # **_ + # } + # ``` + class NewFloatingTieredPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered] + required :model_type, const: :tiered + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_config + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig] + required :tiered_config, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_config [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :tiered] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # name:, + # tiered_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :tiered, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # tiered_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig::Tier] === _1 } + # } + # ``` + class TieredConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # first_unit: Float, + # unit_amount: String, + # last_unit: Float + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute first_unit + # Inclusive tier starting value + # + # @return [Float] + required :first_unit, Float + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute last_unit + # Exclusive tier ending value. If null, this is treated as the last tier + # + # @return [Float, nil] + optional :last_unit, Float, nil?: true + + # @!parse + # # @param first_unit [Float] + # # @param unit_amount [String] + # # @param last_unit [Float, nil] + # # + # def initialize(first_unit:, unit_amount:, last_unit: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_tiered_bps_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :tiered_bps, + # name: String, + # **_ + # } + # ``` + class NewFloatingTieredBpsPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_bps] + required :model_type, const: :tiered_bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_bps_config + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig] + required :tiered_bps_config, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_bps_config [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :tiered_bps] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # name:, + # tiered_bps_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :tiered_bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # tiered_bps_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig::Tier] === _1 } + # } + # ``` + class TieredBpsConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + # tiers + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # bps: Float, + # minimum_amount: String, + # maximum_amount: String, + # per_unit_maximum: String + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute bps + # Per-event basis point rate + # + # @return [Float] + required :bps, Float + + # @!attribute minimum_amount + # Inclusive tier starting value + # + # @return [String] + required :minimum_amount, String + + # @!attribute maximum_amount + # Exclusive tier ending value + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute per_unit_maximum + # Per unit maximum to charge + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param minimum_amount [String] + # # @param maximum_amount [String, nil] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_bps_price => { + # bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BpsConfig, + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :bps, + # **_ + # } + # ``` + class NewFloatingBpsPrice < Orb::BaseModel + # @!attribute bps_config + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BpsConfig] + required :bps_config, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BpsConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bps] + required :model_type, const: :bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param bps_config [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BpsConfig] + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :bps] + # # + # def initialize( + # bps_config:, + # cadence:, + # currency:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bps_config => { + # bps: Float, + # per_unit_maximum: String + # } + # ``` + class BpsConfig < Orb::BaseModel + # @!attribute bps + # Basis point take rate per event + # + # @return [Float] + required :bps, Float + + # @!attribute per_unit_maximum + # Optional currency amount maximum to cap spend per event + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_bulk_bps_price => { + # bulk_bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig, + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :bulk_bps, + # **_ + # } + # ``` + class NewFloatingBulkBpsPrice < Orb::BaseModel + # @!attribute bulk_bps_config + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig] + required :bulk_bps_config, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk_bps] + required :model_type, const: :bulk_bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param bulk_bps_config [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig] + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :bulk_bps] + # # + # def initialize( + # bulk_bps_config:, + # cadence:, + # currency:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :bulk_bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bulk_bps_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig::Tier] === _1 } + # } + # ``` + class BulkBpsConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for a bulk BPS pricing model where all usage is aggregated to a single + # tier based on total volume + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # bps: Float, + # maximum_amount: String, + # per_unit_maximum: String + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute bps + # Basis points to rate on + # + # @return [Float] + required :bps, Float + + # @!attribute maximum_amount + # Upper bound for tier + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute per_unit_maximum + # The maximum amount to charge for any one event + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param maximum_amount [String, nil] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, maximum_amount: nil, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_bulk_price => { + # bulk_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig, + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :bulk, + # **_ + # } + # ``` + class NewFloatingBulkPrice < Orb::BaseModel + # @!attribute bulk_config + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig] + required :bulk_config, + -> { Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk] + required :model_type, const: :bulk + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param bulk_config [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig] + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :bulk] + # # + # def initialize( + # bulk_config:, + # cadence:, + # currency:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :bulk, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bulk_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig::Tier] === _1 } + # } + # ``` + class BulkConfig < Orb::BaseModel + # @!attribute tiers + # Bulk tiers for rating based on total usage volume + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # unit_amount: String, + # maximum_units: Float + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute maximum_units + # Upper bound for this tier + # + # @return [Float, nil] + optional :maximum_units, Float, nil?: true + + # @!parse + # # @param unit_amount [String] + # # @param maximum_units [Float, nil] + # # + # def initialize(unit_amount:, maximum_units: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_threshold_total_amount_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :threshold_total_amount, + # name: String, + # **_ + # } + # ``` + class NewFloatingThresholdTotalAmountPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :threshold_total_amount] + required :model_type, const: :threshold_total_amount + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute threshold_total_amount_config + # + # @return [Hash{Symbol=>Object}] + required :threshold_total_amount_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param threshold_total_amount_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :threshold_total_amount] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # name:, + # threshold_total_amount_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :threshold_total_amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_tiered_package_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :tiered_package, + # name: String, + # **_ + # } + # ``` + class NewFloatingTieredPackagePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_package] + required :model_type, const: :tiered_package + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_package_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_package_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_package_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :tiered_package] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # name:, + # tiered_package_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :tiered_package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_grouped_tiered_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::Cadence, + # currency: String, + # grouped_tiered_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_tiered, + # **_ + # } + # ``` + class NewFloatingGroupedTieredPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute grouped_tiered_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_tiered_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_tiered] + required :model_type, const: :grouped_tiered + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::Cadence] + # # @param currency [String] + # # @param grouped_tiered_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :grouped_tiered] + # # + # def initialize( + # cadence:, + # currency:, + # grouped_tiered_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :grouped_tiered, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_max_group_tiered_package_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::Cadence, + # currency: String, + # item_id: String, + # max_group_tiered_package_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # model_type: :max_group_tiered_package, + # **_ + # } + # ``` + class NewFloatingMaxGroupTieredPackagePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute max_group_tiered_package_config + # + # @return [Hash{Symbol=>Object}] + required :max_group_tiered_package_config, Orb::HashOf[Orb::Unknown] + + # @!attribute model_type + # + # @return [Symbol, :max_group_tiered_package] + required :model_type, const: :max_group_tiered_package + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param max_group_tiered_package_config [Hash{Symbol=>Object}] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :max_group_tiered_package] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # max_group_tiered_package_config:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :max_group_tiered_package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_tiered_with_minimum_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :tiered_with_minimum, + # name: String, + # **_ + # } + # ``` + class NewFloatingTieredWithMinimumPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_with_minimum] + required :model_type, const: :tiered_with_minimum + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_with_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_with_minimum_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :tiered_with_minimum] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # name:, + # tiered_with_minimum_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :tiered_with_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_package_with_allocation_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :package_with_allocation, + # name: String, + # **_ + # } + # ``` + class NewFloatingPackageWithAllocationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :package_with_allocation] + required :model_type, const: :package_with_allocation + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute package_with_allocation_config + # + # @return [Hash{Symbol=>Object}] + required :package_with_allocation_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param package_with_allocation_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :package_with_allocation] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # name:, + # package_with_allocation_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :package_with_allocation, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_tiered_package_with_minimum_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :tiered_package_with_minimum, + # name: String, + # **_ + # } + # ``` + class NewFloatingTieredPackageWithMinimumPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_package_with_minimum] + required :model_type, const: :tiered_package_with_minimum + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_package_with_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_package_with_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_package_with_minimum_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :tiered_package_with_minimum] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # name:, + # tiered_package_with_minimum_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :tiered_package_with_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_unit_with_percent_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :unit_with_percent, + # name: String, + # **_ + # } + # ``` + class NewFloatingUnitWithPercentPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit_with_percent] + required :model_type, const: :unit_with_percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_with_percent_config + # + # @return [Hash{Symbol=>Object}] + required :unit_with_percent_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param unit_with_percent_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :unit_with_percent] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # name:, + # unit_with_percent_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :unit_with_percent, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_tiered_with_proration_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :tiered_with_proration, + # name: String, + # **_ + # } + # ``` + class NewFloatingTieredWithProrationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_with_proration_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :tiered_with_proration] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # name:, + # tiered_with_proration_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :tiered_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_unit_with_proration_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :unit_with_proration, + # name: String, + # **_ + # } + # ``` + class NewFloatingUnitWithProrationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit_with_proration] + required :model_type, const: :unit_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :unit_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param unit_with_proration_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :unit_with_proration] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # name:, + # unit_with_proration_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :unit_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_grouped_allocation_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::Cadence, + # currency: String, + # grouped_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_allocation, + # **_ + # } + # ``` + class NewFloatingGroupedAllocationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute grouped_allocation_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_allocation_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_allocation] + required :model_type, const: :grouped_allocation + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::Cadence] + # # @param currency [String] + # # @param grouped_allocation_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :grouped_allocation] + # # + # def initialize( + # cadence:, + # currency:, + # grouped_allocation_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :grouped_allocation, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_grouped_with_prorated_minimum_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::Cadence, + # currency: String, + # grouped_with_prorated_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_with_prorated_minimum, + # **_ + # } + # ``` + class NewFloatingGroupedWithProratedMinimumPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute grouped_with_prorated_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_with_prorated_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_with_prorated_minimum] + required :model_type, const: :grouped_with_prorated_minimum + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::Cadence] + # # @param currency [String] + # # @param grouped_with_prorated_minimum_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :grouped_with_prorated_minimum] + # # + # def initialize( + # cadence:, + # currency:, + # grouped_with_prorated_minimum_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :grouped_with_prorated_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_grouped_with_metered_minimum_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::Cadence, + # currency: String, + # grouped_with_metered_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_with_metered_minimum, + # **_ + # } + # ``` + class NewFloatingGroupedWithMeteredMinimumPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute grouped_with_metered_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_with_metered_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_with_metered_minimum] + required :model_type, const: :grouped_with_metered_minimum + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::Cadence] + # # @param currency [String] + # # @param grouped_with_metered_minimum_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :grouped_with_metered_minimum] + # # + # def initialize( + # cadence:, + # currency:, + # grouped_with_metered_minimum_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :grouped_with_metered_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_matrix_with_display_name_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::Cadence, + # currency: String, + # item_id: String, + # matrix_with_display_name_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # model_type: :matrix_with_display_name, + # **_ + # } + # ``` + class NewFloatingMatrixWithDisplayNamePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute matrix_with_display_name_config + # + # @return [Hash{Symbol=>Object}] + required :matrix_with_display_name_config, Orb::HashOf[Orb::Unknown] + + # @!attribute model_type + # + # @return [Symbol, :matrix_with_display_name] + required :model_type, const: :matrix_with_display_name + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param matrix_with_display_name_config [Hash{Symbol=>Object}] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :matrix_with_display_name] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # matrix_with_display_name_config:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :matrix_with_display_name, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_bulk_with_proration_price => { + # bulk_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :bulk_with_proration, + # **_ + # } + # ``` + class NewFloatingBulkWithProrationPrice < Orb::BaseModel + # @!attribute bulk_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :bulk_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk_with_proration] + required :model_type, const: :bulk_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param bulk_with_proration_config [Hash{Symbol=>Object}] + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :bulk_with_proration] + # # + # def initialize( + # bulk_with_proration_config:, + # cadence:, + # currency:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :bulk_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_grouped_tiered_package_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::Cadence, + # currency: String, + # grouped_tiered_package_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_tiered_package, + # **_ + # } + # ``` + class NewFloatingGroupedTieredPackagePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute grouped_tiered_package_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_tiered_package_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_tiered_package] + required :model_type, const: :grouped_tiered_package + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::Cadence] + # # @param currency [String] + # # @param grouped_tiered_package_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :grouped_tiered_package] + # # + # def initialize( + # cadence:, + # currency:, + # grouped_tiered_package_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :grouped_tiered_package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_scalable_matrix_with_unit_pricing_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :scalable_matrix_with_unit_pricing, + # name: String, + # **_ + # } + # ``` + class NewFloatingScalableMatrixWithUnitPricingPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :scalable_matrix_with_unit_pricing] + required :model_type, const: :scalable_matrix_with_unit_pricing + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute scalable_matrix_with_unit_pricing_config + # + # @return [Hash{Symbol=>Object}] + required :scalable_matrix_with_unit_pricing_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param scalable_matrix_with_unit_pricing_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :scalable_matrix_with_unit_pricing] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # name:, + # scalable_matrix_with_unit_pricing_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :scalable_matrix_with_unit_pricing, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_floating_scalable_matrix_with_tiered_pricing_price => { + # cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::Cadence, + # currency: String, + # item_id: String, + # model_type: :scalable_matrix_with_tiered_pricing, + # name: String, + # **_ + # } + # ``` + class NewFloatingScalableMatrixWithTieredPricingPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::Cadence + } + + # @!attribute currency + # An ISO 4217 currency string for which this price is billed in. + # + # @return [String] + required :currency, String + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :scalable_matrix_with_tiered_pricing] + required :model_type, const: :scalable_matrix_with_tiered_pricing + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute scalable_matrix_with_tiered_pricing_config + # + # @return [Hash{Symbol=>Object}] + required :scalable_matrix_with_tiered_pricing_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::Cadence] + # # @param currency [String] + # # @param item_id [String] + # # @param name [String] + # # @param scalable_matrix_with_tiered_pricing_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param model_type [Symbol, :scalable_matrix_with_tiered_pricing] + # # + # def initialize( + # cadence:, + # currency:, + # item_id:, + # name:, + # scalable_matrix_with_tiered_pricing_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # model_type: :scalable_matrix_with_tiered_pricing, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end + + # @example + # ```ruby + # add_adjustment => { + # adjustment: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment, + # start_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::StartDate, + # end_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::EndDate + # } + # ``` + class AddAdjustment < Orb::BaseModel + # @!attribute adjustment + # The definition of a new adjustment to create and add to the subscription. + # + # @return [Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewPercentageDiscount, Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewUsageDiscount, Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewAmountDiscount, Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMinimum, Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMaximum] + required :adjustment, + union: -> { Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment } + + # @!attribute start_date + # The start date of the adjustment interval. This is the date that the adjustment + # will start affecting prices on the subscription. + # + # @return [Time, Symbol, Orb::Models::BillingCycleRelativeDate] + required :start_date, + union: -> { Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::StartDate } + + # @!attribute end_date + # The end date of the adjustment interval. This is the date that the adjustment + # will stop affecting prices on the subscription. + # + # @return [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] + optional :end_date, + union: -> { Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::EndDate }, + nil?: true + + # @!parse + # # @param adjustment [Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewPercentageDiscount, Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewUsageDiscount, Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewAmountDiscount, Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMinimum, Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMaximum] + # # @param start_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate] + # # @param end_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] + # # + # def initialize(adjustment:, start_date:, end_date: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The definition of a new adjustment to create and add to the subscription. + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "percentage_discount", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, percentage_discount: Float, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewPercentageDiscount ... + # in {adjustment_type: "usage_discount", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, usage_discount: Float, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewUsageDiscount ... + # in {adjustment_type: "amount_discount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewAmountDiscount ... + # in {adjustment_type: "minimum", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, item_id: String, minimum_amount: String} + # # Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMinimum ... + # in {adjustment_type: "maximum", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, maximum_amount: String, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMaximum ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewPercentageDiscount + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewUsageDiscount + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewAmountDiscount + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMinimum + # # ... + # in Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMaximum + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :percentage_discount, + -> { Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewPercentageDiscount } + + variant :usage_discount, + -> { Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewUsageDiscount } + + variant :amount_discount, + -> { Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewAmountDiscount } + + variant :minimum, + -> { Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMinimum } + + variant :maximum, + -> { Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMaximum } + + # @example + # ```ruby + # new_percentage_discount => { + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # percentage_discount: Float, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewPercentageDiscount < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute percentage_discount + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param percentage_discount [Float] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # applies_to_price_ids:, + # percentage_discount:, + # is_invoice_level: nil, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_usage_discount => { + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # usage_discount: Float, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewUsageDiscount < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute usage_discount + # + # @return [Float] + required :usage_discount, Float + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param usage_discount [Float] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize(applies_to_price_ids:, usage_discount:, is_invoice_level: nil, adjustment_type: :usage_discount, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_amount_discount => { + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewAmountDiscount < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize(amount_discount:, applies_to_price_ids:, is_invoice_level: nil, adjustment_type: :amount_discount, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_minimum => { + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # item_id: String, + # minimum_amount: String, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewMinimum < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # + # @return [String] + required :minimum_amount, String + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize(applies_to_price_ids:, item_id:, minimum_amount:, is_invoice_level: nil, adjustment_type: :minimum, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_maximum => { + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewMaximum < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # + # @return [String] + required :maximum_amount, String + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, is_invoice_level: nil, adjustment_type: :maximum, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @abstract + # + # The start date of the adjustment interval. This is the date that the adjustment + # will start affecting prices on the subscription. + # + # @example + # ```ruby + # case start_date + # in Time + # # ... + # in Orb::Models::BillingCycleRelativeDate + # # ... + # end + # ``` + class StartDate < Orb::Union + variant Time + + variant enum: -> { Orb::Models::BillingCycleRelativeDate } + end + + # @abstract + # + # The end date of the adjustment interval. This is the date that the adjustment + # will stop affecting prices on the subscription. + # + # @example + # ```ruby + # case end_date + # in Time + # # ... + # in Orb::Models::BillingCycleRelativeDate + # # ... + # end + # ``` + class EndDate < Orb::Union + variant Time + + variant enum: -> { Orb::Models::BillingCycleRelativeDate } + end + end + + # @example + # ```ruby + # edit => { + # price_interval_id: String, + # billing_cycle_day: Integer, + # end_date: Orb::Models::SubscriptionPriceIntervalsParams::Edit::EndDate, + # fixed_fee_quantity_transitions: -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Edit::FixedFeeQuantityTransition] === _1 }, + # start_date: Orb::Models::SubscriptionPriceIntervalsParams::Edit::StartDate + # } + # ``` + class Edit < Orb::BaseModel + # @!attribute price_interval_id + # The id of the price interval to edit. + # + # @return [String] + required :price_interval_id, String + + # @!attribute billing_cycle_day + # The updated billing cycle day for this price interval. If not specified, the + # billing cycle day will not be updated. Note that overlapping price intervals + # must have the same billing cycle day. + # + # @return [Integer, nil] + optional :billing_cycle_day, Integer, nil?: true + + # @!attribute end_date + # The updated end date of this price interval. If not specified, the start date + # will not be updated. + # + # @return [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] + optional :end_date, + union: -> { + Orb::Models::SubscriptionPriceIntervalsParams::Edit::EndDate + }, + nil?: true + + # @!attribute fixed_fee_quantity_transitions + # A list of fixed fee quantity transitions to use for this price interval. Note + # that this list will overwrite all existing fixed fee quantity transitions on the + # price interval. + # + # @return [Array, nil] + optional :fixed_fee_quantity_transitions, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsParams::Edit::FixedFeeQuantityTransition] + }, + nil?: true + + # @!attribute [r] start_date + # The updated start date of this price interval. If not specified, the start date + # will not be updated. + # + # @return [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] + optional :start_date, union: -> { Orb::Models::SubscriptionPriceIntervalsParams::Edit::StartDate } + + # @!parse + # # @return [Time, Symbol, Orb::Models::BillingCycleRelativeDate] + # attr_writer :start_date + + # @!parse + # # @param price_interval_id [String] + # # @param billing_cycle_day [Integer, nil] + # # @param end_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] + # # @param fixed_fee_quantity_transitions [Array, nil] + # # @param start_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate] + # # + # def initialize( + # price_interval_id:, + # billing_cycle_day: nil, + # end_date: nil, + # fixed_fee_quantity_transitions: nil, + # start_date: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The updated end date of this price interval. If not specified, the start date + # will not be updated. + # + # @example + # ```ruby + # case end_date + # in Time + # # ... + # in Orb::Models::BillingCycleRelativeDate + # # ... + # end + # ``` + class EndDate < Orb::Union + variant Time + + variant enum: -> { Orb::Models::BillingCycleRelativeDate } + end + + # @example + # ```ruby + # fixed_fee_quantity_transition => { + # effective_date: Time, + # quantity: Integer + # } + # ``` + class FixedFeeQuantityTransition < Orb::BaseModel + # @!attribute effective_date + # The date that the fixed fee quantity transition should take effect. + # + # @return [Time] + required :effective_date, Time + + # @!attribute quantity + # The quantity of the fixed fee quantity transition. + # + # @return [Integer] + required :quantity, Integer + + # @!parse + # # @param effective_date [Time] + # # @param quantity [Integer] + # # + # def initialize(effective_date:, quantity:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # The updated start date of this price interval. If not specified, the start date + # will not be updated. + # + # @example + # ```ruby + # case start_date + # in Time + # # ... + # in Orb::Models::BillingCycleRelativeDate + # # ... + # end + # ``` + class StartDate < Orb::Union + variant Time + + variant enum: -> { Orb::Models::BillingCycleRelativeDate } + end + end + + # @example + # ```ruby + # edit_adjustment => { + # adjustment_interval_id: String, + # end_date: Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::EndDate, + # start_date: Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::StartDate + # } + # ``` + class EditAdjustment < Orb::BaseModel + # @!attribute adjustment_interval_id + # The id of the adjustment interval to edit. + # + # @return [String] + required :adjustment_interval_id, String + + # @!attribute end_date + # The updated end date of this adjustment interval. If not specified, the start + # date will not be updated. + # + # @return [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] + optional :end_date, + union: -> { Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::EndDate }, + nil?: true + + # @!attribute [r] start_date + # The updated start date of this adjustment interval. If not specified, the start + # date will not be updated. + # + # @return [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] + optional :start_date, + union: -> { Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::StartDate } + + # @!parse + # # @return [Time, Symbol, Orb::Models::BillingCycleRelativeDate] + # attr_writer :start_date + + # @!parse + # # @param adjustment_interval_id [String] + # # @param end_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] + # # @param start_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate] + # # + # def initialize(adjustment_interval_id:, end_date: nil, start_date: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The updated end date of this adjustment interval. If not specified, the start + # date will not be updated. + # + # @example + # ```ruby + # case end_date + # in Time + # # ... + # in Orb::Models::BillingCycleRelativeDate + # # ... + # end + # ``` + class EndDate < Orb::Union + variant Time + + variant enum: -> { Orb::Models::BillingCycleRelativeDate } + end + + # @abstract + # + # The updated start date of this adjustment interval. If not specified, the start + # date will not be updated. + # + # @example + # ```ruby + # case start_date + # in Time + # # ... + # in Orb::Models::BillingCycleRelativeDate + # # ... + # end + # ``` + class StartDate < Orb::Union + variant Time + + variant enum: -> { Orb::Models::BillingCycleRelativeDate } + end + end + end + end +end diff --git a/lib/orb/models/subscription_price_intervals_response.rb b/lib/orb/models/subscription_price_intervals_response.rb new file mode 100644 index 00000000..c457beef --- /dev/null +++ b/lib/orb/models/subscription_price_intervals_response.rb @@ -0,0 +1,1436 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # subscription_price_intervals_response => { + # id: String, + # active_plan_phase_order: Integer, + # adjustment_intervals: -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval] === _1 }, + # auto_collection: Orb::BooleanModel, + # billing_cycle_anchor_configuration: Orb::Models::SubscriptionPriceIntervalsResponse::BillingCycleAnchorConfiguration, + # **_ + # } + # ``` + class SubscriptionPriceIntervalsResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute active_plan_phase_order + # The current plan phase that is active, only if the subscription's plan has + # phases. + # + # @return [Integer, nil] + required :active_plan_phase_order, Integer, nil?: true + + # @!attribute adjustment_intervals + # The adjustment intervals for this subscription. + # + # @return [Array] + required :adjustment_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval] } + + # @!attribute auto_collection + # Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. This property defaults to + # the plan's behavior. If null, defaults to the customer's setting. + # + # @return [Boolean, nil] + required :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_anchor_configuration + # + # @return [Orb::Models::SubscriptionPriceIntervalsResponse::BillingCycleAnchorConfiguration] + required :billing_cycle_anchor_configuration, + -> { Orb::Models::SubscriptionPriceIntervalsResponse::BillingCycleAnchorConfiguration } + + # @!attribute billing_cycle_day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is not part of the billing period. Set to null for + # subscriptions that are not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if the subscription is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute customer + # A customer is a buyer of your products, and the other party to the billing + # relationship. + # + # In Orb, customers are assigned system generated identifiers automatically, but + # it's often desirable to have these match existing identifiers in your system. To + # avoid having to denormalize Orb ID information, you can pass in an + # `external_customer_id` with your own identifier. See + # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + # information about how these aliases work in Orb. + # + # In addition to having an identifier in your system, a customer may exist in a + # payment provider solution like Stripe. Use the `payment_provider_id` and the + # `payment_provider` enum field to express this mapping. + # + # A customer also has a timezone (from the standard + # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + # your account's timezone. See [Timezone localization](/essentials/timezones) for + # information on what this timezone parameter influences within Orb. + # + # @return [Orb::Models::Customer] + required :customer, -> { Orb::Models::Customer } + + # @!attribute default_invoice_memo + # Determines the default memo on this subscriptions' invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @return [String, nil] + required :default_invoice_memo, String, nil?: true + + # @!attribute discount_intervals + # The discount intervals for this subscription. + # + # @return [Array] + required :discount_intervals, + -> { Orb::ArrayOf[union: Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval] } + + # @!attribute end_date + # The date Orb stops billing for this subscription. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_schedule + # + # @return [Array] + required :fixed_fee_quantity_schedule, + -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsResponse::FixedFeeQuantitySchedule] } + + # @!attribute invoicing_threshold + # + # @return [String, nil] + required :invoicing_threshold, String, nil?: true + + # @!attribute maximum_intervals + # The maximum intervals for this subscription. + # + # @return [Array] + required :maximum_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsResponse::MaximumInterval] } + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum_intervals + # The minimum intervals for this subscription. + # + # @return [Array] + required :minimum_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsResponse::MinimumInterval] } + + # @!attribute net_terms + # Determines the difference between the invoice issue date for subscription + # invoices as the date that they are due. A value of `0` here represents that the + # invoice is due on issue, whereas a value of `30` represents that the customer + # has a month to pay the invoice. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute plan + # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + # subscribed to by a customer. Plans define the billing behavior of the + # subscription. You can see more about how to configure prices in the + # [Price resource](/reference/price). + # + # @return [Orb::Models::Plan] + required :plan, -> { Orb::Models::Plan } + + # @!attribute price_intervals + # The price intervals for this subscription. + # + # @return [Array] + required :price_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval] } + + # @!attribute redeemed_coupon + # + # @return [Orb::Models::SubscriptionPriceIntervalsResponse::RedeemedCoupon, nil] + required :redeemed_coupon, + -> { Orb::Models::SubscriptionPriceIntervalsResponse::RedeemedCoupon }, + nil?: true + + # @!attribute start_date + # The date Orb starts billing for this subscription. + # + # @return [Time] + required :start_date, Time + + # @!attribute status + # + # @return [Symbol, Orb::Models::SubscriptionPriceIntervalsResponse::Status] + required :status, enum: -> { Orb::Models::SubscriptionPriceIntervalsResponse::Status } + + # @!attribute trial_info + # + # @return [Orb::Models::SubscriptionPriceIntervalsResponse::TrialInfo] + required :trial_info, -> { Orb::Models::SubscriptionPriceIntervalsResponse::TrialInfo } + + # @!parse + # # @param id [String] + # # @param active_plan_phase_order [Integer, nil] + # # @param adjustment_intervals [Array] + # # @param auto_collection [Boolean, nil] + # # @param billing_cycle_anchor_configuration [Orb::Models::SubscriptionPriceIntervalsResponse::BillingCycleAnchorConfiguration] + # # @param billing_cycle_day [Integer] + # # @param created_at [Time] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param customer [Orb::Models::Customer] + # # @param default_invoice_memo [String, nil] + # # @param discount_intervals [Array] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_schedule [Array] + # # @param invoicing_threshold [String, nil] + # # @param maximum_intervals [Array] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum_intervals [Array] + # # @param net_terms [Integer] + # # @param plan [Orb::Models::Plan] + # # @param price_intervals [Array] + # # @param redeemed_coupon [Orb::Models::SubscriptionPriceIntervalsResponse::RedeemedCoupon, nil] + # # @param start_date [Time] + # # @param status [Symbol, Orb::Models::SubscriptionPriceIntervalsResponse::Status] + # # @param trial_info [Orb::Models::SubscriptionPriceIntervalsResponse::TrialInfo] + # # + # def initialize( + # id:, + # active_plan_phase_order:, + # adjustment_intervals:, + # auto_collection:, + # billing_cycle_anchor_configuration:, + # billing_cycle_day:, + # created_at:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # customer:, + # default_invoice_memo:, + # discount_intervals:, + # end_date:, + # fixed_fee_quantity_schedule:, + # invoicing_threshold:, + # maximum_intervals:, + # metadata:, + # minimum_intervals:, + # net_terms:, + # plan:, + # price_intervals:, + # redeemed_coupon:, + # start_date:, + # status:, + # trial_info:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # adjustment_interval => { + # id: String, + # adjustment: Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # start_date: Time + # } + # ``` + class AdjustmentInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment + # + # @return [Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + required :adjustment, + union: -> { Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment } + + # @!attribute applies_to_price_interval_ids + # The price interval IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the adjustment interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the adjustment interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param id [String] + # # @param adjustment [Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "amount_discount", id: String, amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment ... + # in {adjustment_type: "percentage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment ... + # in {adjustment_type: "usage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment ... + # in {adjustment_type: "minimum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MinimumAdjustment ... + # in {adjustment_type: "maximum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MaximumAdjustment ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + # # ... + # in Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :amount_discount, + -> { Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment } + + variant :percentage_discount, + -> { Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment } + + variant :usage_discount, + -> { Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment } + + variant :minimum, + -> { Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MinimumAdjustment } + + variant :maximum, + -> { Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MaximumAdjustment } + + # @example + # ```ruby + # amount_discount_adjustment => { + # id: String, + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # **_ + # } + # ``` + class AmountDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # The amount by which to discount the prices this adjustment applies to in a given + # billing period. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize( + # id:, + # amount_discount:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # adjustment_type: :amount_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_adjustment => { + # id: String, + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # percentage_discount: Float, + # **_ + # } + # ``` + class PercentageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute percentage_discount + # The percentage (as a value between 0 and 1) by which to discount the price + # intervals this adjustment applies to in a given billing period. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param percentage_discount [Float] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # percentage_discount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_adjustment => { + # id: String, + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # plan_phase_order: Integer, + # **_ + # } + # ``` + class UsageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute usage_discount + # The number of usage units by which to discount the price this adjustment applies + # to in a given billing period. + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param usage_discount [Float] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # usage_discount:, + # adjustment_type: :usage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_adjustment => { + # id: String, + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # item_id: String, + # **_ + # } + # ``` + class MinimumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # item_id:, + # minimum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_adjustment => { + # id: String, + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # maximum_amount: String, + # **_ + # } + # ``` + class MaximumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param maximum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # maximum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :maximum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # billing_cycle_anchor_configuration => { + # day: Integer, + # month: Integer, + # year: Integer + # } + # ``` + class BillingCycleAnchorConfiguration < Orb::BaseModel + # @!attribute day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :day, Integer + + # @!attribute month + # The month on which the billing cycle is anchored (e.g. a quarterly price + # anchored in February would have cycles starting February, May, August, and + # November). + # + # @return [Integer, nil] + optional :month, Integer, nil?: true + + # @!attribute year + # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle + # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + # + # @return [Integer, nil] + optional :year, Integer, nil?: true + + # @!parse + # # @param day [Integer] + # # @param month [Integer, nil] + # # @param year [Integer, nil] + # # + # def initialize(day:, month: nil, year: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case discount_interval + # in {discount_type: "amount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::AmountDiscountInterval ... + # in {discount_type: "percentage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::PercentageDiscountInterval ... + # in {discount_type: "usage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::UsageDiscountInterval ... + # end + # ``` + # + # @example + # ```ruby + # case discount_interval + # in Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::AmountDiscountInterval + # # ... + # in Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::PercentageDiscountInterval + # # ... + # in Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::UsageDiscountInterval + # # ... + # end + # ``` + class DiscountInterval < Orb::Union + discriminator :discount_type + + variant :amount, + -> { Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::AmountDiscountInterval } + + variant :percentage, + -> { Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::PercentageDiscountInterval } + + variant :usage, + -> { Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::UsageDiscountInterval } + + # @example + # ```ruby + # amount_discount_interval => { + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :amount, + # end_date: Time + # } + # ``` + class AmountDiscountInterval < Orb::BaseModel + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :amount] + required :discount_type, const: :amount + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param discount_type [Symbol, :amount] + # # + # def initialize( + # amount_discount:, + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # discount_type: :amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :percentage, + # end_date: Time, + # percentage_discount: Float + # } + # ``` + class PercentageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :percentage] + required :discount_type, const: :percentage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`.This is a number between 0 + # and 1. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param percentage_discount [Float] + # # @param start_date [Time] + # # @param discount_type [Symbol, :percentage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # percentage_discount:, + # start_date:, + # discount_type: :percentage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :usage, + # end_date: Time, + # start_date: Time + # } + # ``` + class UsageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :usage] + required :discount_type, const: :usage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param usage_discount [Float] + # # @param discount_type [Symbol, :usage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # usage_discount:, + # discount_type: :usage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # fixed_fee_quantity_schedule => { + # end_date: Time, + # price_id: String, + # quantity: Float, + # start_date: Time + # } + # ``` + class FixedFeeQuantitySchedule < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param end_date [Time, nil] + # # @param price_id [String] + # # @param quantity [Float] + # # @param start_date [Time] + # # + # def initialize(end_date:, price_id:, quantity:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # maximum_amount: String, + # start_date: Time + # } + # ``` + class MaximumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the maximum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the price intervals + # this transform applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute start_date + # The start date of the maximum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param maximum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, maximum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # minimum_amount: String, + # start_date: Time + # } + # ``` + class MinimumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the minimum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the price intervals + # this minimum applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute start_date + # The start date of the minimum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param minimum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, minimum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # price_interval => { + # id: String, + # billing_cycle_day: Integer, + # current_billing_period_end_date: Time, + # current_billing_period_start_date: Time, + # end_date: Time, + # **_ + # } + # ``` + class PriceInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billing_cycle_day + # The day of the month that Orb bills for this price + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is exactly the end of the billing period. Set to null if + # this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute end_date + # The end date of the price interval. This is the date that Orb stops billing for + # this price. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_transitions + # The fixed fee quantity transitions for this price interval. This is only + # relevant for fixed fees. + # + # @return [Array, nil] + required :fixed_fee_quantity_transitions, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval::FixedFeeQuantityTransition] + }, + nil?: true + + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + required :price, union: -> { Orb::Models::Price } + + # @!attribute start_date + # The start date of the price interval. This is the date that Orb starts billing + # for this price. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # The Price Interval resource represents a period of time for which a price will + # # bill on a subscription. A subscription’s price intervals define its billing + # # behavior. + # # + # # @param id [String] + # # @param billing_cycle_day [Integer] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_transitions [Array, nil] + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # # @param start_date [Time] + # # + # def initialize( + # id:, + # billing_cycle_day:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # end_date:, + # fixed_fee_quantity_transitions:, + # price:, + # start_date:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # fixed_fee_quantity_transition => { + # effective_date: Time, + # price_id: String, + # quantity: Integer + # } + # ``` + class FixedFeeQuantityTransition < Orb::BaseModel + # @!attribute effective_date + # + # @return [Time] + required :effective_date, Time + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Integer] + required :quantity, Integer + + # @!parse + # # @param effective_date [Time] + # # @param price_id [String] + # # @param quantity [Integer] + # # + # def initialize(effective_date:, price_id:, quantity:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # redeemed_coupon => { + # coupon_id: String, + # end_date: Time, + # start_date: Time + # } + # ``` + class RedeemedCoupon < Orb::BaseModel + # @!attribute coupon_id + # + # @return [String] + required :coupon_id, String + + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param coupon_id [String] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(coupon_id:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :ended + # # ... + # in :upcoming + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # trial_info => { + # end_date: Time + # } + # ``` + class TrialInfo < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!parse + # # @param end_date [Time, nil] + # # + # def initialize(end_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/subscription_schedule_plan_change_params.rb b/lib/orb/models/subscription_schedule_plan_change_params.rb new file mode 100644 index 00000000..c22adc25 --- /dev/null +++ b/lib/orb/models/subscription_schedule_plan_change_params.rb @@ -0,0 +1,14303 @@ +# frozen_string_literal: true + +module Orb + module Models + class SubscriptionSchedulePlanChangeParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute change_option + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ChangeOption] + required :change_option, enum: -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ChangeOption } + + # @!attribute add_adjustments + # Additional adjustments to be added to the subscription. (Only available for + # accounts that have migrated off of legacy subscription overrides) + # + # @return [Array, nil] + optional :add_adjustments, + -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment] }, + nil?: true + + # @!attribute add_prices + # Additional prices to be added to the subscription. (Only available for accounts + # that have migrated off of legacy subscription overrides) + # + # @return [Array, nil] + optional :add_prices, + -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice] }, + nil?: true + + # @!attribute align_billing_with_plan_change_date + # [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be + # aligned with the plan change's effective date. + # + # @return [Boolean, nil] + optional :align_billing_with_plan_change_date, Orb::BooleanModel, nil?: true + + # @!attribute auto_collection + # Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. If not specified, this + # defaults to the behavior configured for this customer. + # + # @return [Boolean, nil] + optional :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_alignment + # Reset billing periods to be aligned with the plan change's effective date or + # start of the month. Defaults to `unchanged` which keeps subscription's existing + # billing cycle alignment. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAlignment, nil] + optional :billing_cycle_alignment, + enum: -> { Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAlignment }, + nil?: true + + # @!attribute billing_cycle_anchor_configuration + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAnchorConfiguration, nil] + optional :billing_cycle_anchor_configuration, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAnchorConfiguration }, + nil?: true + + # @!attribute change_date + # The date that the plan change should take effect. This parameter can only be + # passed if the `change_option` is `requested_date`. If a date with no time is + # passed, the plan change will happen at midnight in the customer's timezone. + # + # @return [Time, nil] + optional :change_date, Time, nil?: true + + # @!attribute coupon_redemption_code + # Redemption code to be used for this subscription. If the coupon cannot be found + # by its redemption code, or cannot be redeemed, an error response will be + # returned and the subscription creation or plan change will not be scheduled. + # + # @return [String, nil] + optional :coupon_redemption_code, String, nil?: true + + # @!attribute credits_overage_rate + # + # @return [Float, nil] + optional :credits_overage_rate, Float, nil?: true + + # @!attribute default_invoice_memo + # Determines the default memo on this subscription's invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @return [String, nil] + optional :default_invoice_memo, String, nil?: true + + # @!attribute external_plan_id + # The external_plan_id of the plan that the given subscription should be switched + # to. Note that either this property or `plan_id` must be specified. + # + # @return [String, nil] + optional :external_plan_id, String, nil?: true + + # @!attribute filter + # An additional filter to apply to usage queries. This filter must be expressed as + # a boolean + # [computed property](/extensibility/advanced-metrics#computed-properties). If + # null, usage queries will not include any additional filter. + # + # @return [String, nil] + optional :filter, String, nil?: true + + # @!attribute initial_phase_order + # The phase of the plan to start with + # + # @return [Integer, nil] + optional :initial_phase_order, Integer, nil?: true + + # @!attribute invoicing_threshold + # When this subscription's accrued usage reaches this threshold, an invoice will + # be issued for the subscription. If not specified, invoices will only be issued + # at the end of the billing period. + # + # @return [String, nil] + optional :invoicing_threshold, String, nil?: true + + # @!attribute net_terms + # The net terms determines the difference between the invoice date and the issue + # date for the invoice. If you intend the invoice to be due on issue, set this + # to 0. If not provided, this defaults to the value specified in the plan. + # + # @return [Integer, nil] + optional :net_terms, Integer, nil?: true + + # @!attribute per_credit_overage_amount + # + # @return [Float, nil] + optional :per_credit_overage_amount, Float, nil?: true + + # @!attribute plan_id + # The plan that the given subscription should be switched to. Note that either + # this property or `external_plan_id` must be specified. + # + # @return [String, nil] + optional :plan_id, String, nil?: true + + # @!attribute plan_version_number + # Specifies which version of the plan to change to. If null, the default version + # will be used. + # + # @return [Integer, nil] + optional :plan_version_number, Integer, nil?: true + + # @!attribute price_overrides + # Optionally provide a list of overrides for prices on the plan + # + # @return [Array, nil] + optional :price_overrides, Orb::ArrayOf[Orb::Unknown], nil?: true + + # @!attribute remove_adjustments + # Plan adjustments to be removed from the subscription. (Only available for + # accounts that have migrated off of legacy subscription overrides) + # + # @return [Array, nil] + optional :remove_adjustments, + -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::RemoveAdjustment] }, + nil?: true + + # @!attribute remove_prices + # Plan prices to be removed from the subscription. (Only available for accounts + # that have migrated off of legacy subscription overrides) + # + # @return [Array, nil] + optional :remove_prices, + -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::RemovePrice] }, + nil?: true + + # @!attribute replace_adjustments + # Plan adjustments to be replaced with additional adjustments on the subscription. + # (Only available for accounts that have migrated off of legacy subscription + # overrides) + # + # @return [Array, nil] + optional :replace_adjustments, + -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment] }, + nil?: true + + # @!attribute replace_prices + # Plan prices to be replaced with additional prices on the subscription. (Only + # available for accounts that have migrated off of legacy subscription overrides) + # + # @return [Array, nil] + optional :replace_prices, + -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice] }, + nil?: true + + # @!attribute trial_duration_days + # The duration of the trial period in days. If not provided, this defaults to the + # value specified in the plan. If `0` is provided, the trial on the plan will be + # skipped. + # + # @return [Integer, nil] + optional :trial_duration_days, Integer, nil?: true + + # @!parse + # # @param change_option [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ChangeOption] + # # @param add_adjustments [Array, nil] + # # @param add_prices [Array, nil] + # # @param align_billing_with_plan_change_date [Boolean, nil] + # # @param auto_collection [Boolean, nil] + # # @param billing_cycle_alignment [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAlignment, nil] + # # @param billing_cycle_anchor_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAnchorConfiguration, nil] + # # @param change_date [Time, nil] + # # @param coupon_redemption_code [String, nil] + # # @param credits_overage_rate [Float, nil] + # # @param default_invoice_memo [String, nil] + # # @param external_plan_id [String, nil] + # # @param filter [String, nil] + # # @param initial_phase_order [Integer, nil] + # # @param invoicing_threshold [String, nil] + # # @param net_terms [Integer, nil] + # # @param per_credit_overage_amount [Float, nil] + # # @param plan_id [String, nil] + # # @param plan_version_number [Integer, nil] + # # @param price_overrides [Array, nil] + # # @param remove_adjustments [Array, nil] + # # @param remove_prices [Array, nil] + # # @param replace_adjustments [Array, nil] + # # @param replace_prices [Array, nil] + # # @param trial_duration_days [Integer, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # change_option:, + # add_adjustments: nil, + # add_prices: nil, + # align_billing_with_plan_change_date: nil, + # auto_collection: nil, + # billing_cycle_alignment: nil, + # billing_cycle_anchor_configuration: nil, + # change_date: nil, + # coupon_redemption_code: nil, + # credits_overage_rate: nil, + # default_invoice_memo: nil, + # external_plan_id: nil, + # filter: nil, + # initial_phase_order: nil, + # invoicing_threshold: nil, + # net_terms: nil, + # per_credit_overage_amount: nil, + # plan_id: nil, + # plan_version_number: nil, + # price_overrides: nil, + # remove_adjustments: nil, + # remove_prices: nil, + # replace_adjustments: nil, + # replace_prices: nil, + # trial_duration_days: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case change_option + # in :requested_date + # # ... + # in :end_of_subscription_term + # # ... + # in :immediate + # # ... + # end + # ``` + class ChangeOption < Orb::Enum + REQUESTED_DATE = :requested_date + END_OF_SUBSCRIPTION_TERM = :end_of_subscription_term + IMMEDIATE = :immediate + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # add_adjustment => { + # adjustment: Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment, + # end_date: Time, + # plan_phase_order: Integer, + # start_date: Time + # } + # ``` + class AddAdjustment < Orb::BaseModel + # @!attribute adjustment + # The definition of a new adjustment to create and add to the subscription. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewPercentageDiscount, Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewUsageDiscount, Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewAmountDiscount, Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMinimum, Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMaximum] + required :adjustment, + union: -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment } + + # @!attribute end_date + # The end date of the adjustment interval. This is the date that the adjustment + # will stop affecting prices on the subscription. If null, the adjustment will + # start when the phase or subscription starts. + # + # @return [Time, nil] + optional :end_date, Time, nil?: true + + # @!attribute plan_phase_order + # The phase to add this adjustment to. + # + # @return [Integer, nil] + optional :plan_phase_order, Integer, nil?: true + + # @!attribute start_date + # The start date of the adjustment interval. This is the date that the adjustment + # will start affecting prices on the subscription. If null, the adjustment will + # start when the phase or subscription starts. + # + # @return [Time, nil] + optional :start_date, Time, nil?: true + + # @!parse + # # @param adjustment [Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewPercentageDiscount, Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewUsageDiscount, Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewAmountDiscount, Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMinimum, Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMaximum] + # # @param end_date [Time, nil] + # # @param plan_phase_order [Integer, nil] + # # @param start_date [Time, nil] + # # + # def initialize(adjustment:, end_date: nil, plan_phase_order: nil, start_date: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The definition of a new adjustment to create and add to the subscription. + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "percentage_discount", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, percentage_discount: Float, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewPercentageDiscount ... + # in {adjustment_type: "usage_discount", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, usage_discount: Float, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewUsageDiscount ... + # in {adjustment_type: "amount_discount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewAmountDiscount ... + # in {adjustment_type: "minimum", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, item_id: String, minimum_amount: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMinimum ... + # in {adjustment_type: "maximum", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, maximum_amount: String, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMaximum ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewPercentageDiscount + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewUsageDiscount + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewAmountDiscount + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMinimum + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMaximum + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :percentage_discount, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewPercentageDiscount } + + variant :usage_discount, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewUsageDiscount } + + variant :amount_discount, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewAmountDiscount } + + variant :minimum, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMinimum } + + variant :maximum, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMaximum } + + # @example + # ```ruby + # new_percentage_discount => { + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # percentage_discount: Float, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewPercentageDiscount < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute percentage_discount + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param percentage_discount [Float] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # applies_to_price_ids:, + # percentage_discount:, + # is_invoice_level: nil, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_usage_discount => { + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # usage_discount: Float, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewUsageDiscount < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute usage_discount + # + # @return [Float] + required :usage_discount, Float + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param usage_discount [Float] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize(applies_to_price_ids:, usage_discount:, is_invoice_level: nil, adjustment_type: :usage_discount, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_amount_discount => { + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewAmountDiscount < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize(amount_discount:, applies_to_price_ids:, is_invoice_level: nil, adjustment_type: :amount_discount, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_minimum => { + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # item_id: String, + # minimum_amount: String, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewMinimum < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # + # @return [String] + required :minimum_amount, String + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize(applies_to_price_ids:, item_id:, minimum_amount:, is_invoice_level: nil, adjustment_type: :minimum, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_maximum => { + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewMaximum < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # + # @return [String] + required :maximum_amount, String + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, is_invoice_level: nil, adjustment_type: :maximum, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # add_price => { + # discounts: -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount] === _1 }, + # end_date: Time, + # external_price_id: String, + # maximum_amount: String, + # minimum_amount: String, + # **_ + # } + # ``` + class AddPrice < Orb::BaseModel + # @!attribute discounts + # [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this + # price. + # + # @return [Array, nil] + optional :discounts, + -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount] }, + nil?: true + + # @!attribute end_date + # The end date of the price interval. This is the date that the price will stop + # billing on the subscription. If null, billing will end when the phase or + # subscription ends. + # + # @return [Time, nil] + optional :end_date, Time, nil?: true + + # @!attribute external_price_id + # The external price id of the price to add to the subscription. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute maximum_amount + # [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for + # this price. + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute minimum_amount + # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for + # this price. + # + # @return [String, nil] + optional :minimum_amount, String, nil?: true + + # @!attribute plan_phase_order + # The phase to add this price to. + # + # @return [Integer, nil] + optional :plan_phase_order, Integer, nil?: true + + # @!attribute price + # The definition of a new price to create and add to the subscription. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice, nil] + optional :price, + union: -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price }, + nil?: true + + # @!attribute price_id + # The id of the price to add to the subscription. + # + # @return [String, nil] + optional :price_id, String, nil?: true + + # @!attribute start_date + # The start date of the price interval. This is the date that the price will start + # billing on the subscription. If null, billing will start when the phase or + # subscription starts. + # + # @return [Time, nil] + optional :start_date, Time, nil?: true + + # @!parse + # # @param discounts [Array, nil] + # # @param end_date [Time, nil] + # # @param external_price_id [String, nil] + # # @param maximum_amount [String, nil] + # # @param minimum_amount [String, nil] + # # @param plan_phase_order [Integer, nil] + # # @param price [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice, nil] + # # @param price_id [String, nil] + # # @param start_date [Time, nil] + # # + # def initialize( + # discounts: nil, + # end_date: nil, + # external_price_id: nil, + # maximum_amount: nil, + # minimum_amount: nil, + # plan_phase_order: nil, + # price: nil, + # price_id: nil, + # start_date: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # discount => { + # discount_type: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount::DiscountType, + # amount_discount: String, + # percentage_discount: Float, + # usage_discount: Float + # } + # ``` + class Discount < Orb::BaseModel + # @!attribute discount_type + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount::DiscountType] + required :discount_type, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount::DiscountType + } + + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [String, nil] + optional :amount_discount, String, nil?: true + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`. This is a number between 0 + # and 1. + # + # @return [Float, nil] + optional :percentage_discount, Float, nil?: true + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for + # + # @return [Float, nil] + optional :usage_discount, Float, nil?: true + + # @!parse + # # @param discount_type [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount::DiscountType] + # # @param amount_discount [String, nil] + # # @param percentage_discount [Float, nil] + # # @param usage_discount [Float, nil] + # # + # def initialize(discount_type:, amount_discount: nil, percentage_discount: nil, usage_discount: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case discount_type + # in :percentage + # # ... + # in :usage + # # ... + # in :amount + # # ... + # end + # ``` + class DiscountType < Orb::Enum + PERCENTAGE = :percentage + USAGE = :usage + AMOUNT = :amount + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # The definition of a new price to create and add to the subscription. + # + # @example + # ```ruby + # case price + # in {model_type: "unit", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice ... + # in {model_type: "package", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice ... + # in {model_type: "matrix", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::Cadence, item_id: String, matrix_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice ... + # in {model_type: "tiered", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice ... + # in {model_type: "tiered_bps", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice ... + # in {model_type: "bps", bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig, cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::Cadence, item_id: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice ... + # in {model_type: "bulk_bps", bulk_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::Cadence, item_id: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice ... + # in {model_type: "bulk", bulk_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig, cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::Cadence, item_id: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice ... + # in {model_type: "threshold_total_amount", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice ... + # in {model_type: "tiered_package", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice ... + # in {model_type: "tiered_with_minimum", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice ... + # in {model_type: "unit_with_percent", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice ... + # in {model_type: "package_with_allocation", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice ... + # in {model_type: "tiered_with_proration", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice ... + # in {model_type: "unit_with_proration", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice ... + # in {model_type: "grouped_allocation", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence, grouped_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, item_id: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice ... + # in {model_type: "grouped_with_prorated_minimum", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence, grouped_with_prorated_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, item_id: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice ... + # in {model_type: "bulk_with_proration", bulk_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence, item_id: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice ... + # end + # ``` + # + # @example + # ```ruby + # case price + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice + # # ... + # end + # ``` + class Price < Orb::Union + discriminator :model_type + + variant :unit, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice } + + variant :package, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice } + + variant :matrix, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice } + + variant :tiered, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice } + + variant :tiered_bps, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice } + + variant :bps, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice } + + variant :bulk_bps, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice } + + variant :bulk, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice } + + variant :threshold_total_amount, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice } + + variant :tiered_package, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice } + + variant :tiered_with_minimum, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice } + + variant :unit_with_percent, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice } + + variant :package_with_allocation, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice } + + variant :tiered_with_proration, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice } + + variant :unit_with_proration, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice } + + variant :grouped_allocation, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice } + + variant :grouped_with_prorated_minimum, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice } + + variant :bulk_with_proration, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice } + + # @example + # ```ruby + # new_subscription_unit_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::Cadence, + # item_id: String, + # model_type: :unit, + # name: String, + # unit_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig, + # **_ + # } + # ``` + class NewSubscriptionUnitPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit] + required :model_type, const: :unit + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_config + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig] + required :unit_config, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param unit_config [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :unit] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # unit_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :unit, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # unit_config => { + # unit_amount: String + # } + # ``` + class UnitConfig < Orb::BaseModel + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param unit_amount [String] + # # + # def initialize(unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_package_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::Cadence, + # item_id: String, + # model_type: :package, + # name: String, + # package_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig, + # **_ + # } + # ``` + class NewSubscriptionPackagePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :package] + required :model_type, const: :package + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute package_config + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig] + required :package_config, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param package_config [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :package] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # package_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # package_config => { + # package_amount: String, + # package_size: Integer + # } + # ``` + class PackageConfig < Orb::BaseModel + # @!attribute package_amount + # A currency amount to rate usage by + # + # @return [String] + required :package_amount, String + + # @!attribute package_size + # An integer amount to represent package size. For example, 1000 here would divide + # usage by 1000 before multiplying by package_amount in rating + # + # @return [Integer] + required :package_size, Integer + + # @!parse + # # @param package_amount [String] + # # @param package_size [Integer] + # # + # def initialize(package_amount:, package_size:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_matrix_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::Cadence, + # item_id: String, + # matrix_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + # model_type: :matrix, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionMatrixPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute matrix_config + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig] + required :matrix_config, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig } + + # @!attribute model_type + # + # @return [Symbol, :matrix] + required :model_type, const: :matrix + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::Cadence] + # # @param item_id [String] + # # @param matrix_config [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :matrix] + # # + # def initialize( + # cadence:, + # item_id:, + # matrix_config:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :matrix, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # matrix_config => { + # default_unit_amount: String, + # dimensions: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # matrix_values: -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] === _1 } + # } + # ``` + class MatrixConfig < Orb::BaseModel + # @!attribute default_unit_amount + # Default per unit rate for any usage not bucketed into a specified matrix_value + # + # @return [String] + required :default_unit_amount, String + + # @!attribute dimensions + # One or two event property values to evaluate matrix groups by + # + # @return [Array] + required :dimensions, Orb::ArrayOf[String, nil?: true] + + # @!attribute matrix_values + # Matrix values for specified matrix grouping keys + # + # @return [Array] + required :matrix_values, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + } + + # @!parse + # # @param default_unit_amount [String] + # # @param dimensions [Array] + # # @param matrix_values [Array] + # # + # def initialize(default_unit_amount:, dimensions:, matrix_values:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # matrix_value => { + # dimension_values: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # unit_amount: String + # } + # ``` + class MatrixValue < Orb::BaseModel + # @!attribute dimension_values + # One or two matrix keys to filter usage to this Matrix value by. For example, + # ["region", "tier"] could be used to filter cloud usage by a cloud region and an + # instance tier. + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String, nil?: true] + + # @!attribute unit_amount + # Unit price for the specified dimension_values + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param dimension_values [Array] + # # @param unit_amount [String] + # # + # def initialize(dimension_values:, unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tiered_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::Cadence, + # item_id: String, + # model_type: :tiered, + # name: String, + # tiered_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig, + # **_ + # } + # ``` + class NewSubscriptionTieredPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered] + required :model_type, const: :tiered + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_config + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig] + required :tiered_config, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_config [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # tiered_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] === _1 } + # } + # ``` + class TieredConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # first_unit: Float, + # unit_amount: String, + # last_unit: Float + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute first_unit + # Inclusive tier starting value + # + # @return [Float] + required :first_unit, Float + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute last_unit + # Exclusive tier ending value. If null, this is treated as the last tier + # + # @return [Float, nil] + optional :last_unit, Float, nil?: true + + # @!parse + # # @param first_unit [Float] + # # @param unit_amount [String] + # # @param last_unit [Float, nil] + # # + # def initialize(first_unit:, unit_amount:, last_unit: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tiered_bps_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::Cadence, + # item_id: String, + # model_type: :tiered_bps, + # name: String, + # tiered_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + # **_ + # } + # ``` + class NewSubscriptionTieredBpsPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_bps] + required :model_type, const: :tiered_bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_bps_config + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig] + required :tiered_bps_config, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_bps_config [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered_bps] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_bps_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered_bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # tiered_bps_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] === _1 } + # } + # ``` + class TieredBpsConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + # tiers + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # bps: Float, + # minimum_amount: String, + # maximum_amount: String, + # per_unit_maximum: String + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute bps + # Per-event basis point rate + # + # @return [Float] + required :bps, Float + + # @!attribute minimum_amount + # Inclusive tier starting value + # + # @return [String] + required :minimum_amount, String + + # @!attribute maximum_amount + # Exclusive tier ending value + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute per_unit_maximum + # Per unit maximum to charge + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param minimum_amount [String] + # # @param maximum_amount [String, nil] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_bps_price => { + # bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig, + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::Cadence, + # item_id: String, + # model_type: :bps, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionBpsPrice < Orb::BaseModel + # @!attribute bps_config + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig] + required :bps_config, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bps] + required :model_type, const: :bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param bps_config [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig] + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :bps] + # # + # def initialize( + # bps_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bps_config => { + # bps: Float, + # per_unit_maximum: String + # } + # ``` + class BpsConfig < Orb::BaseModel + # @!attribute bps + # Basis point take rate per event + # + # @return [Float] + required :bps, Float + + # @!attribute per_unit_maximum + # Optional currency amount maximum to cap spend per event + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_bulk_bps_price => { + # bulk_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::Cadence, + # item_id: String, + # model_type: :bulk_bps, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionBulkBpsPrice < Orb::BaseModel + # @!attribute bulk_bps_config + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig] + required :bulk_bps_config, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk_bps] + required :model_type, const: :bulk_bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param bulk_bps_config [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig] + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :bulk_bps] + # # + # def initialize( + # bulk_bps_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :bulk_bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bulk_bps_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] === _1 } + # } + # ``` + class BulkBpsConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for a bulk BPS pricing model where all usage is aggregated to a single + # tier based on total volume + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # bps: Float, + # maximum_amount: String, + # per_unit_maximum: String + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute bps + # Basis points to rate on + # + # @return [Float] + required :bps, Float + + # @!attribute maximum_amount + # Upper bound for tier + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute per_unit_maximum + # The maximum amount to charge for any one event + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param maximum_amount [String, nil] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, maximum_amount: nil, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_bulk_price => { + # bulk_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig, + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::Cadence, + # item_id: String, + # model_type: :bulk, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionBulkPrice < Orb::BaseModel + # @!attribute bulk_config + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig] + required :bulk_config, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk] + required :model_type, const: :bulk + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param bulk_config [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig] + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :bulk] + # # + # def initialize( + # bulk_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :bulk, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bulk_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] === _1 } + # } + # ``` + class BulkConfig < Orb::BaseModel + # @!attribute tiers + # Bulk tiers for rating based on total usage volume + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # unit_amount: String, + # maximum_units: Float + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute maximum_units + # Upper bound for this tier + # + # @return [Float, nil] + optional :maximum_units, Float, nil?: true + + # @!parse + # # @param unit_amount [String] + # # @param maximum_units [Float, nil] + # # + # def initialize(unit_amount:, maximum_units: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_threshold_total_amount_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence, + # item_id: String, + # model_type: :threshold_total_amount, + # name: String, + # threshold_total_amount_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionThresholdTotalAmountPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :threshold_total_amount] + required :model_type, const: :threshold_total_amount + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute threshold_total_amount_config + # + # @return [Hash{Symbol=>Object}] + required :threshold_total_amount_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param threshold_total_amount_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :threshold_total_amount] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # threshold_total_amount_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :threshold_total_amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tiered_package_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::Cadence, + # item_id: String, + # model_type: :tiered_package, + # name: String, + # tiered_package_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionTieredPackagePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_package] + required :model_type, const: :tiered_package + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_package_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_package_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_package_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered_package] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_package_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered_package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tiered_with_minimum_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence, + # item_id: String, + # model_type: :tiered_with_minimum, + # name: String, + # tiered_with_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionTieredWithMinimumPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_with_minimum] + required :model_type, const: :tiered_with_minimum + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_with_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_with_minimum_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered_with_minimum] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_with_minimum_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered_with_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_unit_with_percent_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence, + # item_id: String, + # model_type: :unit_with_percent, + # name: String, + # unit_with_percent_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionUnitWithPercentPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit_with_percent] + required :model_type, const: :unit_with_percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_with_percent_config + # + # @return [Hash{Symbol=>Object}] + required :unit_with_percent_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param unit_with_percent_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :unit_with_percent] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # unit_with_percent_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :unit_with_percent, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_package_with_allocation_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence, + # item_id: String, + # model_type: :package_with_allocation, + # name: String, + # package_with_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionPackageWithAllocationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :package_with_allocation] + required :model_type, const: :package_with_allocation + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute package_with_allocation_config + # + # @return [Hash{Symbol=>Object}] + required :package_with_allocation_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param package_with_allocation_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :package_with_allocation] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # package_with_allocation_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :package_with_allocation, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tier_with_proration_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::Cadence, + # item_id: String, + # model_type: :tiered_with_proration, + # name: String, + # tiered_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionTierWithProrationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_with_proration_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered_with_proration] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_with_proration_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_unit_with_proration_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence, + # item_id: String, + # model_type: :unit_with_proration, + # name: String, + # unit_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionUnitWithProrationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit_with_proration] + required :model_type, const: :unit_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :unit_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param unit_with_proration_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :unit_with_proration] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # unit_with_proration_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :unit_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_grouped_allocation_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence, + # grouped_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_allocation, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionGroupedAllocationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence + } + + # @!attribute grouped_allocation_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_allocation_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_allocation] + required :model_type, const: :grouped_allocation + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence] + # # @param grouped_allocation_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :grouped_allocation] + # # + # def initialize( + # cadence:, + # grouped_allocation_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :grouped_allocation, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_grouped_with_prorated_minimum_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence, + # grouped_with_prorated_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_with_prorated_minimum, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionGroupedWithProratedMinimumPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence + } + + # @!attribute grouped_with_prorated_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_with_prorated_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_with_prorated_minimum] + required :model_type, const: :grouped_with_prorated_minimum + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence] + # # @param grouped_with_prorated_minimum_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :grouped_with_prorated_minimum] + # # + # def initialize( + # cadence:, + # grouped_with_prorated_minimum_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :grouped_with_prorated_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_bulk_with_proration_price => { + # bulk_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence, + # item_id: String, + # model_type: :bulk_with_proration, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionBulkWithProrationPrice < Orb::BaseModel + # @!attribute bulk_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :bulk_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk_with_proration] + required :model_type, const: :bulk_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param bulk_with_proration_config [Hash{Symbol=>Object}] + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :bulk_with_proration] + # # + # def initialize( + # bulk_with_proration_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :bulk_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end + + # @abstract + # + # Reset billing periods to be aligned with the plan change's effective date or + # start of the month. Defaults to `unchanged` which keeps subscription's existing + # billing cycle alignment. + # + # @example + # ```ruby + # case billing_cycle_alignment + # in :unchanged + # # ... + # in :plan_change_date + # # ... + # in :start_of_month + # # ... + # end + # ``` + class BillingCycleAlignment < Orb::Enum + UNCHANGED = :unchanged + PLAN_CHANGE_DATE = :plan_change_date + START_OF_MONTH = :start_of_month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_anchor_configuration => { + # day: Integer, + # month: Integer, + # year: Integer + # } + # ``` + class BillingCycleAnchorConfiguration < Orb::BaseModel + # @!attribute day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :day, Integer + + # @!attribute month + # The month on which the billing cycle is anchored (e.g. a quarterly price + # anchored in February would have cycles starting February, May, August, and + # November). + # + # @return [Integer, nil] + optional :month, Integer, nil?: true + + # @!attribute year + # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle + # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + # + # @return [Integer, nil] + optional :year, Integer, nil?: true + + # @!parse + # # @param day [Integer] + # # @param month [Integer, nil] + # # @param year [Integer, nil] + # # + # def initialize(day:, month: nil, year: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # remove_adjustment => { + # adjustment_id: String + # } + # ``` + class RemoveAdjustment < Orb::BaseModel + # @!attribute adjustment_id + # The id of the adjustment to remove on the subscription. + # + # @return [String] + required :adjustment_id, String + + # @!parse + # # @param adjustment_id [String] + # # + # def initialize(adjustment_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # remove_price => { + # external_price_id: String, + # price_id: String + # } + # ``` + class RemovePrice < Orb::BaseModel + # @!attribute external_price_id + # The external price id of the price to remove on the subscription. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute price_id + # The id of the price to remove on the subscription. + # + # @return [String, nil] + optional :price_id, String, nil?: true + + # @!parse + # # @param external_price_id [String, nil] + # # @param price_id [String, nil] + # # + # def initialize(external_price_id: nil, price_id: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # replace_adjustment => { + # adjustment: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment, + # replaces_adjustment_id: String + # } + # ``` + class ReplaceAdjustment < Orb::BaseModel + # @!attribute adjustment + # The definition of a new adjustment to create and add to the subscription. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewUsageDiscount, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewAmountDiscount, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMinimum, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMaximum] + required :adjustment, + union: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment + } + + # @!attribute replaces_adjustment_id + # The id of the adjustment on the plan to replace in the subscription. + # + # @return [String] + required :replaces_adjustment_id, String + + # @!parse + # # @param adjustment [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewUsageDiscount, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewAmountDiscount, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMinimum, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMaximum] + # # @param replaces_adjustment_id [String] + # # + # def initialize(adjustment:, replaces_adjustment_id:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The definition of a new adjustment to create and add to the subscription. + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "percentage_discount", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, percentage_discount: Float, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount ... + # in {adjustment_type: "usage_discount", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, usage_discount: Float, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewUsageDiscount ... + # in {adjustment_type: "amount_discount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewAmountDiscount ... + # in {adjustment_type: "minimum", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, item_id: String, minimum_amount: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMinimum ... + # in {adjustment_type: "maximum", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, maximum_amount: String, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMaximum ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewUsageDiscount + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewAmountDiscount + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMinimum + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMaximum + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :percentage_discount, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount } + + variant :usage_discount, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewUsageDiscount } + + variant :amount_discount, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewAmountDiscount } + + variant :minimum, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMinimum } + + variant :maximum, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMaximum } + + # @example + # ```ruby + # new_percentage_discount => { + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # percentage_discount: Float, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewPercentageDiscount < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute percentage_discount + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param percentage_discount [Float] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # applies_to_price_ids:, + # percentage_discount:, + # is_invoice_level: nil, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_usage_discount => { + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # usage_discount: Float, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewUsageDiscount < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute usage_discount + # + # @return [Float] + required :usage_discount, Float + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param usage_discount [Float] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize(applies_to_price_ids:, usage_discount:, is_invoice_level: nil, adjustment_type: :usage_discount, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_amount_discount => { + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewAmountDiscount < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize(amount_discount:, applies_to_price_ids:, is_invoice_level: nil, adjustment_type: :amount_discount, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_minimum => { + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # item_id: String, + # minimum_amount: String, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewMinimum < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # + # @return [String] + required :minimum_amount, String + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize(applies_to_price_ids:, item_id:, minimum_amount:, is_invoice_level: nil, adjustment_type: :minimum, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # new_maximum => { + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # maximum_amount: String, + # is_invoice_level: Orb::BooleanModel + # } + # ``` + class NewMaximum < Orb::BaseModel + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The set of price IDs to which this adjustment applies. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute maximum_amount + # + # @return [String] + required :maximum_amount, String + + # @!attribute [r] is_invoice_level + # When false, this adjustment will be applied to a single price. Otherwise, it + # will be applied at the invoice level, possibly to multiple prices. + # + # @return [Boolean, nil] + optional :is_invoice_level, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_invoice_level + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param maximum_amount [String] + # # @param is_invoice_level [Boolean] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize(applies_to_price_ids:, maximum_amount:, is_invoice_level: nil, adjustment_type: :maximum, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # replace_price => { + # replaces_price_id: String, + # discounts: -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount] === _1 }, + # external_price_id: String, + # fixed_price_quantity: Float, + # maximum_amount: String, + # **_ + # } + # ``` + class ReplacePrice < Orb::BaseModel + # @!attribute replaces_price_id + # The id of the price on the plan to replace in the subscription. + # + # @return [String] + required :replaces_price_id, String + + # @!attribute discounts + # [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the + # replacement price. + # + # @return [Array, nil] + optional :discounts, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount] + }, + nil?: true + + # @!attribute external_price_id + # The external price id of the price to add to the subscription. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # The new quantity of the price, if the price is a fixed price. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute maximum_amount + # [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for + # the replacement price. + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute minimum_amount + # [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for + # the replacement price. + # + # @return [String, nil] + optional :minimum_amount, String, nil?: true + + # @!attribute price + # The definition of a new price to create and add to the subscription. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice, nil] + optional :price, + union: -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price }, + nil?: true + + # @!attribute price_id + # The id of the price to add to the subscription. + # + # @return [String, nil] + optional :price_id, String, nil?: true + + # @!parse + # # @param replaces_price_id [String] + # # @param discounts [Array, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param maximum_amount [String, nil] + # # @param minimum_amount [String, nil] + # # @param price [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice, nil] + # # @param price_id [String, nil] + # # + # def initialize( + # replaces_price_id:, + # discounts: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # maximum_amount: nil, + # minimum_amount: nil, + # price: nil, + # price_id: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # discount => { + # discount_type: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount::DiscountType, + # amount_discount: String, + # percentage_discount: Float, + # usage_discount: Float + # } + # ``` + class Discount < Orb::BaseModel + # @!attribute discount_type + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount::DiscountType] + required :discount_type, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount::DiscountType + } + + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [String, nil] + optional :amount_discount, String, nil?: true + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`. This is a number between 0 + # and 1. + # + # @return [Float, nil] + optional :percentage_discount, Float, nil?: true + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for + # + # @return [Float, nil] + optional :usage_discount, Float, nil?: true + + # @!parse + # # @param discount_type [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount::DiscountType] + # # @param amount_discount [String, nil] + # # @param percentage_discount [Float, nil] + # # @param usage_discount [Float, nil] + # # + # def initialize(discount_type:, amount_discount: nil, percentage_discount: nil, usage_discount: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case discount_type + # in :percentage + # # ... + # in :usage + # # ... + # in :amount + # # ... + # end + # ``` + class DiscountType < Orb::Enum + PERCENTAGE = :percentage + USAGE = :usage + AMOUNT = :amount + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # The definition of a new price to create and add to the subscription. + # + # @example + # ```ruby + # case price + # in {model_type: "unit", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice ... + # in {model_type: "package", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice ... + # in {model_type: "matrix", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::Cadence, item_id: String, matrix_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice ... + # in {model_type: "tiered", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice ... + # in {model_type: "tiered_bps", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice ... + # in {model_type: "bps", bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig, cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::Cadence, item_id: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice ... + # in {model_type: "bulk_bps", bulk_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::Cadence, item_id: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice ... + # in {model_type: "bulk", bulk_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig, cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::Cadence, item_id: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice ... + # in {model_type: "threshold_total_amount", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice ... + # in {model_type: "tiered_package", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice ... + # in {model_type: "tiered_with_minimum", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice ... + # in {model_type: "unit_with_percent", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice ... + # in {model_type: "package_with_allocation", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice ... + # in {model_type: "tiered_with_proration", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice ... + # in {model_type: "unit_with_proration", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence, item_id: String, name: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice ... + # in {model_type: "grouped_allocation", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence, grouped_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, item_id: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice ... + # in {model_type: "grouped_with_prorated_minimum", cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence, grouped_with_prorated_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, item_id: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice ... + # in {model_type: "bulk_with_proration", bulk_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence, item_id: String} + # # Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice ... + # end + # ``` + # + # @example + # ```ruby + # case price + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice + # # ... + # end + # ``` + class Price < Orb::Union + discriminator :model_type + + variant :unit, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice } + + variant :package, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice } + + variant :matrix, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice } + + variant :tiered, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice } + + variant :tiered_bps, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice } + + variant :bps, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice } + + variant :bulk_bps, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice } + + variant :bulk, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice } + + variant :threshold_total_amount, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice } + + variant :tiered_package, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice } + + variant :tiered_with_minimum, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice } + + variant :unit_with_percent, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice } + + variant :package_with_allocation, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice } + + variant :tiered_with_proration, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice } + + variant :unit_with_proration, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice } + + variant :grouped_allocation, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice } + + variant :grouped_with_prorated_minimum, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice } + + variant :bulk_with_proration, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice } + + # @example + # ```ruby + # new_subscription_unit_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::Cadence, + # item_id: String, + # model_type: :unit, + # name: String, + # unit_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig, + # **_ + # } + # ``` + class NewSubscriptionUnitPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit] + required :model_type, const: :unit + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_config + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig] + required :unit_config, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param unit_config [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :unit] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # unit_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :unit, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # unit_config => { + # unit_amount: String + # } + # ``` + class UnitConfig < Orb::BaseModel + # @!attribute unit_amount + # Rate per unit of usage + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param unit_amount [String] + # # + # def initialize(unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_package_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::Cadence, + # item_id: String, + # model_type: :package, + # name: String, + # package_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig, + # **_ + # } + # ``` + class NewSubscriptionPackagePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :package] + required :model_type, const: :package + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute package_config + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig] + required :package_config, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param package_config [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :package] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # package_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # package_config => { + # package_amount: String, + # package_size: Integer + # } + # ``` + class PackageConfig < Orb::BaseModel + # @!attribute package_amount + # A currency amount to rate usage by + # + # @return [String] + required :package_amount, String + + # @!attribute package_size + # An integer amount to represent package size. For example, 1000 here would divide + # usage by 1000 before multiplying by package_amount in rating + # + # @return [Integer] + required :package_size, Integer + + # @!parse + # # @param package_amount [String] + # # @param package_size [Integer] + # # + # def initialize(package_amount:, package_size:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_matrix_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::Cadence, + # item_id: String, + # matrix_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + # model_type: :matrix, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionMatrixPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute matrix_config + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig] + required :matrix_config, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig } + + # @!attribute model_type + # + # @return [Symbol, :matrix] + required :model_type, const: :matrix + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::Cadence] + # # @param item_id [String] + # # @param matrix_config [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :matrix] + # # + # def initialize( + # cadence:, + # item_id:, + # matrix_config:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :matrix, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # matrix_config => { + # default_unit_amount: String, + # dimensions: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # matrix_values: -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] === _1 } + # } + # ``` + class MatrixConfig < Orb::BaseModel + # @!attribute default_unit_amount + # Default per unit rate for any usage not bucketed into a specified matrix_value + # + # @return [String] + required :default_unit_amount, String + + # @!attribute dimensions + # One or two event property values to evaluate matrix groups by + # + # @return [Array] + required :dimensions, Orb::ArrayOf[String, nil?: true] + + # @!attribute matrix_values + # Matrix values for specified matrix grouping keys + # + # @return [Array] + required :matrix_values, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + } + + # @!parse + # # @param default_unit_amount [String] + # # @param dimensions [Array] + # # @param matrix_values [Array] + # # + # def initialize(default_unit_amount:, dimensions:, matrix_values:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # matrix_value => { + # dimension_values: -> { Orb::ArrayOf[String, nil?: true] === _1 }, + # unit_amount: String + # } + # ``` + class MatrixValue < Orb::BaseModel + # @!attribute dimension_values + # One or two matrix keys to filter usage to this Matrix value by. For example, + # ["region", "tier"] could be used to filter cloud usage by a cloud region and an + # instance tier. + # + # @return [Array] + required :dimension_values, Orb::ArrayOf[String, nil?: true] + + # @!attribute unit_amount + # Unit price for the specified dimension_values + # + # @return [String] + required :unit_amount, String + + # @!parse + # # @param dimension_values [Array] + # # @param unit_amount [String] + # # + # def initialize(dimension_values:, unit_amount:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tiered_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::Cadence, + # item_id: String, + # model_type: :tiered, + # name: String, + # tiered_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig, + # **_ + # } + # ``` + class NewSubscriptionTieredPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered] + required :model_type, const: :tiered + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_config + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig] + required :tiered_config, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_config [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # tiered_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] === _1 } + # } + # ``` + class TieredConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for rating based on total usage quantities into the specified tier + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # first_unit: Float, + # unit_amount: String, + # last_unit: Float + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute first_unit + # Inclusive tier starting value + # + # @return [Float] + required :first_unit, Float + + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute last_unit + # Exclusive tier ending value. If null, this is treated as the last tier + # + # @return [Float, nil] + optional :last_unit, Float, nil?: true + + # @!parse + # # @param first_unit [Float] + # # @param unit_amount [String] + # # @param last_unit [Float, nil] + # # + # def initialize(first_unit:, unit_amount:, last_unit: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tiered_bps_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::Cadence, + # item_id: String, + # model_type: :tiered_bps, + # name: String, + # tiered_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + # **_ + # } + # ``` + class NewSubscriptionTieredBpsPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_bps] + required :model_type, const: :tiered_bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_bps_config + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig] + required :tiered_bps_config, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig } + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_bps_config [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered_bps] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_bps_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered_bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # tiered_bps_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] === _1 } + # } + # ``` + class TieredBpsConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + # tiers + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # bps: Float, + # minimum_amount: String, + # maximum_amount: String, + # per_unit_maximum: String + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute bps + # Per-event basis point rate + # + # @return [Float] + required :bps, Float + + # @!attribute minimum_amount + # Inclusive tier starting value + # + # @return [String] + required :minimum_amount, String + + # @!attribute maximum_amount + # Exclusive tier ending value + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute per_unit_maximum + # Per unit maximum to charge + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param minimum_amount [String] + # # @param maximum_amount [String, nil] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_bps_price => { + # bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig, + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::Cadence, + # item_id: String, + # model_type: :bps, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionBpsPrice < Orb::BaseModel + # @!attribute bps_config + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig] + required :bps_config, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bps] + required :model_type, const: :bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param bps_config [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig] + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :bps] + # # + # def initialize( + # bps_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bps_config => { + # bps: Float, + # per_unit_maximum: String + # } + # ``` + class BpsConfig < Orb::BaseModel + # @!attribute bps + # Basis point take rate per event + # + # @return [Float] + required :bps, Float + + # @!attribute per_unit_maximum + # Optional currency amount maximum to cap spend per event + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_bulk_bps_price => { + # bulk_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::Cadence, + # item_id: String, + # model_type: :bulk_bps, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionBulkBpsPrice < Orb::BaseModel + # @!attribute bulk_bps_config + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig] + required :bulk_bps_config, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk_bps] + required :model_type, const: :bulk_bps + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param bulk_bps_config [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig] + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :bulk_bps] + # # + # def initialize( + # bulk_bps_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :bulk_bps, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bulk_bps_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] === _1 } + # } + # ``` + class BulkBpsConfig < Orb::BaseModel + # @!attribute tiers + # Tiers for a bulk BPS pricing model where all usage is aggregated to a single + # tier based on total volume + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # bps: Float, + # maximum_amount: String, + # per_unit_maximum: String + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute bps + # Basis points to rate on + # + # @return [Float] + required :bps, Float + + # @!attribute maximum_amount + # Upper bound for tier + # + # @return [String, nil] + optional :maximum_amount, String, nil?: true + + # @!attribute per_unit_maximum + # The maximum amount to charge for any one event + # + # @return [String, nil] + optional :per_unit_maximum, String, nil?: true + + # @!parse + # # @param bps [Float] + # # @param maximum_amount [String, nil] + # # @param per_unit_maximum [String, nil] + # # + # def initialize(bps:, maximum_amount: nil, per_unit_maximum: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_bulk_price => { + # bulk_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig, + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::Cadence, + # item_id: String, + # model_type: :bulk, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionBulkPrice < Orb::BaseModel + # @!attribute bulk_config + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig] + required :bulk_config, + -> { Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig } + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk] + required :model_type, const: :bulk + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param bulk_config [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig] + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :bulk] + # # + # def initialize( + # bulk_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :bulk, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # bulk_config => { + # tiers: -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] === _1 } + # } + # ``` + class BulkConfig < Orb::BaseModel + # @!attribute tiers + # Bulk tiers for rating based on total usage volume + # + # @return [Array] + required :tiers, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + } + + # @!parse + # # @param tiers [Array] + # # + # def initialize(tiers:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # tier => { + # unit_amount: String, + # maximum_units: Float + # } + # ``` + class Tier < Orb::BaseModel + # @!attribute unit_amount + # Amount per unit + # + # @return [String] + required :unit_amount, String + + # @!attribute maximum_units + # Upper bound for this tier + # + # @return [Float, nil] + optional :maximum_units, Float, nil?: true + + # @!parse + # # @param unit_amount [String] + # # @param maximum_units [Float, nil] + # # + # def initialize(unit_amount:, maximum_units: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_threshold_total_amount_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence, + # item_id: String, + # model_type: :threshold_total_amount, + # name: String, + # threshold_total_amount_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionThresholdTotalAmountPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :threshold_total_amount] + required :model_type, const: :threshold_total_amount + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute threshold_total_amount_config + # + # @return [Hash{Symbol=>Object}] + required :threshold_total_amount_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param threshold_total_amount_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :threshold_total_amount] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # threshold_total_amount_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :threshold_total_amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tiered_package_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::Cadence, + # item_id: String, + # model_type: :tiered_package, + # name: String, + # tiered_package_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionTieredPackagePrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_package] + required :model_type, const: :tiered_package + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_package_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_package_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_package_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered_package] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_package_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered_package, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tiered_with_minimum_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence, + # item_id: String, + # model_type: :tiered_with_minimum, + # name: String, + # tiered_with_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionTieredWithMinimumPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_with_minimum] + required :model_type, const: :tiered_with_minimum + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_with_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_with_minimum_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered_with_minimum] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_with_minimum_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered_with_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_unit_with_percent_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence, + # item_id: String, + # model_type: :unit_with_percent, + # name: String, + # unit_with_percent_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionUnitWithPercentPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit_with_percent] + required :model_type, const: :unit_with_percent + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_with_percent_config + # + # @return [Hash{Symbol=>Object}] + required :unit_with_percent_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param unit_with_percent_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :unit_with_percent] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # unit_with_percent_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :unit_with_percent, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_package_with_allocation_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence, + # item_id: String, + # model_type: :package_with_allocation, + # name: String, + # package_with_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionPackageWithAllocationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :package_with_allocation] + required :model_type, const: :package_with_allocation + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute package_with_allocation_config + # + # @return [Hash{Symbol=>Object}] + required :package_with_allocation_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param package_with_allocation_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :package_with_allocation] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # package_with_allocation_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :package_with_allocation, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_tier_with_proration_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::Cadence, + # item_id: String, + # model_type: :tiered_with_proration, + # name: String, + # tiered_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionTierWithProrationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :tiered_with_proration] + required :model_type, const: :tiered_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute tiered_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :tiered_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param tiered_with_proration_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :tiered_with_proration] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # tiered_with_proration_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :tiered_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_unit_with_proration_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence, + # item_id: String, + # model_type: :unit_with_proration, + # name: String, + # unit_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # **_ + # } + # ``` + class NewSubscriptionUnitWithProrationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :unit_with_proration] + required :model_type, const: :unit_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute unit_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :unit_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param unit_with_proration_config [Hash{Symbol=>Object}] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :unit_with_proration] + # # + # def initialize( + # cadence:, + # item_id:, + # name:, + # unit_with_proration_config:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :unit_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_grouped_allocation_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence, + # grouped_allocation_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_allocation, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionGroupedAllocationPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence + } + + # @!attribute grouped_allocation_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_allocation_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_allocation] + required :model_type, const: :grouped_allocation + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::Cadence] + # # @param grouped_allocation_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :grouped_allocation] + # # + # def initialize( + # cadence:, + # grouped_allocation_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :grouped_allocation, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_grouped_with_prorated_minimum_price => { + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence, + # grouped_with_prorated_minimum_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # item_id: String, + # model_type: :grouped_with_prorated_minimum, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionGroupedWithProratedMinimumPrice < Orb::BaseModel + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence + } + + # @!attribute grouped_with_prorated_minimum_config + # + # @return [Hash{Symbol=>Object}] + required :grouped_with_prorated_minimum_config, Orb::HashOf[Orb::Unknown] + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :grouped_with_prorated_minimum] + required :model_type, const: :grouped_with_prorated_minimum + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Cadence] + # # @param grouped_with_prorated_minimum_config [Hash{Symbol=>Object}] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :grouped_with_prorated_minimum] + # # + # def initialize( + # cadence:, + # grouped_with_prorated_minimum_config:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :grouped_with_prorated_minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # new_subscription_bulk_with_proration_price => { + # bulk_with_proration_config: -> { Orb::HashOf[Orb::Unknown] === _1 }, + # cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence, + # item_id: String, + # model_type: :bulk_with_proration, + # name: String, + # **_ + # } + # ``` + class NewSubscriptionBulkWithProrationPrice < Orb::BaseModel + # @!attribute bulk_with_proration_config + # + # @return [Hash{Symbol=>Object}] + required :bulk_with_proration_config, Orb::HashOf[Orb::Unknown] + + # @!attribute cadence + # The cadence to bill for this price on. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence] + required :cadence, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence + } + + # @!attribute item_id + # The id of the item the plan will be associated with. + # + # @return [String] + required :item_id, String + + # @!attribute model_type + # + # @return [Symbol, :bulk_with_proration] + required :model_type, const: :bulk_with_proration + + # @!attribute name + # The name of the price. + # + # @return [String] + required :name, String + + # @!attribute billable_metric_id + # The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @return [String, nil] + optional :billable_metric_id, String, nil?: true + + # @!attribute billed_in_advance + # If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @return [Boolean, nil] + optional :billed_in_advance, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_configuration + # For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration, nil] + optional :billing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration + }, + nil?: true + + # @!attribute conversion_rate + # The per unit conversion rate of the price currency to the invoicing currency. + # + # @return [Float, nil] + optional :conversion_rate, Float, nil?: true + + # @!attribute currency + # An ISO 4217 currency string, or custom pricing unit identifier, in which this + # price is billed. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute external_price_id + # An alias for the price. + # + # @return [String, nil] + optional :external_price_id, String, nil?: true + + # @!attribute fixed_price_quantity + # If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @return [Float, nil] + optional :fixed_price_quantity, Float, nil?: true + + # @!attribute invoice_grouping_key + # The property used to group this price on an invoice + # + # @return [String, nil] + optional :invoice_grouping_key, String, nil?: true + + # @!attribute invoicing_cycle_configuration + # Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration, nil] + optional :invoicing_cycle_configuration, + -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration + }, + nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute reference_id + # A transient ID that can be used to reference this price when adding adjustments + # in the same API call. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!parse + # # @param bulk_with_proration_config [Hash{Symbol=>Object}] + # # @param cadence [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::Cadence] + # # @param item_id [String] + # # @param name [String] + # # @param billable_metric_id [String, nil] + # # @param billed_in_advance [Boolean, nil] + # # @param billing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration, nil] + # # @param conversion_rate [Float, nil] + # # @param currency [String, nil] + # # @param external_price_id [String, nil] + # # @param fixed_price_quantity [Float, nil] + # # @param invoice_grouping_key [String, nil] + # # @param invoicing_cycle_configuration [Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param reference_id [String, nil] + # # @param model_type [Symbol, :bulk_with_proration] + # # + # def initialize( + # bulk_with_proration_config:, + # cadence:, + # item_id:, + # name:, + # billable_metric_id: nil, + # billed_in_advance: nil, + # billing_cycle_configuration: nil, + # conversion_rate: nil, + # currency: nil, + # external_price_id: nil, + # fixed_price_quantity: nil, + # invoice_grouping_key: nil, + # invoicing_cycle_configuration: nil, + # metadata: nil, + # reference_id: nil, + # model_type: :bulk_with_proration, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The cadence to bill for this price on. + # + # @example + # ```ruby + # case cadence + # in :annual + # # ... + # in :semi_annual + # # ... + # in :monthly + # # ... + # in :quarterly + # # ... + # in :one_time + # # ... + # in ... + # #... + # end + # ``` + class Cadence < Orb::Enum + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # billing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit + # } + # ``` + class BillingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit + } + + # @!parse + # # For custom cadence: specifies the duration of the billing period in days or + # # months. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @example + # ```ruby + # invoicing_cycle_configuration => { + # duration: Integer, + # duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + # } + # ``` + class InvoicingCycleConfiguration < Orb::BaseModel + # @!attribute duration + # The duration of the billing period. + # + # @return [Integer] + required :duration, Integer + + # @!attribute duration_unit + # The unit of billing period duration. + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + required :duration_unit, + enum: -> { + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit + } + + # @!parse + # # Within each billing cycle, specifies the cadence at which invoices are produced. + # # If unspecified, a single invoice is produced per billing cycle. + # # + # # @param duration [Integer] + # # @param duration_unit [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::DurationUnit] + # # + # def initialize(duration:, duration_unit:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The unit of billing period duration. + # + # @example + # ```ruby + # case duration_unit + # in :day + # # ... + # in :month + # # ... + # end + # ``` + class DurationUnit < Orb::Enum + DAY = :day + MONTH = :month + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end + end + end +end diff --git a/lib/orb/models/subscription_schedule_plan_change_response.rb b/lib/orb/models/subscription_schedule_plan_change_response.rb new file mode 100644 index 00000000..71dff21a --- /dev/null +++ b/lib/orb/models/subscription_schedule_plan_change_response.rb @@ -0,0 +1,1442 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # subscription_schedule_plan_change_response => { + # id: String, + # active_plan_phase_order: Integer, + # adjustment_intervals: -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval] === _1 }, + # auto_collection: Orb::BooleanModel, + # billing_cycle_anchor_configuration: Orb::Models::SubscriptionSchedulePlanChangeResponse::BillingCycleAnchorConfiguration, + # **_ + # } + # ``` + class SubscriptionSchedulePlanChangeResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute active_plan_phase_order + # The current plan phase that is active, only if the subscription's plan has + # phases. + # + # @return [Integer, nil] + required :active_plan_phase_order, Integer, nil?: true + + # @!attribute adjustment_intervals + # The adjustment intervals for this subscription. + # + # @return [Array] + required :adjustment_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval] } + + # @!attribute auto_collection + # Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. This property defaults to + # the plan's behavior. If null, defaults to the customer's setting. + # + # @return [Boolean, nil] + required :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_anchor_configuration + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeResponse::BillingCycleAnchorConfiguration] + required :billing_cycle_anchor_configuration, + -> { Orb::Models::SubscriptionSchedulePlanChangeResponse::BillingCycleAnchorConfiguration } + + # @!attribute billing_cycle_day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is not part of the billing period. Set to null for + # subscriptions that are not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if the subscription is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute customer + # A customer is a buyer of your products, and the other party to the billing + # relationship. + # + # In Orb, customers are assigned system generated identifiers automatically, but + # it's often desirable to have these match existing identifiers in your system. To + # avoid having to denormalize Orb ID information, you can pass in an + # `external_customer_id` with your own identifier. See + # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + # information about how these aliases work in Orb. + # + # In addition to having an identifier in your system, a customer may exist in a + # payment provider solution like Stripe. Use the `payment_provider_id` and the + # `payment_provider` enum field to express this mapping. + # + # A customer also has a timezone (from the standard + # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + # your account's timezone. See [Timezone localization](/essentials/timezones) for + # information on what this timezone parameter influences within Orb. + # + # @return [Orb::Models::Customer] + required :customer, -> { Orb::Models::Customer } + + # @!attribute default_invoice_memo + # Determines the default memo on this subscriptions' invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @return [String, nil] + required :default_invoice_memo, String, nil?: true + + # @!attribute discount_intervals + # The discount intervals for this subscription. + # + # @return [Array] + required :discount_intervals, + -> { + Orb::ArrayOf[union: Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval] + } + + # @!attribute end_date + # The date Orb stops billing for this subscription. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_schedule + # + # @return [Array] + required :fixed_fee_quantity_schedule, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeResponse::FixedFeeQuantitySchedule] + } + + # @!attribute invoicing_threshold + # + # @return [String, nil] + required :invoicing_threshold, String, nil?: true + + # @!attribute maximum_intervals + # The maximum intervals for this subscription. + # + # @return [Array] + required :maximum_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeResponse::MaximumInterval] } + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum_intervals + # The minimum intervals for this subscription. + # + # @return [Array] + required :minimum_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeResponse::MinimumInterval] } + + # @!attribute net_terms + # Determines the difference between the invoice issue date for subscription + # invoices as the date that they are due. A value of `0` here represents that the + # invoice is due on issue, whereas a value of `30` represents that the customer + # has a month to pay the invoice. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute plan + # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + # subscribed to by a customer. Plans define the billing behavior of the + # subscription. You can see more about how to configure prices in the + # [Price resource](/reference/price). + # + # @return [Orb::Models::Plan] + required :plan, -> { Orb::Models::Plan } + + # @!attribute price_intervals + # The price intervals for this subscription. + # + # @return [Array] + required :price_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval] } + + # @!attribute redeemed_coupon + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeResponse::RedeemedCoupon, nil] + required :redeemed_coupon, + -> { Orb::Models::SubscriptionSchedulePlanChangeResponse::RedeemedCoupon }, + nil?: true + + # @!attribute start_date + # The date Orb starts billing for this subscription. + # + # @return [Time] + required :start_date, Time + + # @!attribute status + # + # @return [Symbol, Orb::Models::SubscriptionSchedulePlanChangeResponse::Status] + required :status, enum: -> { Orb::Models::SubscriptionSchedulePlanChangeResponse::Status } + + # @!attribute trial_info + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeResponse::TrialInfo] + required :trial_info, -> { Orb::Models::SubscriptionSchedulePlanChangeResponse::TrialInfo } + + # @!parse + # # @param id [String] + # # @param active_plan_phase_order [Integer, nil] + # # @param adjustment_intervals [Array] + # # @param auto_collection [Boolean, nil] + # # @param billing_cycle_anchor_configuration [Orb::Models::SubscriptionSchedulePlanChangeResponse::BillingCycleAnchorConfiguration] + # # @param billing_cycle_day [Integer] + # # @param created_at [Time] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param customer [Orb::Models::Customer] + # # @param default_invoice_memo [String, nil] + # # @param discount_intervals [Array] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_schedule [Array] + # # @param invoicing_threshold [String, nil] + # # @param maximum_intervals [Array] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum_intervals [Array] + # # @param net_terms [Integer] + # # @param plan [Orb::Models::Plan] + # # @param price_intervals [Array] + # # @param redeemed_coupon [Orb::Models::SubscriptionSchedulePlanChangeResponse::RedeemedCoupon, nil] + # # @param start_date [Time] + # # @param status [Symbol, Orb::Models::SubscriptionSchedulePlanChangeResponse::Status] + # # @param trial_info [Orb::Models::SubscriptionSchedulePlanChangeResponse::TrialInfo] + # # + # def initialize( + # id:, + # active_plan_phase_order:, + # adjustment_intervals:, + # auto_collection:, + # billing_cycle_anchor_configuration:, + # billing_cycle_day:, + # created_at:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # customer:, + # default_invoice_memo:, + # discount_intervals:, + # end_date:, + # fixed_fee_quantity_schedule:, + # invoicing_threshold:, + # maximum_intervals:, + # metadata:, + # minimum_intervals:, + # net_terms:, + # plan:, + # price_intervals:, + # redeemed_coupon:, + # start_date:, + # status:, + # trial_info:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # adjustment_interval => { + # id: String, + # adjustment: Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # start_date: Time + # } + # ``` + class AdjustmentInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + required :adjustment, + union: -> { + Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment + } + + # @!attribute applies_to_price_interval_ids + # The price interval IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the adjustment interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the adjustment interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param id [String] + # # @param adjustment [Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "amount_discount", id: String, amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment ... + # in {adjustment_type: "percentage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment ... + # in {adjustment_type: "usage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment ... + # in {adjustment_type: "minimum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MinimumAdjustment ... + # in {adjustment_type: "maximum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MaximumAdjustment ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :amount_discount, + -> { Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment } + + variant :percentage_discount, + -> { Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment } + + variant :usage_discount, + -> { Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment } + + variant :minimum, + -> { Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MinimumAdjustment } + + variant :maximum, + -> { Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MaximumAdjustment } + + # @example + # ```ruby + # amount_discount_adjustment => { + # id: String, + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # **_ + # } + # ``` + class AmountDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # The amount by which to discount the prices this adjustment applies to in a given + # billing period. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize( + # id:, + # amount_discount:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # adjustment_type: :amount_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_adjustment => { + # id: String, + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # percentage_discount: Float, + # **_ + # } + # ``` + class PercentageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute percentage_discount + # The percentage (as a value between 0 and 1) by which to discount the price + # intervals this adjustment applies to in a given billing period. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param percentage_discount [Float] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # percentage_discount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_adjustment => { + # id: String, + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # plan_phase_order: Integer, + # **_ + # } + # ``` + class UsageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute usage_discount + # The number of usage units by which to discount the price this adjustment applies + # to in a given billing period. + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param usage_discount [Float] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # usage_discount:, + # adjustment_type: :usage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_adjustment => { + # id: String, + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # item_id: String, + # **_ + # } + # ``` + class MinimumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # item_id:, + # minimum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_adjustment => { + # id: String, + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # maximum_amount: String, + # **_ + # } + # ``` + class MaximumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param maximum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # maximum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :maximum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # billing_cycle_anchor_configuration => { + # day: Integer, + # month: Integer, + # year: Integer + # } + # ``` + class BillingCycleAnchorConfiguration < Orb::BaseModel + # @!attribute day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :day, Integer + + # @!attribute month + # The month on which the billing cycle is anchored (e.g. a quarterly price + # anchored in February would have cycles starting February, May, August, and + # November). + # + # @return [Integer, nil] + optional :month, Integer, nil?: true + + # @!attribute year + # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle + # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + # + # @return [Integer, nil] + optional :year, Integer, nil?: true + + # @!parse + # # @param day [Integer] + # # @param month [Integer, nil] + # # @param year [Integer, nil] + # # + # def initialize(day:, month: nil, year: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case discount_interval + # in {discount_type: "amount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::AmountDiscountInterval ... + # in {discount_type: "percentage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::PercentageDiscountInterval ... + # in {discount_type: "usage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::UsageDiscountInterval ... + # end + # ``` + # + # @example + # ```ruby + # case discount_interval + # in Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::AmountDiscountInterval + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::PercentageDiscountInterval + # # ... + # in Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::UsageDiscountInterval + # # ... + # end + # ``` + class DiscountInterval < Orb::Union + discriminator :discount_type + + variant :amount, + -> { Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::AmountDiscountInterval } + + variant :percentage, + -> { Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::PercentageDiscountInterval } + + variant :usage, + -> { Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::UsageDiscountInterval } + + # @example + # ```ruby + # amount_discount_interval => { + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :amount, + # end_date: Time + # } + # ``` + class AmountDiscountInterval < Orb::BaseModel + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :amount] + required :discount_type, const: :amount + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param discount_type [Symbol, :amount] + # # + # def initialize( + # amount_discount:, + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # discount_type: :amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :percentage, + # end_date: Time, + # percentage_discount: Float + # } + # ``` + class PercentageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :percentage] + required :discount_type, const: :percentage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`.This is a number between 0 + # and 1. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param percentage_discount [Float] + # # @param start_date [Time] + # # @param discount_type [Symbol, :percentage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # percentage_discount:, + # start_date:, + # discount_type: :percentage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :usage, + # end_date: Time, + # start_date: Time + # } + # ``` + class UsageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :usage] + required :discount_type, const: :usage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param usage_discount [Float] + # # @param discount_type [Symbol, :usage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # usage_discount:, + # discount_type: :usage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # fixed_fee_quantity_schedule => { + # end_date: Time, + # price_id: String, + # quantity: Float, + # start_date: Time + # } + # ``` + class FixedFeeQuantitySchedule < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param end_date [Time, nil] + # # @param price_id [String] + # # @param quantity [Float] + # # @param start_date [Time] + # # + # def initialize(end_date:, price_id:, quantity:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # maximum_amount: String, + # start_date: Time + # } + # ``` + class MaximumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the maximum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the price intervals + # this transform applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute start_date + # The start date of the maximum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param maximum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, maximum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # minimum_amount: String, + # start_date: Time + # } + # ``` + class MinimumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the minimum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the price intervals + # this minimum applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute start_date + # The start date of the minimum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param minimum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, minimum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # price_interval => { + # id: String, + # billing_cycle_day: Integer, + # current_billing_period_end_date: Time, + # current_billing_period_start_date: Time, + # end_date: Time, + # **_ + # } + # ``` + class PriceInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billing_cycle_day + # The day of the month that Orb bills for this price + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is exactly the end of the billing period. Set to null if + # this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute end_date + # The end date of the price interval. This is the date that Orb stops billing for + # this price. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_transitions + # The fixed fee quantity transitions for this price interval. This is only + # relevant for fixed fees. + # + # @return [Array, nil] + required :fixed_fee_quantity_transitions, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval::FixedFeeQuantityTransition] + }, + nil?: true + + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + required :price, union: -> { Orb::Models::Price } + + # @!attribute start_date + # The start date of the price interval. This is the date that Orb starts billing + # for this price. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # The Price Interval resource represents a period of time for which a price will + # # bill on a subscription. A subscription’s price intervals define its billing + # # behavior. + # # + # # @param id [String] + # # @param billing_cycle_day [Integer] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_transitions [Array, nil] + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # # @param start_date [Time] + # # + # def initialize( + # id:, + # billing_cycle_day:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # end_date:, + # fixed_fee_quantity_transitions:, + # price:, + # start_date:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # fixed_fee_quantity_transition => { + # effective_date: Time, + # price_id: String, + # quantity: Integer + # } + # ``` + class FixedFeeQuantityTransition < Orb::BaseModel + # @!attribute effective_date + # + # @return [Time] + required :effective_date, Time + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Integer] + required :quantity, Integer + + # @!parse + # # @param effective_date [Time] + # # @param price_id [String] + # # @param quantity [Integer] + # # + # def initialize(effective_date:, price_id:, quantity:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # redeemed_coupon => { + # coupon_id: String, + # end_date: Time, + # start_date: Time + # } + # ``` + class RedeemedCoupon < Orb::BaseModel + # @!attribute coupon_id + # + # @return [String] + required :coupon_id, String + + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param coupon_id [String] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(coupon_id:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :ended + # # ... + # in :upcoming + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # trial_info => { + # end_date: Time + # } + # ``` + class TrialInfo < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!parse + # # @param end_date [Time, nil] + # # + # def initialize(end_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/subscription_trigger_phase_params.rb b/lib/orb/models/subscription_trigger_phase_params.rb new file mode 100644 index 00000000..f5c835f8 --- /dev/null +++ b/lib/orb/models/subscription_trigger_phase_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Orb + module Models + class SubscriptionTriggerPhaseParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute effective_date + # The date on which the phase change should take effect. If not provided, defaults + # to today in the customer's timezone. + # + # @return [Date, nil] + optional :effective_date, Date, nil?: true + + # @!parse + # # @param effective_date [Date, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(effective_date: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/subscription_trigger_phase_response.rb b/lib/orb/models/subscription_trigger_phase_response.rb new file mode 100644 index 00000000..dd2a3912 --- /dev/null +++ b/lib/orb/models/subscription_trigger_phase_response.rb @@ -0,0 +1,1436 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # subscription_trigger_phase_response => { + # id: String, + # active_plan_phase_order: Integer, + # adjustment_intervals: -> { Orb::ArrayOf[Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval] === _1 }, + # auto_collection: Orb::BooleanModel, + # billing_cycle_anchor_configuration: Orb::Models::SubscriptionTriggerPhaseResponse::BillingCycleAnchorConfiguration, + # **_ + # } + # ``` + class SubscriptionTriggerPhaseResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute active_plan_phase_order + # The current plan phase that is active, only if the subscription's plan has + # phases. + # + # @return [Integer, nil] + required :active_plan_phase_order, Integer, nil?: true + + # @!attribute adjustment_intervals + # The adjustment intervals for this subscription. + # + # @return [Array] + required :adjustment_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval] } + + # @!attribute auto_collection + # Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. This property defaults to + # the plan's behavior. If null, defaults to the customer's setting. + # + # @return [Boolean, nil] + required :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_anchor_configuration + # + # @return [Orb::Models::SubscriptionTriggerPhaseResponse::BillingCycleAnchorConfiguration] + required :billing_cycle_anchor_configuration, + -> { Orb::Models::SubscriptionTriggerPhaseResponse::BillingCycleAnchorConfiguration } + + # @!attribute billing_cycle_day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is not part of the billing period. Set to null for + # subscriptions that are not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if the subscription is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute customer + # A customer is a buyer of your products, and the other party to the billing + # relationship. + # + # In Orb, customers are assigned system generated identifiers automatically, but + # it's often desirable to have these match existing identifiers in your system. To + # avoid having to denormalize Orb ID information, you can pass in an + # `external_customer_id` with your own identifier. See + # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + # information about how these aliases work in Orb. + # + # In addition to having an identifier in your system, a customer may exist in a + # payment provider solution like Stripe. Use the `payment_provider_id` and the + # `payment_provider` enum field to express this mapping. + # + # A customer also has a timezone (from the standard + # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + # your account's timezone. See [Timezone localization](/essentials/timezones) for + # information on what this timezone parameter influences within Orb. + # + # @return [Orb::Models::Customer] + required :customer, -> { Orb::Models::Customer } + + # @!attribute default_invoice_memo + # Determines the default memo on this subscriptions' invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @return [String, nil] + required :default_invoice_memo, String, nil?: true + + # @!attribute discount_intervals + # The discount intervals for this subscription. + # + # @return [Array] + required :discount_intervals, + -> { Orb::ArrayOf[union: Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval] } + + # @!attribute end_date + # The date Orb stops billing for this subscription. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_schedule + # + # @return [Array] + required :fixed_fee_quantity_schedule, + -> { Orb::ArrayOf[Orb::Models::SubscriptionTriggerPhaseResponse::FixedFeeQuantitySchedule] } + + # @!attribute invoicing_threshold + # + # @return [String, nil] + required :invoicing_threshold, String, nil?: true + + # @!attribute maximum_intervals + # The maximum intervals for this subscription. + # + # @return [Array] + required :maximum_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionTriggerPhaseResponse::MaximumInterval] } + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum_intervals + # The minimum intervals for this subscription. + # + # @return [Array] + required :minimum_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionTriggerPhaseResponse::MinimumInterval] } + + # @!attribute net_terms + # Determines the difference between the invoice issue date for subscription + # invoices as the date that they are due. A value of `0` here represents that the + # invoice is due on issue, whereas a value of `30` represents that the customer + # has a month to pay the invoice. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute plan + # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + # subscribed to by a customer. Plans define the billing behavior of the + # subscription. You can see more about how to configure prices in the + # [Price resource](/reference/price). + # + # @return [Orb::Models::Plan] + required :plan, -> { Orb::Models::Plan } + + # @!attribute price_intervals + # The price intervals for this subscription. + # + # @return [Array] + required :price_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval] } + + # @!attribute redeemed_coupon + # + # @return [Orb::Models::SubscriptionTriggerPhaseResponse::RedeemedCoupon, nil] + required :redeemed_coupon, + -> { Orb::Models::SubscriptionTriggerPhaseResponse::RedeemedCoupon }, + nil?: true + + # @!attribute start_date + # The date Orb starts billing for this subscription. + # + # @return [Time] + required :start_date, Time + + # @!attribute status + # + # @return [Symbol, Orb::Models::SubscriptionTriggerPhaseResponse::Status] + required :status, enum: -> { Orb::Models::SubscriptionTriggerPhaseResponse::Status } + + # @!attribute trial_info + # + # @return [Orb::Models::SubscriptionTriggerPhaseResponse::TrialInfo] + required :trial_info, -> { Orb::Models::SubscriptionTriggerPhaseResponse::TrialInfo } + + # @!parse + # # @param id [String] + # # @param active_plan_phase_order [Integer, nil] + # # @param adjustment_intervals [Array] + # # @param auto_collection [Boolean, nil] + # # @param billing_cycle_anchor_configuration [Orb::Models::SubscriptionTriggerPhaseResponse::BillingCycleAnchorConfiguration] + # # @param billing_cycle_day [Integer] + # # @param created_at [Time] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param customer [Orb::Models::Customer] + # # @param default_invoice_memo [String, nil] + # # @param discount_intervals [Array] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_schedule [Array] + # # @param invoicing_threshold [String, nil] + # # @param maximum_intervals [Array] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum_intervals [Array] + # # @param net_terms [Integer] + # # @param plan [Orb::Models::Plan] + # # @param price_intervals [Array] + # # @param redeemed_coupon [Orb::Models::SubscriptionTriggerPhaseResponse::RedeemedCoupon, nil] + # # @param start_date [Time] + # # @param status [Symbol, Orb::Models::SubscriptionTriggerPhaseResponse::Status] + # # @param trial_info [Orb::Models::SubscriptionTriggerPhaseResponse::TrialInfo] + # # + # def initialize( + # id:, + # active_plan_phase_order:, + # adjustment_intervals:, + # auto_collection:, + # billing_cycle_anchor_configuration:, + # billing_cycle_day:, + # created_at:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # customer:, + # default_invoice_memo:, + # discount_intervals:, + # end_date:, + # fixed_fee_quantity_schedule:, + # invoicing_threshold:, + # maximum_intervals:, + # metadata:, + # minimum_intervals:, + # net_terms:, + # plan:, + # price_intervals:, + # redeemed_coupon:, + # start_date:, + # status:, + # trial_info:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # adjustment_interval => { + # id: String, + # adjustment: Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # start_date: Time + # } + # ``` + class AdjustmentInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment + # + # @return [Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + required :adjustment, + union: -> { Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment } + + # @!attribute applies_to_price_interval_ids + # The price interval IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the adjustment interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the adjustment interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param id [String] + # # @param adjustment [Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "amount_discount", id: String, amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment ... + # in {adjustment_type: "percentage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment ... + # in {adjustment_type: "usage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment ... + # in {adjustment_type: "minimum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MinimumAdjustment ... + # in {adjustment_type: "maximum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MaximumAdjustment ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + # # ... + # in Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :amount_discount, + -> { Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment } + + variant :percentage_discount, + -> { Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment } + + variant :usage_discount, + -> { Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment } + + variant :minimum, + -> { Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MinimumAdjustment } + + variant :maximum, + -> { Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MaximumAdjustment } + + # @example + # ```ruby + # amount_discount_adjustment => { + # id: String, + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # **_ + # } + # ``` + class AmountDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # The amount by which to discount the prices this adjustment applies to in a given + # billing period. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize( + # id:, + # amount_discount:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # adjustment_type: :amount_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_adjustment => { + # id: String, + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # percentage_discount: Float, + # **_ + # } + # ``` + class PercentageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute percentage_discount + # The percentage (as a value between 0 and 1) by which to discount the price + # intervals this adjustment applies to in a given billing period. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param percentage_discount [Float] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # percentage_discount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_adjustment => { + # id: String, + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # plan_phase_order: Integer, + # **_ + # } + # ``` + class UsageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute usage_discount + # The number of usage units by which to discount the price this adjustment applies + # to in a given billing period. + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param usage_discount [Float] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # usage_discount:, + # adjustment_type: :usage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_adjustment => { + # id: String, + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # item_id: String, + # **_ + # } + # ``` + class MinimumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # item_id:, + # minimum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_adjustment => { + # id: String, + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # maximum_amount: String, + # **_ + # } + # ``` + class MaximumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param maximum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # maximum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :maximum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # billing_cycle_anchor_configuration => { + # day: Integer, + # month: Integer, + # year: Integer + # } + # ``` + class BillingCycleAnchorConfiguration < Orb::BaseModel + # @!attribute day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :day, Integer + + # @!attribute month + # The month on which the billing cycle is anchored (e.g. a quarterly price + # anchored in February would have cycles starting February, May, August, and + # November). + # + # @return [Integer, nil] + optional :month, Integer, nil?: true + + # @!attribute year + # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle + # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + # + # @return [Integer, nil] + optional :year, Integer, nil?: true + + # @!parse + # # @param day [Integer] + # # @param month [Integer, nil] + # # @param year [Integer, nil] + # # + # def initialize(day:, month: nil, year: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case discount_interval + # in {discount_type: "amount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::AmountDiscountInterval ... + # in {discount_type: "percentage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::PercentageDiscountInterval ... + # in {discount_type: "usage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::UsageDiscountInterval ... + # end + # ``` + # + # @example + # ```ruby + # case discount_interval + # in Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::AmountDiscountInterval + # # ... + # in Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::PercentageDiscountInterval + # # ... + # in Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::UsageDiscountInterval + # # ... + # end + # ``` + class DiscountInterval < Orb::Union + discriminator :discount_type + + variant :amount, + -> { Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::AmountDiscountInterval } + + variant :percentage, + -> { Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::PercentageDiscountInterval } + + variant :usage, + -> { Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::UsageDiscountInterval } + + # @example + # ```ruby + # amount_discount_interval => { + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :amount, + # end_date: Time + # } + # ``` + class AmountDiscountInterval < Orb::BaseModel + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :amount] + required :discount_type, const: :amount + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param discount_type [Symbol, :amount] + # # + # def initialize( + # amount_discount:, + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # discount_type: :amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :percentage, + # end_date: Time, + # percentage_discount: Float + # } + # ``` + class PercentageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :percentage] + required :discount_type, const: :percentage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`.This is a number between 0 + # and 1. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param percentage_discount [Float] + # # @param start_date [Time] + # # @param discount_type [Symbol, :percentage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # percentage_discount:, + # start_date:, + # discount_type: :percentage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :usage, + # end_date: Time, + # start_date: Time + # } + # ``` + class UsageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :usage] + required :discount_type, const: :usage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param usage_discount [Float] + # # @param discount_type [Symbol, :usage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # usage_discount:, + # discount_type: :usage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # fixed_fee_quantity_schedule => { + # end_date: Time, + # price_id: String, + # quantity: Float, + # start_date: Time + # } + # ``` + class FixedFeeQuantitySchedule < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param end_date [Time, nil] + # # @param price_id [String] + # # @param quantity [Float] + # # @param start_date [Time] + # # + # def initialize(end_date:, price_id:, quantity:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # maximum_amount: String, + # start_date: Time + # } + # ``` + class MaximumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the maximum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the price intervals + # this transform applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute start_date + # The start date of the maximum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param maximum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, maximum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # minimum_amount: String, + # start_date: Time + # } + # ``` + class MinimumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the minimum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the price intervals + # this minimum applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute start_date + # The start date of the minimum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param minimum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, minimum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # price_interval => { + # id: String, + # billing_cycle_day: Integer, + # current_billing_period_end_date: Time, + # current_billing_period_start_date: Time, + # end_date: Time, + # **_ + # } + # ``` + class PriceInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billing_cycle_day + # The day of the month that Orb bills for this price + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is exactly the end of the billing period. Set to null if + # this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute end_date + # The end date of the price interval. This is the date that Orb stops billing for + # this price. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_transitions + # The fixed fee quantity transitions for this price interval. This is only + # relevant for fixed fees. + # + # @return [Array, nil] + required :fixed_fee_quantity_transitions, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval::FixedFeeQuantityTransition] + }, + nil?: true + + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + required :price, union: -> { Orb::Models::Price } + + # @!attribute start_date + # The start date of the price interval. This is the date that Orb starts billing + # for this price. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # The Price Interval resource represents a period of time for which a price will + # # bill on a subscription. A subscription’s price intervals define its billing + # # behavior. + # # + # # @param id [String] + # # @param billing_cycle_day [Integer] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_transitions [Array, nil] + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # # @param start_date [Time] + # # + # def initialize( + # id:, + # billing_cycle_day:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # end_date:, + # fixed_fee_quantity_transitions:, + # price:, + # start_date:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # fixed_fee_quantity_transition => { + # effective_date: Time, + # price_id: String, + # quantity: Integer + # } + # ``` + class FixedFeeQuantityTransition < Orb::BaseModel + # @!attribute effective_date + # + # @return [Time] + required :effective_date, Time + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Integer] + required :quantity, Integer + + # @!parse + # # @param effective_date [Time] + # # @param price_id [String] + # # @param quantity [Integer] + # # + # def initialize(effective_date:, price_id:, quantity:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # redeemed_coupon => { + # coupon_id: String, + # end_date: Time, + # start_date: Time + # } + # ``` + class RedeemedCoupon < Orb::BaseModel + # @!attribute coupon_id + # + # @return [String] + required :coupon_id, String + + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param coupon_id [String] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(coupon_id:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :ended + # # ... + # in :upcoming + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # trial_info => { + # end_date: Time + # } + # ``` + class TrialInfo < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!parse + # # @param end_date [Time, nil] + # # + # def initialize(end_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/subscription_unschedule_cancellation_params.rb b/lib/orb/models/subscription_unschedule_cancellation_params.rb new file mode 100644 index 00000000..6cf1dca4 --- /dev/null +++ b/lib/orb/models/subscription_unschedule_cancellation_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class SubscriptionUnscheduleCancellationParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/subscription_unschedule_cancellation_response.rb b/lib/orb/models/subscription_unschedule_cancellation_response.rb new file mode 100644 index 00000000..de47e47f --- /dev/null +++ b/lib/orb/models/subscription_unschedule_cancellation_response.rb @@ -0,0 +1,1444 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # subscription_unschedule_cancellation_response => { + # id: String, + # active_plan_phase_order: Integer, + # adjustment_intervals: -> { Orb::ArrayOf[Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval] === _1 }, + # auto_collection: Orb::BooleanModel, + # billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnscheduleCancellationResponse::BillingCycleAnchorConfiguration, + # **_ + # } + # ``` + class SubscriptionUnscheduleCancellationResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute active_plan_phase_order + # The current plan phase that is active, only if the subscription's plan has + # phases. + # + # @return [Integer, nil] + required :active_plan_phase_order, Integer, nil?: true + + # @!attribute adjustment_intervals + # The adjustment intervals for this subscription. + # + # @return [Array] + required :adjustment_intervals, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval] + } + + # @!attribute auto_collection + # Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. This property defaults to + # the plan's behavior. If null, defaults to the customer's setting. + # + # @return [Boolean, nil] + required :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_anchor_configuration + # + # @return [Orb::Models::SubscriptionUnscheduleCancellationResponse::BillingCycleAnchorConfiguration] + required :billing_cycle_anchor_configuration, + -> { Orb::Models::SubscriptionUnscheduleCancellationResponse::BillingCycleAnchorConfiguration } + + # @!attribute billing_cycle_day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is not part of the billing period. Set to null for + # subscriptions that are not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if the subscription is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute customer + # A customer is a buyer of your products, and the other party to the billing + # relationship. + # + # In Orb, customers are assigned system generated identifiers automatically, but + # it's often desirable to have these match existing identifiers in your system. To + # avoid having to denormalize Orb ID information, you can pass in an + # `external_customer_id` with your own identifier. See + # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + # information about how these aliases work in Orb. + # + # In addition to having an identifier in your system, a customer may exist in a + # payment provider solution like Stripe. Use the `payment_provider_id` and the + # `payment_provider` enum field to express this mapping. + # + # A customer also has a timezone (from the standard + # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + # your account's timezone. See [Timezone localization](/essentials/timezones) for + # information on what this timezone parameter influences within Orb. + # + # @return [Orb::Models::Customer] + required :customer, -> { Orb::Models::Customer } + + # @!attribute default_invoice_memo + # Determines the default memo on this subscriptions' invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @return [String, nil] + required :default_invoice_memo, String, nil?: true + + # @!attribute discount_intervals + # The discount intervals for this subscription. + # + # @return [Array] + required :discount_intervals, + -> { + Orb::ArrayOf[union: Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval] + } + + # @!attribute end_date + # The date Orb stops billing for this subscription. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_schedule + # + # @return [Array] + required :fixed_fee_quantity_schedule, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUnscheduleCancellationResponse::FixedFeeQuantitySchedule] + } + + # @!attribute invoicing_threshold + # + # @return [String, nil] + required :invoicing_threshold, String, nil?: true + + # @!attribute maximum_intervals + # The maximum intervals for this subscription. + # + # @return [Array] + required :maximum_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionUnscheduleCancellationResponse::MaximumInterval] } + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum_intervals + # The minimum intervals for this subscription. + # + # @return [Array] + required :minimum_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionUnscheduleCancellationResponse::MinimumInterval] } + + # @!attribute net_terms + # Determines the difference between the invoice issue date for subscription + # invoices as the date that they are due. A value of `0` here represents that the + # invoice is due on issue, whereas a value of `30` represents that the customer + # has a month to pay the invoice. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute plan + # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + # subscribed to by a customer. Plans define the billing behavior of the + # subscription. You can see more about how to configure prices in the + # [Price resource](/reference/price). + # + # @return [Orb::Models::Plan] + required :plan, -> { Orb::Models::Plan } + + # @!attribute price_intervals + # The price intervals for this subscription. + # + # @return [Array] + required :price_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval] } + + # @!attribute redeemed_coupon + # + # @return [Orb::Models::SubscriptionUnscheduleCancellationResponse::RedeemedCoupon, nil] + required :redeemed_coupon, + -> { Orb::Models::SubscriptionUnscheduleCancellationResponse::RedeemedCoupon }, + nil?: true + + # @!attribute start_date + # The date Orb starts billing for this subscription. + # + # @return [Time] + required :start_date, Time + + # @!attribute status + # + # @return [Symbol, Orb::Models::SubscriptionUnscheduleCancellationResponse::Status] + required :status, enum: -> { Orb::Models::SubscriptionUnscheduleCancellationResponse::Status } + + # @!attribute trial_info + # + # @return [Orb::Models::SubscriptionUnscheduleCancellationResponse::TrialInfo] + required :trial_info, -> { Orb::Models::SubscriptionUnscheduleCancellationResponse::TrialInfo } + + # @!parse + # # @param id [String] + # # @param active_plan_phase_order [Integer, nil] + # # @param adjustment_intervals [Array] + # # @param auto_collection [Boolean, nil] + # # @param billing_cycle_anchor_configuration [Orb::Models::SubscriptionUnscheduleCancellationResponse::BillingCycleAnchorConfiguration] + # # @param billing_cycle_day [Integer] + # # @param created_at [Time] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param customer [Orb::Models::Customer] + # # @param default_invoice_memo [String, nil] + # # @param discount_intervals [Array] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_schedule [Array] + # # @param invoicing_threshold [String, nil] + # # @param maximum_intervals [Array] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum_intervals [Array] + # # @param net_terms [Integer] + # # @param plan [Orb::Models::Plan] + # # @param price_intervals [Array] + # # @param redeemed_coupon [Orb::Models::SubscriptionUnscheduleCancellationResponse::RedeemedCoupon, nil] + # # @param start_date [Time] + # # @param status [Symbol, Orb::Models::SubscriptionUnscheduleCancellationResponse::Status] + # # @param trial_info [Orb::Models::SubscriptionUnscheduleCancellationResponse::TrialInfo] + # # + # def initialize( + # id:, + # active_plan_phase_order:, + # adjustment_intervals:, + # auto_collection:, + # billing_cycle_anchor_configuration:, + # billing_cycle_day:, + # created_at:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # customer:, + # default_invoice_memo:, + # discount_intervals:, + # end_date:, + # fixed_fee_quantity_schedule:, + # invoicing_threshold:, + # maximum_intervals:, + # metadata:, + # minimum_intervals:, + # net_terms:, + # plan:, + # price_intervals:, + # redeemed_coupon:, + # start_date:, + # status:, + # trial_info:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # adjustment_interval => { + # id: String, + # adjustment: Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # start_date: Time + # } + # ``` + class AdjustmentInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment + # + # @return [Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + required :adjustment, + union: -> { + Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment + } + + # @!attribute applies_to_price_interval_ids + # The price interval IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the adjustment interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the adjustment interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param id [String] + # # @param adjustment [Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "amount_discount", id: String, amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment ... + # in {adjustment_type: "percentage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment ... + # in {adjustment_type: "usage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment ... + # in {adjustment_type: "minimum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MinimumAdjustment ... + # in {adjustment_type: "maximum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MaximumAdjustment ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + # # ... + # in Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :amount_discount, + -> { Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment } + + variant :percentage_discount, + -> { Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment } + + variant :usage_discount, + -> { Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment } + + variant :minimum, + -> { Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MinimumAdjustment } + + variant :maximum, + -> { Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MaximumAdjustment } + + # @example + # ```ruby + # amount_discount_adjustment => { + # id: String, + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # **_ + # } + # ``` + class AmountDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # The amount by which to discount the prices this adjustment applies to in a given + # billing period. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize( + # id:, + # amount_discount:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # adjustment_type: :amount_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_adjustment => { + # id: String, + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # percentage_discount: Float, + # **_ + # } + # ``` + class PercentageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute percentage_discount + # The percentage (as a value between 0 and 1) by which to discount the price + # intervals this adjustment applies to in a given billing period. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param percentage_discount [Float] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # percentage_discount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_adjustment => { + # id: String, + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # plan_phase_order: Integer, + # **_ + # } + # ``` + class UsageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute usage_discount + # The number of usage units by which to discount the price this adjustment applies + # to in a given billing period. + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param usage_discount [Float] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # usage_discount:, + # adjustment_type: :usage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_adjustment => { + # id: String, + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # item_id: String, + # **_ + # } + # ``` + class MinimumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # item_id:, + # minimum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_adjustment => { + # id: String, + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # maximum_amount: String, + # **_ + # } + # ``` + class MaximumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param maximum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # maximum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :maximum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # billing_cycle_anchor_configuration => { + # day: Integer, + # month: Integer, + # year: Integer + # } + # ``` + class BillingCycleAnchorConfiguration < Orb::BaseModel + # @!attribute day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :day, Integer + + # @!attribute month + # The month on which the billing cycle is anchored (e.g. a quarterly price + # anchored in February would have cycles starting February, May, August, and + # November). + # + # @return [Integer, nil] + optional :month, Integer, nil?: true + + # @!attribute year + # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle + # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + # + # @return [Integer, nil] + optional :year, Integer, nil?: true + + # @!parse + # # @param day [Integer] + # # @param month [Integer, nil] + # # @param year [Integer, nil] + # # + # def initialize(day:, month: nil, year: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case discount_interval + # in {discount_type: "amount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::AmountDiscountInterval ... + # in {discount_type: "percentage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::PercentageDiscountInterval ... + # in {discount_type: "usage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::UsageDiscountInterval ... + # end + # ``` + # + # @example + # ```ruby + # case discount_interval + # in Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::AmountDiscountInterval + # # ... + # in Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::PercentageDiscountInterval + # # ... + # in Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::UsageDiscountInterval + # # ... + # end + # ``` + class DiscountInterval < Orb::Union + discriminator :discount_type + + variant :amount, + -> { Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::AmountDiscountInterval } + + variant :percentage, + -> { Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::PercentageDiscountInterval } + + variant :usage, + -> { Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::UsageDiscountInterval } + + # @example + # ```ruby + # amount_discount_interval => { + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :amount, + # end_date: Time + # } + # ``` + class AmountDiscountInterval < Orb::BaseModel + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :amount] + required :discount_type, const: :amount + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param discount_type [Symbol, :amount] + # # + # def initialize( + # amount_discount:, + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # discount_type: :amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :percentage, + # end_date: Time, + # percentage_discount: Float + # } + # ``` + class PercentageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :percentage] + required :discount_type, const: :percentage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`.This is a number between 0 + # and 1. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param percentage_discount [Float] + # # @param start_date [Time] + # # @param discount_type [Symbol, :percentage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # percentage_discount:, + # start_date:, + # discount_type: :percentage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :usage, + # end_date: Time, + # start_date: Time + # } + # ``` + class UsageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :usage] + required :discount_type, const: :usage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param usage_discount [Float] + # # @param discount_type [Symbol, :usage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # usage_discount:, + # discount_type: :usage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # fixed_fee_quantity_schedule => { + # end_date: Time, + # price_id: String, + # quantity: Float, + # start_date: Time + # } + # ``` + class FixedFeeQuantitySchedule < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param end_date [Time, nil] + # # @param price_id [String] + # # @param quantity [Float] + # # @param start_date [Time] + # # + # def initialize(end_date:, price_id:, quantity:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # maximum_amount: String, + # start_date: Time + # } + # ``` + class MaximumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the maximum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the price intervals + # this transform applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute start_date + # The start date of the maximum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param maximum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, maximum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # minimum_amount: String, + # start_date: Time + # } + # ``` + class MinimumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the minimum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the price intervals + # this minimum applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute start_date + # The start date of the minimum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param minimum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, minimum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # price_interval => { + # id: String, + # billing_cycle_day: Integer, + # current_billing_period_end_date: Time, + # current_billing_period_start_date: Time, + # end_date: Time, + # **_ + # } + # ``` + class PriceInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billing_cycle_day + # The day of the month that Orb bills for this price + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is exactly the end of the billing period. Set to null if + # this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute end_date + # The end date of the price interval. This is the date that Orb stops billing for + # this price. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_transitions + # The fixed fee quantity transitions for this price interval. This is only + # relevant for fixed fees. + # + # @return [Array, nil] + required :fixed_fee_quantity_transitions, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval::FixedFeeQuantityTransition] + }, + nil?: true + + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + required :price, union: -> { Orb::Models::Price } + + # @!attribute start_date + # The start date of the price interval. This is the date that Orb starts billing + # for this price. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # The Price Interval resource represents a period of time for which a price will + # # bill on a subscription. A subscription’s price intervals define its billing + # # behavior. + # # + # # @param id [String] + # # @param billing_cycle_day [Integer] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_transitions [Array, nil] + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # # @param start_date [Time] + # # + # def initialize( + # id:, + # billing_cycle_day:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # end_date:, + # fixed_fee_quantity_transitions:, + # price:, + # start_date:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # fixed_fee_quantity_transition => { + # effective_date: Time, + # price_id: String, + # quantity: Integer + # } + # ``` + class FixedFeeQuantityTransition < Orb::BaseModel + # @!attribute effective_date + # + # @return [Time] + required :effective_date, Time + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Integer] + required :quantity, Integer + + # @!parse + # # @param effective_date [Time] + # # @param price_id [String] + # # @param quantity [Integer] + # # + # def initialize(effective_date:, price_id:, quantity:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # redeemed_coupon => { + # coupon_id: String, + # end_date: Time, + # start_date: Time + # } + # ``` + class RedeemedCoupon < Orb::BaseModel + # @!attribute coupon_id + # + # @return [String] + required :coupon_id, String + + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param coupon_id [String] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(coupon_id:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :ended + # # ... + # in :upcoming + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # trial_info => { + # end_date: Time + # } + # ``` + class TrialInfo < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!parse + # # @param end_date [Time, nil] + # # + # def initialize(end_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rb b/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rb new file mode 100644 index 00000000..af736ddf --- /dev/null +++ b/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Orb + module Models + class SubscriptionUnscheduleFixedFeeQuantityUpdatesParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute price_id + # Price for which the updates should be cleared. Must be a fixed fee. + # + # @return [String] + required :price_id, String + + # @!parse + # # @param price_id [String] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(price_id:, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rb b/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rb new file mode 100644 index 00000000..45aabaaf --- /dev/null +++ b/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rb @@ -0,0 +1,1456 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # subscription_unschedule_fixed_fee_quantity_updates_response => { + # id: String, + # active_plan_phase_order: Integer, + # adjustment_intervals: -> { Orb::ArrayOf[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval] === _1 }, + # auto_collection: Orb::BooleanModel, + # billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::BillingCycleAnchorConfiguration, + # **_ + # } + # ``` + class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute active_plan_phase_order + # The current plan phase that is active, only if the subscription's plan has + # phases. + # + # @return [Integer, nil] + required :active_plan_phase_order, Integer, nil?: true + + # @!attribute adjustment_intervals + # The adjustment intervals for this subscription. + # + # @return [Array] + required :adjustment_intervals, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval] + } + + # @!attribute auto_collection + # Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. This property defaults to + # the plan's behavior. If null, defaults to the customer's setting. + # + # @return [Boolean, nil] + required :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_anchor_configuration + # + # @return [Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::BillingCycleAnchorConfiguration] + required :billing_cycle_anchor_configuration, + -> { Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::BillingCycleAnchorConfiguration } + + # @!attribute billing_cycle_day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is not part of the billing period. Set to null for + # subscriptions that are not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if the subscription is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute customer + # A customer is a buyer of your products, and the other party to the billing + # relationship. + # + # In Orb, customers are assigned system generated identifiers automatically, but + # it's often desirable to have these match existing identifiers in your system. To + # avoid having to denormalize Orb ID information, you can pass in an + # `external_customer_id` with your own identifier. See + # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + # information about how these aliases work in Orb. + # + # In addition to having an identifier in your system, a customer may exist in a + # payment provider solution like Stripe. Use the `payment_provider_id` and the + # `payment_provider` enum field to express this mapping. + # + # A customer also has a timezone (from the standard + # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + # your account's timezone. See [Timezone localization](/essentials/timezones) for + # information on what this timezone parameter influences within Orb. + # + # @return [Orb::Models::Customer] + required :customer, -> { Orb::Models::Customer } + + # @!attribute default_invoice_memo + # Determines the default memo on this subscriptions' invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @return [String, nil] + required :default_invoice_memo, String, nil?: true + + # @!attribute discount_intervals + # The discount intervals for this subscription. + # + # @return [Array] + required :discount_intervals, + -> { + Orb::ArrayOf[union: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval] + } + + # @!attribute end_date + # The date Orb stops billing for this subscription. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_schedule + # + # @return [Array] + required :fixed_fee_quantity_schedule, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::FixedFeeQuantitySchedule] + } + + # @!attribute invoicing_threshold + # + # @return [String, nil] + required :invoicing_threshold, String, nil?: true + + # @!attribute maximum_intervals + # The maximum intervals for this subscription. + # + # @return [Array] + required :maximum_intervals, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::MaximumInterval] + } + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum_intervals + # The minimum intervals for this subscription. + # + # @return [Array] + required :minimum_intervals, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::MinimumInterval] + } + + # @!attribute net_terms + # Determines the difference between the invoice issue date for subscription + # invoices as the date that they are due. A value of `0` here represents that the + # invoice is due on issue, whereas a value of `30` represents that the customer + # has a month to pay the invoice. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute plan + # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + # subscribed to by a customer. Plans define the billing behavior of the + # subscription. You can see more about how to configure prices in the + # [Price resource](/reference/price). + # + # @return [Orb::Models::Plan] + required :plan, -> { Orb::Models::Plan } + + # @!attribute price_intervals + # The price intervals for this subscription. + # + # @return [Array] + required :price_intervals, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval] + } + + # @!attribute redeemed_coupon + # + # @return [Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::RedeemedCoupon, nil] + required :redeemed_coupon, + -> { Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::RedeemedCoupon }, + nil?: true + + # @!attribute start_date + # The date Orb starts billing for this subscription. + # + # @return [Time] + required :start_date, Time + + # @!attribute status + # + # @return [Symbol, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::Status] + required :status, + enum: -> { + Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::Status + } + + # @!attribute trial_info + # + # @return [Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::TrialInfo] + required :trial_info, + -> { + Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::TrialInfo + } + + # @!parse + # # @param id [String] + # # @param active_plan_phase_order [Integer, nil] + # # @param adjustment_intervals [Array] + # # @param auto_collection [Boolean, nil] + # # @param billing_cycle_anchor_configuration [Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::BillingCycleAnchorConfiguration] + # # @param billing_cycle_day [Integer] + # # @param created_at [Time] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param customer [Orb::Models::Customer] + # # @param default_invoice_memo [String, nil] + # # @param discount_intervals [Array] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_schedule [Array] + # # @param invoicing_threshold [String, nil] + # # @param maximum_intervals [Array] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum_intervals [Array] + # # @param net_terms [Integer] + # # @param plan [Orb::Models::Plan] + # # @param price_intervals [Array] + # # @param redeemed_coupon [Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::RedeemedCoupon, nil] + # # @param start_date [Time] + # # @param status [Symbol, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::Status] + # # @param trial_info [Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::TrialInfo] + # # + # def initialize( + # id:, + # active_plan_phase_order:, + # adjustment_intervals:, + # auto_collection:, + # billing_cycle_anchor_configuration:, + # billing_cycle_day:, + # created_at:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # customer:, + # default_invoice_memo:, + # discount_intervals:, + # end_date:, + # fixed_fee_quantity_schedule:, + # invoicing_threshold:, + # maximum_intervals:, + # metadata:, + # minimum_intervals:, + # net_terms:, + # plan:, + # price_intervals:, + # redeemed_coupon:, + # start_date:, + # status:, + # trial_info:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # adjustment_interval => { + # id: String, + # adjustment: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # start_date: Time + # } + # ``` + class AdjustmentInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment + # + # @return [Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + required :adjustment, + union: -> { + Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment + } + + # @!attribute applies_to_price_interval_ids + # The price interval IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the adjustment interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the adjustment interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param id [String] + # # @param adjustment [Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "amount_discount", id: String, amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment ... + # in {adjustment_type: "percentage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment ... + # in {adjustment_type: "usage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment ... + # in {adjustment_type: "minimum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment ... + # in {adjustment_type: "maximum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + # # ... + # in Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :amount_discount, + -> { Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment } + + variant :percentage_discount, + -> { Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment } + + variant :usage_discount, + -> { Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment } + + variant :minimum, + -> { Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment } + + variant :maximum, + -> { Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment } + + # @example + # ```ruby + # amount_discount_adjustment => { + # id: String, + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # **_ + # } + # ``` + class AmountDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # The amount by which to discount the prices this adjustment applies to in a given + # billing period. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize( + # id:, + # amount_discount:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # adjustment_type: :amount_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_adjustment => { + # id: String, + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # percentage_discount: Float, + # **_ + # } + # ``` + class PercentageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute percentage_discount + # The percentage (as a value between 0 and 1) by which to discount the price + # intervals this adjustment applies to in a given billing period. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param percentage_discount [Float] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # percentage_discount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_adjustment => { + # id: String, + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # plan_phase_order: Integer, + # **_ + # } + # ``` + class UsageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute usage_discount + # The number of usage units by which to discount the price this adjustment applies + # to in a given billing period. + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param usage_discount [Float] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # usage_discount:, + # adjustment_type: :usage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_adjustment => { + # id: String, + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # item_id: String, + # **_ + # } + # ``` + class MinimumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # item_id:, + # minimum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_adjustment => { + # id: String, + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # maximum_amount: String, + # **_ + # } + # ``` + class MaximumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param maximum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # maximum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :maximum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # billing_cycle_anchor_configuration => { + # day: Integer, + # month: Integer, + # year: Integer + # } + # ``` + class BillingCycleAnchorConfiguration < Orb::BaseModel + # @!attribute day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :day, Integer + + # @!attribute month + # The month on which the billing cycle is anchored (e.g. a quarterly price + # anchored in February would have cycles starting February, May, August, and + # November). + # + # @return [Integer, nil] + optional :month, Integer, nil?: true + + # @!attribute year + # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle + # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + # + # @return [Integer, nil] + optional :year, Integer, nil?: true + + # @!parse + # # @param day [Integer] + # # @param month [Integer, nil] + # # @param year [Integer, nil] + # # + # def initialize(day:, month: nil, year: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case discount_interval + # in {discount_type: "amount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::AmountDiscountInterval ... + # in {discount_type: "percentage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::PercentageDiscountInterval ... + # in {discount_type: "usage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::UsageDiscountInterval ... + # end + # ``` + # + # @example + # ```ruby + # case discount_interval + # in Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::AmountDiscountInterval + # # ... + # in Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::PercentageDiscountInterval + # # ... + # in Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::UsageDiscountInterval + # # ... + # end + # ``` + class DiscountInterval < Orb::Union + discriminator :discount_type + + variant :amount, + -> { Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::AmountDiscountInterval } + + variant :percentage, + -> { Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::PercentageDiscountInterval } + + variant :usage, + -> { Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::UsageDiscountInterval } + + # @example + # ```ruby + # amount_discount_interval => { + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :amount, + # end_date: Time + # } + # ``` + class AmountDiscountInterval < Orb::BaseModel + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :amount] + required :discount_type, const: :amount + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param discount_type [Symbol, :amount] + # # + # def initialize( + # amount_discount:, + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # discount_type: :amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :percentage, + # end_date: Time, + # percentage_discount: Float + # } + # ``` + class PercentageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :percentage] + required :discount_type, const: :percentage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`.This is a number between 0 + # and 1. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param percentage_discount [Float] + # # @param start_date [Time] + # # @param discount_type [Symbol, :percentage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # percentage_discount:, + # start_date:, + # discount_type: :percentage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :usage, + # end_date: Time, + # start_date: Time + # } + # ``` + class UsageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :usage] + required :discount_type, const: :usage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param usage_discount [Float] + # # @param discount_type [Symbol, :usage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # usage_discount:, + # discount_type: :usage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # fixed_fee_quantity_schedule => { + # end_date: Time, + # price_id: String, + # quantity: Float, + # start_date: Time + # } + # ``` + class FixedFeeQuantitySchedule < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param end_date [Time, nil] + # # @param price_id [String] + # # @param quantity [Float] + # # @param start_date [Time] + # # + # def initialize(end_date:, price_id:, quantity:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # maximum_amount: String, + # start_date: Time + # } + # ``` + class MaximumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the maximum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the price intervals + # this transform applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute start_date + # The start date of the maximum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param maximum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, maximum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # minimum_amount: String, + # start_date: Time + # } + # ``` + class MinimumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the minimum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the price intervals + # this minimum applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute start_date + # The start date of the minimum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param minimum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, minimum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # price_interval => { + # id: String, + # billing_cycle_day: Integer, + # current_billing_period_end_date: Time, + # current_billing_period_start_date: Time, + # end_date: Time, + # **_ + # } + # ``` + class PriceInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billing_cycle_day + # The day of the month that Orb bills for this price + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is exactly the end of the billing period. Set to null if + # this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute end_date + # The end date of the price interval. This is the date that Orb stops billing for + # this price. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_transitions + # The fixed fee quantity transitions for this price interval. This is only + # relevant for fixed fees. + # + # @return [Array, nil] + required :fixed_fee_quantity_transitions, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval::FixedFeeQuantityTransition] + }, + nil?: true + + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + required :price, union: -> { Orb::Models::Price } + + # @!attribute start_date + # The start date of the price interval. This is the date that Orb starts billing + # for this price. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # The Price Interval resource represents a period of time for which a price will + # # bill on a subscription. A subscription’s price intervals define its billing + # # behavior. + # # + # # @param id [String] + # # @param billing_cycle_day [Integer] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_transitions [Array, nil] + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # # @param start_date [Time] + # # + # def initialize( + # id:, + # billing_cycle_day:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # end_date:, + # fixed_fee_quantity_transitions:, + # price:, + # start_date:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # fixed_fee_quantity_transition => { + # effective_date: Time, + # price_id: String, + # quantity: Integer + # } + # ``` + class FixedFeeQuantityTransition < Orb::BaseModel + # @!attribute effective_date + # + # @return [Time] + required :effective_date, Time + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Integer] + required :quantity, Integer + + # @!parse + # # @param effective_date [Time] + # # @param price_id [String] + # # @param quantity [Integer] + # # + # def initialize(effective_date:, price_id:, quantity:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # redeemed_coupon => { + # coupon_id: String, + # end_date: Time, + # start_date: Time + # } + # ``` + class RedeemedCoupon < Orb::BaseModel + # @!attribute coupon_id + # + # @return [String] + required :coupon_id, String + + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param coupon_id [String] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(coupon_id:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :ended + # # ... + # in :upcoming + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # trial_info => { + # end_date: Time + # } + # ``` + class TrialInfo < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!parse + # # @param end_date [Time, nil] + # # + # def initialize(end_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rb b/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rb new file mode 100644 index 00000000..b9a0c3e6 --- /dev/null +++ b/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class SubscriptionUnschedulePendingPlanChangesParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rb b/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rb new file mode 100644 index 00000000..d2ec4004 --- /dev/null +++ b/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rb @@ -0,0 +1,1450 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # subscription_unschedule_pending_plan_changes_response => { + # id: String, + # active_plan_phase_order: Integer, + # adjustment_intervals: -> { Orb::ArrayOf[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval] === _1 }, + # auto_collection: Orb::BooleanModel, + # billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::BillingCycleAnchorConfiguration, + # **_ + # } + # ``` + class SubscriptionUnschedulePendingPlanChangesResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute active_plan_phase_order + # The current plan phase that is active, only if the subscription's plan has + # phases. + # + # @return [Integer, nil] + required :active_plan_phase_order, Integer, nil?: true + + # @!attribute adjustment_intervals + # The adjustment intervals for this subscription. + # + # @return [Array] + required :adjustment_intervals, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval] + } + + # @!attribute auto_collection + # Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. This property defaults to + # the plan's behavior. If null, defaults to the customer's setting. + # + # @return [Boolean, nil] + required :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_anchor_configuration + # + # @return [Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::BillingCycleAnchorConfiguration] + required :billing_cycle_anchor_configuration, + -> { Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::BillingCycleAnchorConfiguration } + + # @!attribute billing_cycle_day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is not part of the billing period. Set to null for + # subscriptions that are not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if the subscription is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute customer + # A customer is a buyer of your products, and the other party to the billing + # relationship. + # + # In Orb, customers are assigned system generated identifiers automatically, but + # it's often desirable to have these match existing identifiers in your system. To + # avoid having to denormalize Orb ID information, you can pass in an + # `external_customer_id` with your own identifier. See + # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + # information about how these aliases work in Orb. + # + # In addition to having an identifier in your system, a customer may exist in a + # payment provider solution like Stripe. Use the `payment_provider_id` and the + # `payment_provider` enum field to express this mapping. + # + # A customer also has a timezone (from the standard + # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + # your account's timezone. See [Timezone localization](/essentials/timezones) for + # information on what this timezone parameter influences within Orb. + # + # @return [Orb::Models::Customer] + required :customer, -> { Orb::Models::Customer } + + # @!attribute default_invoice_memo + # Determines the default memo on this subscriptions' invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @return [String, nil] + required :default_invoice_memo, String, nil?: true + + # @!attribute discount_intervals + # The discount intervals for this subscription. + # + # @return [Array] + required :discount_intervals, + -> { + Orb::ArrayOf[union: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval] + } + + # @!attribute end_date + # The date Orb stops billing for this subscription. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_schedule + # + # @return [Array] + required :fixed_fee_quantity_schedule, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::FixedFeeQuantitySchedule] + } + + # @!attribute invoicing_threshold + # + # @return [String, nil] + required :invoicing_threshold, String, nil?: true + + # @!attribute maximum_intervals + # The maximum intervals for this subscription. + # + # @return [Array] + required :maximum_intervals, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::MaximumInterval] + } + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum_intervals + # The minimum intervals for this subscription. + # + # @return [Array] + required :minimum_intervals, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::MinimumInterval] + } + + # @!attribute net_terms + # Determines the difference between the invoice issue date for subscription + # invoices as the date that they are due. A value of `0` here represents that the + # invoice is due on issue, whereas a value of `30` represents that the customer + # has a month to pay the invoice. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute plan + # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + # subscribed to by a customer. Plans define the billing behavior of the + # subscription. You can see more about how to configure prices in the + # [Price resource](/reference/price). + # + # @return [Orb::Models::Plan] + required :plan, -> { Orb::Models::Plan } + + # @!attribute price_intervals + # The price intervals for this subscription. + # + # @return [Array] + required :price_intervals, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval] + } + + # @!attribute redeemed_coupon + # + # @return [Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::RedeemedCoupon, nil] + required :redeemed_coupon, + -> { Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::RedeemedCoupon }, + nil?: true + + # @!attribute start_date + # The date Orb starts billing for this subscription. + # + # @return [Time] + required :start_date, Time + + # @!attribute status + # + # @return [Symbol, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::Status] + required :status, enum: -> { Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::Status } + + # @!attribute trial_info + # + # @return [Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::TrialInfo] + required :trial_info, -> { Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::TrialInfo } + + # @!parse + # # @param id [String] + # # @param active_plan_phase_order [Integer, nil] + # # @param adjustment_intervals [Array] + # # @param auto_collection [Boolean, nil] + # # @param billing_cycle_anchor_configuration [Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::BillingCycleAnchorConfiguration] + # # @param billing_cycle_day [Integer] + # # @param created_at [Time] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param customer [Orb::Models::Customer] + # # @param default_invoice_memo [String, nil] + # # @param discount_intervals [Array] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_schedule [Array] + # # @param invoicing_threshold [String, nil] + # # @param maximum_intervals [Array] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum_intervals [Array] + # # @param net_terms [Integer] + # # @param plan [Orb::Models::Plan] + # # @param price_intervals [Array] + # # @param redeemed_coupon [Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::RedeemedCoupon, nil] + # # @param start_date [Time] + # # @param status [Symbol, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::Status] + # # @param trial_info [Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::TrialInfo] + # # + # def initialize( + # id:, + # active_plan_phase_order:, + # adjustment_intervals:, + # auto_collection:, + # billing_cycle_anchor_configuration:, + # billing_cycle_day:, + # created_at:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # customer:, + # default_invoice_memo:, + # discount_intervals:, + # end_date:, + # fixed_fee_quantity_schedule:, + # invoicing_threshold:, + # maximum_intervals:, + # metadata:, + # minimum_intervals:, + # net_terms:, + # plan:, + # price_intervals:, + # redeemed_coupon:, + # start_date:, + # status:, + # trial_info:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # adjustment_interval => { + # id: String, + # adjustment: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # start_date: Time + # } + # ``` + class AdjustmentInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment + # + # @return [Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + required :adjustment, + union: -> { + Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment + } + + # @!attribute applies_to_price_interval_ids + # The price interval IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the adjustment interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the adjustment interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param id [String] + # # @param adjustment [Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "amount_discount", id: String, amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment ... + # in {adjustment_type: "percentage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment ... + # in {adjustment_type: "usage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment ... + # in {adjustment_type: "minimum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment ... + # in {adjustment_type: "maximum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + # # ... + # in Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :amount_discount, + -> { Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment } + + variant :percentage_discount, + -> { Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment } + + variant :usage_discount, + -> { Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment } + + variant :minimum, + -> { Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment } + + variant :maximum, + -> { Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment } + + # @example + # ```ruby + # amount_discount_adjustment => { + # id: String, + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # **_ + # } + # ``` + class AmountDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # The amount by which to discount the prices this adjustment applies to in a given + # billing period. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize( + # id:, + # amount_discount:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # adjustment_type: :amount_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_adjustment => { + # id: String, + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # percentage_discount: Float, + # **_ + # } + # ``` + class PercentageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute percentage_discount + # The percentage (as a value between 0 and 1) by which to discount the price + # intervals this adjustment applies to in a given billing period. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param percentage_discount [Float] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # percentage_discount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_adjustment => { + # id: String, + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # plan_phase_order: Integer, + # **_ + # } + # ``` + class UsageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute usage_discount + # The number of usage units by which to discount the price this adjustment applies + # to in a given billing period. + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param usage_discount [Float] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # usage_discount:, + # adjustment_type: :usage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_adjustment => { + # id: String, + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # item_id: String, + # **_ + # } + # ``` + class MinimumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # item_id:, + # minimum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_adjustment => { + # id: String, + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # maximum_amount: String, + # **_ + # } + # ``` + class MaximumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param maximum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # maximum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :maximum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # billing_cycle_anchor_configuration => { + # day: Integer, + # month: Integer, + # year: Integer + # } + # ``` + class BillingCycleAnchorConfiguration < Orb::BaseModel + # @!attribute day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :day, Integer + + # @!attribute month + # The month on which the billing cycle is anchored (e.g. a quarterly price + # anchored in February would have cycles starting February, May, August, and + # November). + # + # @return [Integer, nil] + optional :month, Integer, nil?: true + + # @!attribute year + # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle + # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + # + # @return [Integer, nil] + optional :year, Integer, nil?: true + + # @!parse + # # @param day [Integer] + # # @param month [Integer, nil] + # # @param year [Integer, nil] + # # + # def initialize(day:, month: nil, year: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case discount_interval + # in {discount_type: "amount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::AmountDiscountInterval ... + # in {discount_type: "percentage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::PercentageDiscountInterval ... + # in {discount_type: "usage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::UsageDiscountInterval ... + # end + # ``` + # + # @example + # ```ruby + # case discount_interval + # in Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::AmountDiscountInterval + # # ... + # in Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::PercentageDiscountInterval + # # ... + # in Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::UsageDiscountInterval + # # ... + # end + # ``` + class DiscountInterval < Orb::Union + discriminator :discount_type + + variant :amount, + -> { Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::AmountDiscountInterval } + + variant :percentage, + -> { Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::PercentageDiscountInterval } + + variant :usage, + -> { Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::UsageDiscountInterval } + + # @example + # ```ruby + # amount_discount_interval => { + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :amount, + # end_date: Time + # } + # ``` + class AmountDiscountInterval < Orb::BaseModel + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :amount] + required :discount_type, const: :amount + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param discount_type [Symbol, :amount] + # # + # def initialize( + # amount_discount:, + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # discount_type: :amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :percentage, + # end_date: Time, + # percentage_discount: Float + # } + # ``` + class PercentageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :percentage] + required :discount_type, const: :percentage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`.This is a number between 0 + # and 1. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param percentage_discount [Float] + # # @param start_date [Time] + # # @param discount_type [Symbol, :percentage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # percentage_discount:, + # start_date:, + # discount_type: :percentage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :usage, + # end_date: Time, + # start_date: Time + # } + # ``` + class UsageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :usage] + required :discount_type, const: :usage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param usage_discount [Float] + # # @param discount_type [Symbol, :usage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # usage_discount:, + # discount_type: :usage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # fixed_fee_quantity_schedule => { + # end_date: Time, + # price_id: String, + # quantity: Float, + # start_date: Time + # } + # ``` + class FixedFeeQuantitySchedule < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param end_date [Time, nil] + # # @param price_id [String] + # # @param quantity [Float] + # # @param start_date [Time] + # # + # def initialize(end_date:, price_id:, quantity:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # maximum_amount: String, + # start_date: Time + # } + # ``` + class MaximumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the maximum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the price intervals + # this transform applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute start_date + # The start date of the maximum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param maximum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, maximum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # minimum_amount: String, + # start_date: Time + # } + # ``` + class MinimumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the minimum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the price intervals + # this minimum applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute start_date + # The start date of the minimum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param minimum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, minimum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # price_interval => { + # id: String, + # billing_cycle_day: Integer, + # current_billing_period_end_date: Time, + # current_billing_period_start_date: Time, + # end_date: Time, + # **_ + # } + # ``` + class PriceInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billing_cycle_day + # The day of the month that Orb bills for this price + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is exactly the end of the billing period. Set to null if + # this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute end_date + # The end date of the price interval. This is the date that Orb stops billing for + # this price. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_transitions + # The fixed fee quantity transitions for this price interval. This is only + # relevant for fixed fees. + # + # @return [Array, nil] + required :fixed_fee_quantity_transitions, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval::FixedFeeQuantityTransition] + }, + nil?: true + + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + required :price, union: -> { Orb::Models::Price } + + # @!attribute start_date + # The start date of the price interval. This is the date that Orb starts billing + # for this price. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # The Price Interval resource represents a period of time for which a price will + # # bill on a subscription. A subscription’s price intervals define its billing + # # behavior. + # # + # # @param id [String] + # # @param billing_cycle_day [Integer] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_transitions [Array, nil] + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # # @param start_date [Time] + # # + # def initialize( + # id:, + # billing_cycle_day:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # end_date:, + # fixed_fee_quantity_transitions:, + # price:, + # start_date:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # fixed_fee_quantity_transition => { + # effective_date: Time, + # price_id: String, + # quantity: Integer + # } + # ``` + class FixedFeeQuantityTransition < Orb::BaseModel + # @!attribute effective_date + # + # @return [Time] + required :effective_date, Time + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Integer] + required :quantity, Integer + + # @!parse + # # @param effective_date [Time] + # # @param price_id [String] + # # @param quantity [Integer] + # # + # def initialize(effective_date:, price_id:, quantity:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # redeemed_coupon => { + # coupon_id: String, + # end_date: Time, + # start_date: Time + # } + # ``` + class RedeemedCoupon < Orb::BaseModel + # @!attribute coupon_id + # + # @return [String] + required :coupon_id, String + + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param coupon_id [String] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(coupon_id:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :ended + # # ... + # in :upcoming + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # trial_info => { + # end_date: Time + # } + # ``` + class TrialInfo < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!parse + # # @param end_date [Time, nil] + # # + # def initialize(end_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb b/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb new file mode 100644 index 00000000..0bb590a2 --- /dev/null +++ b/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module Orb + module Models + class SubscriptionUpdateFixedFeeQuantityParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute price_id + # Price for which the quantity should be updated. Must be a fixed fee. + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute [r] change_option + # Determines when the change takes effect. Note that if `effective_date` is + # specified, this defaults to `effective_date`. Otherwise, this defaults to + # `immediate` unless it's explicitly set to `upcoming_invoice. + # + # @return [Symbol, Orb::Models::SubscriptionUpdateFixedFeeQuantityParams::ChangeOption, nil] + optional :change_option, + enum: -> { + Orb::Models::SubscriptionUpdateFixedFeeQuantityParams::ChangeOption + } + + # @!parse + # # @return [Symbol, Orb::Models::SubscriptionUpdateFixedFeeQuantityParams::ChangeOption] + # attr_writer :change_option + + # @!attribute effective_date + # The date that the quantity change should take effect, localized to the + # customer's timezone. Ifthis parameter is not passed in, the quantity change is + # effective according to `change_option`. + # + # @return [Date, nil] + optional :effective_date, Date, nil?: true + + # @!parse + # # @param price_id [String] + # # @param quantity [Float] + # # @param change_option [Symbol, Orb::Models::SubscriptionUpdateFixedFeeQuantityParams::ChangeOption] + # # @param effective_date [Date, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(price_id:, quantity:, change_option: nil, effective_date: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # Determines when the change takes effect. Note that if `effective_date` is + # specified, this defaults to `effective_date`. Otherwise, this defaults to + # `immediate` unless it's explicitly set to `upcoming_invoice. + # + # @example + # ```ruby + # case change_option + # in :immediate + # # ... + # in :upcoming_invoice + # # ... + # in :effective_date + # # ... + # end + # ``` + class ChangeOption < Orb::Enum + IMMEDIATE = :immediate + UPCOMING_INVOICE = :upcoming_invoice + EFFECTIVE_DATE = :effective_date + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/orb/models/subscription_update_fixed_fee_quantity_response.rb b/lib/orb/models/subscription_update_fixed_fee_quantity_response.rb new file mode 100644 index 00000000..71fbbd82 --- /dev/null +++ b/lib/orb/models/subscription_update_fixed_fee_quantity_response.rb @@ -0,0 +1,1444 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # subscription_update_fixed_fee_quantity_response => { + # id: String, + # active_plan_phase_order: Integer, + # adjustment_intervals: -> { Orb::ArrayOf[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval] === _1 }, + # auto_collection: Orb::BooleanModel, + # billing_cycle_anchor_configuration: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::BillingCycleAnchorConfiguration, + # **_ + # } + # ``` + class SubscriptionUpdateFixedFeeQuantityResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute active_plan_phase_order + # The current plan phase that is active, only if the subscription's plan has + # phases. + # + # @return [Integer, nil] + required :active_plan_phase_order, Integer, nil?: true + + # @!attribute adjustment_intervals + # The adjustment intervals for this subscription. + # + # @return [Array] + required :adjustment_intervals, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval] + } + + # @!attribute auto_collection + # Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. This property defaults to + # the plan's behavior. If null, defaults to the customer's setting. + # + # @return [Boolean, nil] + required :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_anchor_configuration + # + # @return [Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::BillingCycleAnchorConfiguration] + required :billing_cycle_anchor_configuration, + -> { Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::BillingCycleAnchorConfiguration } + + # @!attribute billing_cycle_day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is not part of the billing period. Set to null for + # subscriptions that are not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if the subscription is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute customer + # A customer is a buyer of your products, and the other party to the billing + # relationship. + # + # In Orb, customers are assigned system generated identifiers automatically, but + # it's often desirable to have these match existing identifiers in your system. To + # avoid having to denormalize Orb ID information, you can pass in an + # `external_customer_id` with your own identifier. See + # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + # information about how these aliases work in Orb. + # + # In addition to having an identifier in your system, a customer may exist in a + # payment provider solution like Stripe. Use the `payment_provider_id` and the + # `payment_provider` enum field to express this mapping. + # + # A customer also has a timezone (from the standard + # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + # your account's timezone. See [Timezone localization](/essentials/timezones) for + # information on what this timezone parameter influences within Orb. + # + # @return [Orb::Models::Customer] + required :customer, -> { Orb::Models::Customer } + + # @!attribute default_invoice_memo + # Determines the default memo on this subscriptions' invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @return [String, nil] + required :default_invoice_memo, String, nil?: true + + # @!attribute discount_intervals + # The discount intervals for this subscription. + # + # @return [Array] + required :discount_intervals, + -> { + Orb::ArrayOf[union: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval] + } + + # @!attribute end_date + # The date Orb stops billing for this subscription. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_schedule + # + # @return [Array] + required :fixed_fee_quantity_schedule, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::FixedFeeQuantitySchedule] + } + + # @!attribute invoicing_threshold + # + # @return [String, nil] + required :invoicing_threshold, String, nil?: true + + # @!attribute maximum_intervals + # The maximum intervals for this subscription. + # + # @return [Array] + required :maximum_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::MaximumInterval] } + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum_intervals + # The minimum intervals for this subscription. + # + # @return [Array] + required :minimum_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::MinimumInterval] } + + # @!attribute net_terms + # Determines the difference between the invoice issue date for subscription + # invoices as the date that they are due. A value of `0` here represents that the + # invoice is due on issue, whereas a value of `30` represents that the customer + # has a month to pay the invoice. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute plan + # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + # subscribed to by a customer. Plans define the billing behavior of the + # subscription. You can see more about how to configure prices in the + # [Price resource](/reference/price). + # + # @return [Orb::Models::Plan] + required :plan, -> { Orb::Models::Plan } + + # @!attribute price_intervals + # The price intervals for this subscription. + # + # @return [Array] + required :price_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval] } + + # @!attribute redeemed_coupon + # + # @return [Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::RedeemedCoupon, nil] + required :redeemed_coupon, + -> { Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::RedeemedCoupon }, + nil?: true + + # @!attribute start_date + # The date Orb starts billing for this subscription. + # + # @return [Time] + required :start_date, Time + + # @!attribute status + # + # @return [Symbol, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::Status] + required :status, enum: -> { Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::Status } + + # @!attribute trial_info + # + # @return [Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::TrialInfo] + required :trial_info, -> { Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::TrialInfo } + + # @!parse + # # @param id [String] + # # @param active_plan_phase_order [Integer, nil] + # # @param adjustment_intervals [Array] + # # @param auto_collection [Boolean, nil] + # # @param billing_cycle_anchor_configuration [Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::BillingCycleAnchorConfiguration] + # # @param billing_cycle_day [Integer] + # # @param created_at [Time] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param customer [Orb::Models::Customer] + # # @param default_invoice_memo [String, nil] + # # @param discount_intervals [Array] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_schedule [Array] + # # @param invoicing_threshold [String, nil] + # # @param maximum_intervals [Array] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum_intervals [Array] + # # @param net_terms [Integer] + # # @param plan [Orb::Models::Plan] + # # @param price_intervals [Array] + # # @param redeemed_coupon [Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::RedeemedCoupon, nil] + # # @param start_date [Time] + # # @param status [Symbol, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::Status] + # # @param trial_info [Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::TrialInfo] + # # + # def initialize( + # id:, + # active_plan_phase_order:, + # adjustment_intervals:, + # auto_collection:, + # billing_cycle_anchor_configuration:, + # billing_cycle_day:, + # created_at:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # customer:, + # default_invoice_memo:, + # discount_intervals:, + # end_date:, + # fixed_fee_quantity_schedule:, + # invoicing_threshold:, + # maximum_intervals:, + # metadata:, + # minimum_intervals:, + # net_terms:, + # plan:, + # price_intervals:, + # redeemed_coupon:, + # start_date:, + # status:, + # trial_info:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # adjustment_interval => { + # id: String, + # adjustment: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # start_date: Time + # } + # ``` + class AdjustmentInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment + # + # @return [Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + required :adjustment, + union: -> { + Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment + } + + # @!attribute applies_to_price_interval_ids + # The price interval IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the adjustment interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the adjustment interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param id [String] + # # @param adjustment [Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "amount_discount", id: String, amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment ... + # in {adjustment_type: "percentage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment ... + # in {adjustment_type: "usage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment ... + # in {adjustment_type: "minimum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MinimumAdjustment ... + # in {adjustment_type: "maximum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MaximumAdjustment ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + # # ... + # in Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :amount_discount, + -> { Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment } + + variant :percentage_discount, + -> { Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment } + + variant :usage_discount, + -> { Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment } + + variant :minimum, + -> { Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MinimumAdjustment } + + variant :maximum, + -> { Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MaximumAdjustment } + + # @example + # ```ruby + # amount_discount_adjustment => { + # id: String, + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # **_ + # } + # ``` + class AmountDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # The amount by which to discount the prices this adjustment applies to in a given + # billing period. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize( + # id:, + # amount_discount:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # adjustment_type: :amount_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_adjustment => { + # id: String, + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # percentage_discount: Float, + # **_ + # } + # ``` + class PercentageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute percentage_discount + # The percentage (as a value between 0 and 1) by which to discount the price + # intervals this adjustment applies to in a given billing period. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param percentage_discount [Float] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # percentage_discount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_adjustment => { + # id: String, + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # plan_phase_order: Integer, + # **_ + # } + # ``` + class UsageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute usage_discount + # The number of usage units by which to discount the price this adjustment applies + # to in a given billing period. + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param usage_discount [Float] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # usage_discount:, + # adjustment_type: :usage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_adjustment => { + # id: String, + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # item_id: String, + # **_ + # } + # ``` + class MinimumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # item_id:, + # minimum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_adjustment => { + # id: String, + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # maximum_amount: String, + # **_ + # } + # ``` + class MaximumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param maximum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # maximum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :maximum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # billing_cycle_anchor_configuration => { + # day: Integer, + # month: Integer, + # year: Integer + # } + # ``` + class BillingCycleAnchorConfiguration < Orb::BaseModel + # @!attribute day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :day, Integer + + # @!attribute month + # The month on which the billing cycle is anchored (e.g. a quarterly price + # anchored in February would have cycles starting February, May, August, and + # November). + # + # @return [Integer, nil] + optional :month, Integer, nil?: true + + # @!attribute year + # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle + # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + # + # @return [Integer, nil] + optional :year, Integer, nil?: true + + # @!parse + # # @param day [Integer] + # # @param month [Integer, nil] + # # @param year [Integer, nil] + # # + # def initialize(day:, month: nil, year: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case discount_interval + # in {discount_type: "amount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::AmountDiscountInterval ... + # in {discount_type: "percentage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::PercentageDiscountInterval ... + # in {discount_type: "usage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::UsageDiscountInterval ... + # end + # ``` + # + # @example + # ```ruby + # case discount_interval + # in Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::AmountDiscountInterval + # # ... + # in Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::PercentageDiscountInterval + # # ... + # in Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::UsageDiscountInterval + # # ... + # end + # ``` + class DiscountInterval < Orb::Union + discriminator :discount_type + + variant :amount, + -> { Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::AmountDiscountInterval } + + variant :percentage, + -> { Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::PercentageDiscountInterval } + + variant :usage, + -> { Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::UsageDiscountInterval } + + # @example + # ```ruby + # amount_discount_interval => { + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :amount, + # end_date: Time + # } + # ``` + class AmountDiscountInterval < Orb::BaseModel + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :amount] + required :discount_type, const: :amount + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param discount_type [Symbol, :amount] + # # + # def initialize( + # amount_discount:, + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # discount_type: :amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :percentage, + # end_date: Time, + # percentage_discount: Float + # } + # ``` + class PercentageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :percentage] + required :discount_type, const: :percentage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`.This is a number between 0 + # and 1. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param percentage_discount [Float] + # # @param start_date [Time] + # # @param discount_type [Symbol, :percentage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # percentage_discount:, + # start_date:, + # discount_type: :percentage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :usage, + # end_date: Time, + # start_date: Time + # } + # ``` + class UsageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :usage] + required :discount_type, const: :usage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param usage_discount [Float] + # # @param discount_type [Symbol, :usage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # usage_discount:, + # discount_type: :usage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # fixed_fee_quantity_schedule => { + # end_date: Time, + # price_id: String, + # quantity: Float, + # start_date: Time + # } + # ``` + class FixedFeeQuantitySchedule < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param end_date [Time, nil] + # # @param price_id [String] + # # @param quantity [Float] + # # @param start_date [Time] + # # + # def initialize(end_date:, price_id:, quantity:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # maximum_amount: String, + # start_date: Time + # } + # ``` + class MaximumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the maximum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the price intervals + # this transform applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute start_date + # The start date of the maximum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param maximum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, maximum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # minimum_amount: String, + # start_date: Time + # } + # ``` + class MinimumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the minimum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the price intervals + # this minimum applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute start_date + # The start date of the minimum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param minimum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, minimum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # price_interval => { + # id: String, + # billing_cycle_day: Integer, + # current_billing_period_end_date: Time, + # current_billing_period_start_date: Time, + # end_date: Time, + # **_ + # } + # ``` + class PriceInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billing_cycle_day + # The day of the month that Orb bills for this price + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is exactly the end of the billing period. Set to null if + # this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute end_date + # The end date of the price interval. This is the date that Orb stops billing for + # this price. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_transitions + # The fixed fee quantity transitions for this price interval. This is only + # relevant for fixed fees. + # + # @return [Array, nil] + required :fixed_fee_quantity_transitions, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval::FixedFeeQuantityTransition] + }, + nil?: true + + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + required :price, union: -> { Orb::Models::Price } + + # @!attribute start_date + # The start date of the price interval. This is the date that Orb starts billing + # for this price. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # The Price Interval resource represents a period of time for which a price will + # # bill on a subscription. A subscription’s price intervals define its billing + # # behavior. + # # + # # @param id [String] + # # @param billing_cycle_day [Integer] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_transitions [Array, nil] + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # # @param start_date [Time] + # # + # def initialize( + # id:, + # billing_cycle_day:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # end_date:, + # fixed_fee_quantity_transitions:, + # price:, + # start_date:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # fixed_fee_quantity_transition => { + # effective_date: Time, + # price_id: String, + # quantity: Integer + # } + # ``` + class FixedFeeQuantityTransition < Orb::BaseModel + # @!attribute effective_date + # + # @return [Time] + required :effective_date, Time + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Integer] + required :quantity, Integer + + # @!parse + # # @param effective_date [Time] + # # @param price_id [String] + # # @param quantity [Integer] + # # + # def initialize(effective_date:, price_id:, quantity:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # redeemed_coupon => { + # coupon_id: String, + # end_date: Time, + # start_date: Time + # } + # ``` + class RedeemedCoupon < Orb::BaseModel + # @!attribute coupon_id + # + # @return [String] + required :coupon_id, String + + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param coupon_id [String] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(coupon_id:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :ended + # # ... + # in :upcoming + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # trial_info => { + # end_date: Time + # } + # ``` + class TrialInfo < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!parse + # # @param end_date [Time, nil] + # # + # def initialize(end_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/subscription_update_params.rb b/lib/orb/models/subscription_update_params.rb new file mode 100644 index 00000000..772701ef --- /dev/null +++ b/lib/orb/models/subscription_update_params.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +module Orb + module Models + class SubscriptionUpdateParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute auto_collection + # Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. This property defaults to + # the plan's behavior. + # + # @return [Boolean, nil] + optional :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute default_invoice_memo + # Determines the default memo on this subscription's invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @return [String, nil] + optional :default_invoice_memo, String, nil?: true + + # @!attribute invoicing_threshold + # When this subscription's accrued usage reaches this threshold, an invoice will + # be issued for the subscription. If not specified, invoices will only be issued + # at the end of the billing period. + # + # @return [String, nil] + optional :invoicing_threshold, String, nil?: true + + # @!attribute metadata + # User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @return [Hash{Symbol=>String, nil}, nil] + optional :metadata, Orb::HashOf[String, nil?: true], nil?: true + + # @!attribute net_terms + # Determines the difference between the invoice issue date for subscription + # invoices as the date that they are due. A value of `0` here represents that the + # invoice is due on issue, whereas a value of `30` represents that the customer + # has a month to pay the invoice. + # + # @return [Integer, nil] + optional :net_terms, Integer, nil?: true + + # @!parse + # # @param auto_collection [Boolean, nil] + # # @param default_invoice_memo [String, nil] + # # @param invoicing_threshold [String, nil] + # # @param metadata [Hash{Symbol=>String, nil}, nil] + # # @param net_terms [Integer, nil] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # auto_collection: nil, + # default_invoice_memo: nil, + # invoicing_threshold: nil, + # metadata: nil, + # net_terms: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/subscription_update_trial_params.rb b/lib/orb/models/subscription_update_trial_params.rb new file mode 100644 index 00000000..914b8df9 --- /dev/null +++ b/lib/orb/models/subscription_update_trial_params.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module Orb + module Models + class SubscriptionUpdateTrialParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!attribute trial_end_date + # The new date that the trial should end, or the literal string `immediate` to end + # the trial immediately. + # + # @return [Time, Symbol, Orb::Models::SubscriptionUpdateTrialParams::TrialEndDate::UnionMember1] + required :trial_end_date, union: -> { Orb::Models::SubscriptionUpdateTrialParams::TrialEndDate } + + # @!attribute [r] shift + # If true, shifts subsequent price and adjustment intervals (preserving their + # durations, but adjusting their absolute dates). + # + # @return [Boolean, nil] + optional :shift, Orb::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :shift + + # @!parse + # # @param trial_end_date [Time, Symbol, Orb::Models::SubscriptionUpdateTrialParams::TrialEndDate::UnionMember1] + # # @param shift [Boolean] + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(trial_end_date:, shift: nil, request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # The new date that the trial should end, or the literal string `immediate` to end + # the trial immediately. + # + # @example + # ```ruby + # case trial_end_date + # in Time + # # ... + # in Orb::Models::SubscriptionUpdateTrialParams::TrialEndDate::UnionMember1 + # # ... + # end + # ``` + class TrialEndDate < Orb::Union + variant Time + + variant enum: -> { Orb::Models::SubscriptionUpdateTrialParams::TrialEndDate::UnionMember1 } + + # @abstract + # + # @example + # ```ruby + # case union_member1 + # in :immediate + # # ... + # end + # ``` + class UnionMember1 < Orb::Enum + IMMEDIATE = :immediate + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/orb/models/subscription_update_trial_response.rb b/lib/orb/models/subscription_update_trial_response.rb new file mode 100644 index 00000000..faf4a6d4 --- /dev/null +++ b/lib/orb/models/subscription_update_trial_response.rb @@ -0,0 +1,1438 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # subscription_update_trial_response => { + # id: String, + # active_plan_phase_order: Integer, + # adjustment_intervals: -> { Orb::ArrayOf[Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval] === _1 }, + # auto_collection: Orb::BooleanModel, + # billing_cycle_anchor_configuration: Orb::Models::SubscriptionUpdateTrialResponse::BillingCycleAnchorConfiguration, + # **_ + # } + # ``` + class SubscriptionUpdateTrialResponse < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute active_plan_phase_order + # The current plan phase that is active, only if the subscription's plan has + # phases. + # + # @return [Integer, nil] + required :active_plan_phase_order, Integer, nil?: true + + # @!attribute adjustment_intervals + # The adjustment intervals for this subscription. + # + # @return [Array] + required :adjustment_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval] } + + # @!attribute auto_collection + # Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. This property defaults to + # the plan's behavior. If null, defaults to the customer's setting. + # + # @return [Boolean, nil] + required :auto_collection, Orb::BooleanModel, nil?: true + + # @!attribute billing_cycle_anchor_configuration + # + # @return [Orb::Models::SubscriptionUpdateTrialResponse::BillingCycleAnchorConfiguration] + required :billing_cycle_anchor_configuration, + -> { Orb::Models::SubscriptionUpdateTrialResponse::BillingCycleAnchorConfiguration } + + # @!attribute billing_cycle_day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is not part of the billing period. Set to null for + # subscriptions that are not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if the subscription is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute customer + # A customer is a buyer of your products, and the other party to the billing + # relationship. + # + # In Orb, customers are assigned system generated identifiers automatically, but + # it's often desirable to have these match existing identifiers in your system. To + # avoid having to denormalize Orb ID information, you can pass in an + # `external_customer_id` with your own identifier. See + # [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + # information about how these aliases work in Orb. + # + # In addition to having an identifier in your system, a customer may exist in a + # payment provider solution like Stripe. Use the `payment_provider_id` and the + # `payment_provider` enum field to express this mapping. + # + # A customer also has a timezone (from the standard + # [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + # your account's timezone. See [Timezone localization](/essentials/timezones) for + # information on what this timezone parameter influences within Orb. + # + # @return [Orb::Models::Customer] + required :customer, -> { Orb::Models::Customer } + + # @!attribute default_invoice_memo + # Determines the default memo on this subscriptions' invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @return [String, nil] + required :default_invoice_memo, String, nil?: true + + # @!attribute discount_intervals + # The discount intervals for this subscription. + # + # @return [Array] + required :discount_intervals, + -> { Orb::ArrayOf[union: Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval] } + + # @!attribute end_date + # The date Orb stops billing for this subscription. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_schedule + # + # @return [Array] + required :fixed_fee_quantity_schedule, + -> { Orb::ArrayOf[Orb::Models::SubscriptionUpdateTrialResponse::FixedFeeQuantitySchedule] } + + # @!attribute invoicing_threshold + # + # @return [String, nil] + required :invoicing_threshold, String, nil?: true + + # @!attribute maximum_intervals + # The maximum intervals for this subscription. + # + # @return [Array] + required :maximum_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionUpdateTrialResponse::MaximumInterval] } + + # @!attribute metadata + # User specified key-value pairs for the resource. If not present, this defaults + # to an empty dictionary. Individual keys can be removed by setting the value to + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to + # `null`. + # + # @return [Hash{Symbol=>String}] + required :metadata, Orb::HashOf[String] + + # @!attribute minimum_intervals + # The minimum intervals for this subscription. + # + # @return [Array] + required :minimum_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionUpdateTrialResponse::MinimumInterval] } + + # @!attribute net_terms + # Determines the difference between the invoice issue date for subscription + # invoices as the date that they are due. A value of `0` here represents that the + # invoice is due on issue, whereas a value of `30` represents that the customer + # has a month to pay the invoice. + # + # @return [Integer] + required :net_terms, Integer + + # @!attribute plan + # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + # subscribed to by a customer. Plans define the billing behavior of the + # subscription. You can see more about how to configure prices in the + # [Price resource](/reference/price). + # + # @return [Orb::Models::Plan] + required :plan, -> { Orb::Models::Plan } + + # @!attribute price_intervals + # The price intervals for this subscription. + # + # @return [Array] + required :price_intervals, + -> { Orb::ArrayOf[Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval] } + + # @!attribute redeemed_coupon + # + # @return [Orb::Models::SubscriptionUpdateTrialResponse::RedeemedCoupon, nil] + required :redeemed_coupon, + -> { + Orb::Models::SubscriptionUpdateTrialResponse::RedeemedCoupon + }, + nil?: true + + # @!attribute start_date + # The date Orb starts billing for this subscription. + # + # @return [Time] + required :start_date, Time + + # @!attribute status + # + # @return [Symbol, Orb::Models::SubscriptionUpdateTrialResponse::Status] + required :status, enum: -> { Orb::Models::SubscriptionUpdateTrialResponse::Status } + + # @!attribute trial_info + # + # @return [Orb::Models::SubscriptionUpdateTrialResponse::TrialInfo] + required :trial_info, -> { Orb::Models::SubscriptionUpdateTrialResponse::TrialInfo } + + # @!parse + # # @param id [String] + # # @param active_plan_phase_order [Integer, nil] + # # @param adjustment_intervals [Array] + # # @param auto_collection [Boolean, nil] + # # @param billing_cycle_anchor_configuration [Orb::Models::SubscriptionUpdateTrialResponse::BillingCycleAnchorConfiguration] + # # @param billing_cycle_day [Integer] + # # @param created_at [Time] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param customer [Orb::Models::Customer] + # # @param default_invoice_memo [String, nil] + # # @param discount_intervals [Array] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_schedule [Array] + # # @param invoicing_threshold [String, nil] + # # @param maximum_intervals [Array] + # # @param metadata [Hash{Symbol=>String}] + # # @param minimum_intervals [Array] + # # @param net_terms [Integer] + # # @param plan [Orb::Models::Plan] + # # @param price_intervals [Array] + # # @param redeemed_coupon [Orb::Models::SubscriptionUpdateTrialResponse::RedeemedCoupon, nil] + # # @param start_date [Time] + # # @param status [Symbol, Orb::Models::SubscriptionUpdateTrialResponse::Status] + # # @param trial_info [Orb::Models::SubscriptionUpdateTrialResponse::TrialInfo] + # # + # def initialize( + # id:, + # active_plan_phase_order:, + # adjustment_intervals:, + # auto_collection:, + # billing_cycle_anchor_configuration:, + # billing_cycle_day:, + # created_at:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # customer:, + # default_invoice_memo:, + # discount_intervals:, + # end_date:, + # fixed_fee_quantity_schedule:, + # invoicing_threshold:, + # maximum_intervals:, + # metadata:, + # minimum_intervals:, + # net_terms:, + # plan:, + # price_intervals:, + # redeemed_coupon:, + # start_date:, + # status:, + # trial_info:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # adjustment_interval => { + # id: String, + # adjustment: Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # start_date: Time + # } + # ``` + class AdjustmentInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment + # + # @return [Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + required :adjustment, + union: -> { Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment } + + # @!attribute applies_to_price_interval_ids + # The price interval IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the adjustment interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the adjustment interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param id [String] + # # @param adjustment [Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MaximumAdjustment] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case adjustment + # in {adjustment_type: "amount_discount", id: String, amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment ... + # in {adjustment_type: "percentage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment ... + # in {adjustment_type: "usage_discount", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment ... + # in {adjustment_type: "minimum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MinimumAdjustment ... + # in {adjustment_type: "maximum", id: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, is_invoice_level: Orb::BooleanModel} + # # Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MaximumAdjustment ... + # end + # ``` + # + # @example + # ```ruby + # case adjustment + # in Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + # # ... + # in Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + # # ... + # in Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + # # ... + # end + # ``` + class Adjustment < Orb::Union + discriminator :adjustment_type + + variant :amount_discount, + -> { Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment } + + variant :percentage_discount, + -> { Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment } + + variant :usage_discount, + -> { Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment } + + variant :minimum, + -> { Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MinimumAdjustment } + + variant :maximum, + -> { Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MaximumAdjustment } + + # @example + # ```ruby + # amount_discount_adjustment => { + # id: String, + # adjustment_type: :amount_discount, + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # **_ + # } + # ``` + class AmountDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :amount_discount] + required :adjustment_type, const: :amount_discount + + # @!attribute amount_discount + # The amount by which to discount the prices this adjustment applies to in a given + # billing period. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :amount_discount] + # # + # def initialize( + # id:, + # amount_discount:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # adjustment_type: :amount_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_adjustment => { + # id: String, + # adjustment_type: :percentage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # percentage_discount: Float, + # **_ + # } + # ``` + class PercentageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :percentage_discount] + required :adjustment_type, const: :percentage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute percentage_discount + # The percentage (as a value between 0 and 1) by which to discount the price + # intervals this adjustment applies to in a given billing period. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param percentage_discount [Float] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :percentage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # percentage_discount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :percentage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_adjustment => { + # id: String, + # adjustment_type: :usage_discount, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # plan_phase_order: Integer, + # **_ + # } + # ``` + class UsageDiscountAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :usage_discount] + required :adjustment_type, const: :usage_discount + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute usage_discount + # The number of usage units by which to discount the price this adjustment applies + # to in a given billing period. + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param usage_discount [Float] + # # @param adjustment_type [Symbol, :usage_discount] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # plan_phase_order:, + # reason:, + # usage_discount:, + # adjustment_type: :usage_discount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_adjustment => { + # id: String, + # adjustment_type: :minimum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # item_id: String, + # **_ + # } + # ``` + class MinimumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :minimum] + required :adjustment_type, const: :minimum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute item_id + # The item ID that revenue from this minimum will be attributed to. + # + # @return [String] + required :item_id, String + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param item_id [String] + # # @param minimum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :minimum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # item_id:, + # minimum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :minimum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_adjustment => { + # id: String, + # adjustment_type: :maximum, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # is_invoice_level: Orb::BooleanModel, + # maximum_amount: String, + # **_ + # } + # ``` + class MaximumAdjustment < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute adjustment_type + # + # @return [Symbol, :maximum] + required :adjustment_type, const: :maximum + + # @!attribute applies_to_price_ids + # The price IDs that this adjustment applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute is_invoice_level + # True for adjustments that apply to an entire invocice, false for adjustments + # that apply to only one price. + # + # @return [Boolean] + required :is_invoice_level, Orb::BooleanModel + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the prices this + # adjustment applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute plan_phase_order + # The plan phase in which this adjustment is active. + # + # @return [Integer, nil] + required :plan_phase_order, Integer, nil?: true + + # @!attribute reason + # The reason for the adjustment. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!parse + # # @param id [String] + # # @param applies_to_price_ids [Array] + # # @param is_invoice_level [Boolean] + # # @param maximum_amount [String] + # # @param plan_phase_order [Integer, nil] + # # @param reason [String, nil] + # # @param adjustment_type [Symbol, :maximum] + # # + # def initialize( + # id:, + # applies_to_price_ids:, + # is_invoice_level:, + # maximum_amount:, + # plan_phase_order:, + # reason:, + # adjustment_type: :maximum, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end + + # @example + # ```ruby + # billing_cycle_anchor_configuration => { + # day: Integer, + # month: Integer, + # year: Integer + # } + # ``` + class BillingCycleAnchorConfiguration < Orb::BaseModel + # @!attribute day + # The day of the month on which the billing cycle is anchored. If the maximum + # number of days in a month is greater than this value, the last day of the month + # is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + # period begins on the 30th. + # + # @return [Integer] + required :day, Integer + + # @!attribute month + # The month on which the billing cycle is anchored (e.g. a quarterly price + # anchored in February would have cycles starting February, May, August, and + # November). + # + # @return [Integer, nil] + optional :month, Integer, nil?: true + + # @!attribute year + # The year on which the billing cycle is anchored (e.g. a 2 year billing cycle + # anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + # + # @return [Integer, nil] + optional :year, Integer, nil?: true + + # @!parse + # # @param day [Integer] + # # @param month [Integer, nil] + # # @param year [Integer, nil] + # # + # def initialize(day:, month: nil, year: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case discount_interval + # in {discount_type: "amount", amount_discount: String, applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }} + # # Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::AmountDiscountInterval ... + # in {discount_type: "percentage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::PercentageDiscountInterval ... + # in {discount_type: "usage", applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, end_date: Time} + # # Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::UsageDiscountInterval ... + # end + # ``` + # + # @example + # ```ruby + # case discount_interval + # in Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::AmountDiscountInterval + # # ... + # in Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::PercentageDiscountInterval + # # ... + # in Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::UsageDiscountInterval + # # ... + # end + # ``` + class DiscountInterval < Orb::Union + discriminator :discount_type + + variant :amount, + -> { Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::AmountDiscountInterval } + + variant :percentage, + -> { Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::PercentageDiscountInterval } + + variant :usage, + -> { Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::UsageDiscountInterval } + + # @example + # ```ruby + # amount_discount_interval => { + # amount_discount: String, + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :amount, + # end_date: Time + # } + # ``` + class AmountDiscountInterval < Orb::BaseModel + # @!attribute amount_discount + # Only available if discount_type is `amount`. + # + # @return [String] + required :amount_discount, String + + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :amount] + required :discount_type, const: :amount + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param amount_discount [String] + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param discount_type [Symbol, :amount] + # # + # def initialize( + # amount_discount:, + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # discount_type: :amount, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # percentage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :percentage, + # end_date: Time, + # percentage_discount: Float + # } + # ``` + class PercentageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :percentage] + required :discount_type, const: :percentage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute percentage_discount + # Only available if discount_type is `percentage`.This is a number between 0 + # and 1. + # + # @return [Float] + required :percentage_discount, Float + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param percentage_discount [Float] + # # @param start_date [Time] + # # @param discount_type [Symbol, :percentage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # percentage_discount:, + # start_date:, + # discount_type: :percentage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage_discount_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: :usage, + # end_date: Time, + # start_date: Time + # } + # ``` + class UsageDiscountInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this discount interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, :usage] + required :discount_type, const: :usage + + # @!attribute end_date + # The end date of the discount interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # The start date of the discount interval. + # + # @return [Time] + required :start_date, Time + + # @!attribute usage_discount + # Only available if discount_type is `usage`. Number of usage units that this + # discount is for + # + # @return [Float] + required :usage_discount, Float + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # @param usage_discount [Float] + # # @param discount_type [Symbol, :usage] + # # + # def initialize( + # applies_to_price_ids:, + # applies_to_price_interval_ids:, + # end_date:, + # start_date:, + # usage_discount:, + # discount_type: :usage, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # fixed_fee_quantity_schedule => { + # end_date: Time, + # price_id: String, + # quantity: Float, + # start_date: Time + # } + # ``` + class FixedFeeQuantitySchedule < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param end_date [Time, nil] + # # @param price_id [String] + # # @param quantity [Float] + # # @param start_date [Time] + # # + # def initialize(end_date:, price_id:, quantity:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # maximum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # maximum_amount: String, + # start_date: Time + # } + # ``` + class MaximumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this maximum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the maximum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute maximum_amount + # The maximum amount to charge in a given billing period for the price intervals + # this transform applies to. + # + # @return [String] + required :maximum_amount, String + + # @!attribute start_date + # The start date of the maximum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param maximum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, maximum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # minimum_interval => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # applies_to_price_interval_ids: -> { Orb::ArrayOf[String] === _1 }, + # end_date: Time, + # minimum_amount: String, + # start_date: Time + # } + # ``` + class MinimumInterval < Orb::BaseModel + # @!attribute applies_to_price_ids + # The price ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute applies_to_price_interval_ids + # The price interval ids that this minimum interval applies to. + # + # @return [Array] + required :applies_to_price_interval_ids, Orb::ArrayOf[String] + + # @!attribute end_date + # The end date of the minimum interval. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute minimum_amount + # The minimum amount to charge in a given billing period for the price intervals + # this minimum applies to. + # + # @return [String] + required :minimum_amount, String + + # @!attribute start_date + # The start date of the minimum interval. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param applies_to_price_interval_ids [Array] + # # @param end_date [Time, nil] + # # @param minimum_amount [String] + # # @param start_date [Time] + # # + # def initialize(applies_to_price_ids:, applies_to_price_interval_ids:, end_date:, minimum_amount:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # price_interval => { + # id: String, + # billing_cycle_day: Integer, + # current_billing_period_end_date: Time, + # current_billing_period_start_date: Time, + # end_date: Time, + # **_ + # } + # ``` + class PriceInterval < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute billing_cycle_day + # The day of the month that Orb bills for this price + # + # @return [Integer] + required :billing_cycle_day, Integer + + # @!attribute current_billing_period_end_date + # The end of the current billing period. This is an exclusive timestamp, such that + # the instant returned is exactly the end of the billing period. Set to null if + # this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_end_date, Time, nil?: true + + # @!attribute current_billing_period_start_date + # The start date of the current billing period. This is an inclusive timestamp; + # the instant returned is exactly the beginning of the billing period. Set to null + # if this price interval is not currently active. + # + # @return [Time, nil] + required :current_billing_period_start_date, Time, nil?: true + + # @!attribute end_date + # The end date of the price interval. This is the date that Orb stops billing for + # this price. + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute fixed_fee_quantity_transitions + # The fixed fee quantity transitions for this price interval. This is only + # relevant for fixed fees. + # + # @return [Array, nil] + required :fixed_fee_quantity_transitions, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval::FixedFeeQuantityTransition] + }, + nil?: true + + # @!attribute price + # The Price resource represents a price that can be billed on a subscription, + # resulting in a charge on an invoice in the form of an invoice line item. Prices + # take a quantity and determine an amount to bill. + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given Price object. The model_type field + # determines the key for the configuration object that is present. + # + # For more on the types of prices, see + # [the core concepts documentation](/core-concepts#plan-and-price) + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + required :price, union: -> { Orb::Models::Price } + + # @!attribute start_date + # The start date of the price interval. This is the date that Orb starts billing + # for this price. + # + # @return [Time] + required :start_date, Time + + # @!parse + # # The Price Interval resource represents a period of time for which a price will + # # bill on a subscription. A subscription’s price intervals define its billing + # # behavior. + # # + # # @param id [String] + # # @param billing_cycle_day [Integer] + # # @param current_billing_period_end_date [Time, nil] + # # @param current_billing_period_start_date [Time, nil] + # # @param end_date [Time, nil] + # # @param fixed_fee_quantity_transitions [Array, nil] + # # @param price [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # # @param start_date [Time] + # # + # def initialize( + # id:, + # billing_cycle_day:, + # current_billing_period_end_date:, + # current_billing_period_start_date:, + # end_date:, + # fixed_fee_quantity_transitions:, + # price:, + # start_date:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # fixed_fee_quantity_transition => { + # effective_date: Time, + # price_id: String, + # quantity: Integer + # } + # ``` + class FixedFeeQuantityTransition < Orb::BaseModel + # @!attribute effective_date + # + # @return [Time] + required :effective_date, Time + + # @!attribute price_id + # + # @return [String] + required :price_id, String + + # @!attribute quantity + # + # @return [Integer] + required :quantity, Integer + + # @!parse + # # @param effective_date [Time] + # # @param price_id [String] + # # @param quantity [Integer] + # # + # def initialize(effective_date:, price_id:, quantity:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + + # @example + # ```ruby + # redeemed_coupon => { + # coupon_id: String, + # end_date: Time, + # start_date: Time + # } + # ``` + class RedeemedCoupon < Orb::BaseModel + # @!attribute coupon_id + # + # @return [String] + required :coupon_id, String + + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!attribute start_date + # + # @return [Time] + required :start_date, Time + + # @!parse + # # @param coupon_id [String] + # # @param end_date [Time, nil] + # # @param start_date [Time] + # # + # def initialize(coupon_id:, end_date:, start_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case status + # in :active + # # ... + # in :ended + # # ... + # in :upcoming + # # ... + # end + # ``` + class Status < Orb::Enum + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @example + # ```ruby + # trial_info => { + # end_date: Time + # } + # ``` + class TrialInfo < Orb::BaseModel + # @!attribute end_date + # + # @return [Time, nil] + required :end_date, Time, nil?: true + + # @!parse + # # @param end_date [Time, nil] + # # + # def initialize(end_date:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end + end +end diff --git a/lib/orb/models/subscription_usage.rb b/lib/orb/models/subscription_usage.rb new file mode 100644 index 00000000..1a07379d --- /dev/null +++ b/lib/orb/models/subscription_usage.rb @@ -0,0 +1,352 @@ +# frozen_string_literal: true + +module Orb + module Models + # @abstract + # + # @example + # ```ruby + # case subscription_usage + # in Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage + # # ... + # in Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage + # # ... + # end + # ``` + class SubscriptionUsage < Orb::Union + variant -> { Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage } + + variant -> { Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage } + + # @example + # ```ruby + # ungrouped_subscription_usage => { + # data: -> { Orb::ArrayOf[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data] === _1 } + # } + # ``` + class UngroupedSubscriptionUsage < Orb::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Orb::ArrayOf[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data] } + + # @!parse + # # @param data [Array] + # # + # def initialize(data:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # data => { + # billable_metric: Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::BillableMetric, + # usage: -> { Orb::ArrayOf[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::Usage] === _1 }, + # view_mode: Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::ViewMode + # } + # ``` + class Data < Orb::BaseModel + # @!attribute billable_metric + # + # @return [Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::BillableMetric] + required :billable_metric, + -> { Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::BillableMetric } + + # @!attribute usage + # + # @return [Array] + required :usage, + -> { + Orb::ArrayOf[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::Usage] + } + + # @!attribute view_mode + # + # @return [Symbol, Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::ViewMode] + required :view_mode, + enum: -> { Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::ViewMode } + + # @!parse + # # @param billable_metric [Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::BillableMetric] + # # @param usage [Array] + # # @param view_mode [Symbol, Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::ViewMode] + # # + # def initialize(billable_metric:, usage:, view_mode:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String, + # name: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage => { + # quantity: Float, + # timeframe_end: Time, + # timeframe_start: Time + # } + # ``` + class Usage < Orb::BaseModel + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute timeframe_end + # + # @return [Time] + required :timeframe_end, Time + + # @!attribute timeframe_start + # + # @return [Time] + required :timeframe_start, Time + + # @!parse + # # @param quantity [Float] + # # @param timeframe_end [Time] + # # @param timeframe_start [Time] + # # + # def initialize(quantity:, timeframe_end:, timeframe_start:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case view_mode + # in :periodic + # # ... + # in :cumulative + # # ... + # end + # ``` + class ViewMode < Orb::Enum + PERIODIC = :periodic + CUMULATIVE = :cumulative + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @example + # ```ruby + # grouped_subscription_usage => { + # data: -> { Orb::ArrayOf[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data] === _1 }, + # pagination_metadata: Orb::Models::PaginationMetadata + # } + # ``` + class GroupedSubscriptionUsage < Orb::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Orb::ArrayOf[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data] } + + # @!attribute pagination_metadata + # + # @return [Orb::Models::PaginationMetadata, nil] + optional :pagination_metadata, -> { Orb::Models::PaginationMetadata }, nil?: true + + # @!parse + # # @param data [Array] + # # @param pagination_metadata [Orb::Models::PaginationMetadata, nil] + # # + # def initialize(data:, pagination_metadata: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # data => { + # billable_metric: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric, + # metric_group: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup, + # usage: -> { Orb::ArrayOf[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::Usage] === _1 }, + # view_mode: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::ViewMode + # } + # ``` + class Data < Orb::BaseModel + # @!attribute billable_metric + # + # @return [Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric] + required :billable_metric, + -> { Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric } + + # @!attribute metric_group + # + # @return [Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup] + required :metric_group, + -> { + Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup + } + + # @!attribute usage + # + # @return [Array] + required :usage, + -> { Orb::ArrayOf[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::Usage] } + + # @!attribute view_mode + # + # @return [Symbol, Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::ViewMode] + required :view_mode, + enum: -> { + Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::ViewMode + } + + # @!parse + # # @param billable_metric [Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric] + # # @param metric_group [Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup] + # # @param usage [Array] + # # @param view_mode [Symbol, Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::ViewMode] + # # + # def initialize(billable_metric:, metric_group:, usage:, view_mode:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @example + # ```ruby + # billable_metric => { + # id: String, + # name: String + # } + # ``` + class BillableMetric < Orb::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param name [String] + # # + # def initialize(id:, name:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # metric_group => { + # property_key: String, + # property_value: String + # } + # ``` + class MetricGroup < Orb::BaseModel + # @!attribute property_key + # + # @return [String] + required :property_key, String + + # @!attribute property_value + # + # @return [String] + required :property_value, String + + # @!parse + # # @param property_key [String] + # # @param property_value [String] + # # + # def initialize(property_key:, property_value:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @example + # ```ruby + # usage => { + # quantity: Float, + # timeframe_end: Time, + # timeframe_start: Time + # } + # ``` + class Usage < Orb::BaseModel + # @!attribute quantity + # + # @return [Float] + required :quantity, Float + + # @!attribute timeframe_end + # + # @return [Time] + required :timeframe_end, Time + + # @!attribute timeframe_start + # + # @return [Time] + required :timeframe_start, Time + + # @!parse + # # @param quantity [Float] + # # @param timeframe_end [Time] + # # @param timeframe_start [Time] + # # + # def initialize(quantity:, timeframe_end:, timeframe_start:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case view_mode + # in :periodic + # # ... + # in :cumulative + # # ... + # end + # ``` + class ViewMode < Orb::Enum + PERIODIC = :periodic + CUMULATIVE = :cumulative + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/orb/models/subscriptions.rb b/lib/orb/models/subscriptions.rb index 6e4fbb2a..331e2c55 100644 --- a/lib/orb/models/subscriptions.rb +++ b/lib/orb/models/subscriptions.rb @@ -1,18 +1,32 @@ -require "orb/model" -require "orb/models/subscription" +# frozen_string_literal: true + module Orb module Models - class Subscriptions < Orb::Model - class PaginationMetadata < Orb::Model - # @!attribute [rw] has_more - required :has_more, Orb::BooleanModel - # @!attribute [rw] next_cursor - required :next_cursor, String - end - # @!attribute [rw] data - required :data, Orb::ArrayOf.new(Orb::Models::Subscription) - # @!attribute [rw] pagination_metadata - required :pagination_metadata, PaginationMetadata + # @example + # ```ruby + # subscriptions_api => { + # data: -> { Orb::ArrayOf[Orb::Models::Subscription] === _1 }, + # pagination_metadata: Orb::Models::PaginationMetadata + # } + # ``` + class SubscriptionsAPI < Orb::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Orb::ArrayOf[Orb::Models::Subscription] } + + # @!attribute pagination_metadata + # + # @return [Orb::Models::PaginationMetadata] + required :pagination_metadata, -> { Orb::Models::PaginationMetadata } + + # @!parse + # # @param data [Array] + # # @param pagination_metadata [Orb::Models::PaginationMetadata] + # # + # def initialize(data:, pagination_metadata:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end end end diff --git a/lib/orb/models/top_level_ping_params.rb b/lib/orb/models/top_level_ping_params.rb new file mode 100644 index 00000000..4e3bede6 --- /dev/null +++ b/lib/orb/models/top_level_ping_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Orb + module Models + class TopLevelPingParams < Orb::BaseModel + # @!parse + # extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + # @!parse + # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/models/top_level_ping_response.rb b/lib/orb/models/top_level_ping_response.rb index 0d2ad4c9..ab91c197 100644 --- a/lib/orb/models/top_level_ping_response.rb +++ b/lib/orb/models/top_level_ping_response.rb @@ -1,9 +1,25 @@ -require "orb/model" +# frozen_string_literal: true + module Orb module Models - class TopLevelPingResponse < Orb::Model - # @!attribute [rw] response + # @example + # ```ruby + # top_level_ping_response => { + # response: String + # } + # ``` + class TopLevelPingResponse < Orb::BaseModel + # @!attribute response + # + # @return [String] required :response, String + + # @!parse + # # @param response [String] + # # + # def initialize(response:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void end end end diff --git a/lib/orb/models/trial_discount.rb b/lib/orb/models/trial_discount.rb new file mode 100644 index 00000000..ebbada0c --- /dev/null +++ b/lib/orb/models/trial_discount.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module Orb + module Models + # @example + # ```ruby + # trial_discount => { + # applies_to_price_ids: -> { Orb::ArrayOf[String] === _1 }, + # discount_type: Orb::Models::TrialDiscount::DiscountType, + # reason: String, + # trial_amount_discount: String, + # trial_percentage_discount: Float + # } + # ``` + class TrialDiscount < Orb::BaseModel + # @!attribute applies_to_price_ids + # List of price_ids that this discount applies to. For plan/plan phase discounts, + # this can be a subset of prices. + # + # @return [Array] + required :applies_to_price_ids, Orb::ArrayOf[String] + + # @!attribute discount_type + # + # @return [Symbol, Orb::Models::TrialDiscount::DiscountType] + required :discount_type, enum: -> { Orb::Models::TrialDiscount::DiscountType } + + # @!attribute reason + # + # @return [String, nil] + optional :reason, String, nil?: true + + # @!attribute trial_amount_discount + # Only available if discount_type is `trial` + # + # @return [String, nil] + optional :trial_amount_discount, String, nil?: true + + # @!attribute trial_percentage_discount + # Only available if discount_type is `trial` + # + # @return [Float, nil] + optional :trial_percentage_discount, Float, nil?: true + + # @!parse + # # @param applies_to_price_ids [Array] + # # @param discount_type [Symbol, Orb::Models::TrialDiscount::DiscountType] + # # @param reason [String, nil] + # # @param trial_amount_discount [String, nil] + # # @param trial_percentage_discount [Float, nil] + # # + # def initialize( + # applies_to_price_ids:, + # discount_type:, + # reason: nil, + # trial_amount_discount: nil, + # trial_percentage_discount: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Orb::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case discount_type + # in :trial + # # ... + # end + # ``` + class DiscountType < Orb::Enum + TRIAL = :trial + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/orb/models/usage_update_by_external_id_response.rb b/lib/orb/models/usage_update_by_external_id_response.rb deleted file mode 100644 index 2ed07ce5..00000000 --- a/lib/orb/models/usage_update_by_external_id_response.rb +++ /dev/null @@ -1,11 +0,0 @@ -require "orb/model" -module Orb - module Models - class UsageUpdateByExternalIDResponse < Orb::Model - # @!attribute [rw] duplicate - required :duplicate, Orb::ArrayOf.new(String) - # @!attribute [rw] ingested - required :ingested, Orb::ArrayOf.new(String) - end - end -end diff --git a/lib/orb/models/usage_update_response.rb b/lib/orb/models/usage_update_response.rb deleted file mode 100644 index e721f0f5..00000000 --- a/lib/orb/models/usage_update_response.rb +++ /dev/null @@ -1,11 +0,0 @@ -require "orb/model" -module Orb - module Models - class UsageUpdateResponse < Orb::Model - # @!attribute [rw] duplicate - required :duplicate, Orb::ArrayOf.new(String) - # @!attribute [rw] ingested - required :ingested, Orb::ArrayOf.new(String) - end - end -end diff --git a/lib/orb/orb.rb b/lib/orb/orb.rb deleted file mode 100644 index 646a1d5a..00000000 --- a/lib/orb/orb.rb +++ /dev/null @@ -1,264 +0,0 @@ -require "orb/base_client" -require "orb/resources/coupons/coupons" -require "orb/resources/credit_notes" -require "orb/resources/customers/customers" -require "orb/resources/events/events" -require "orb/resources/invoice_line_items" -require "orb/resources/invoices" -require "orb/resources/items" -require "orb/resources/metrics" -require "orb/resources/plans/plans" -require "orb/resources/prices/prices" -require "orb/resources/subscriptions" -require "orb/resources/top_level" -require "orb/base_client" - -require "orb/base_pagination" - -require "orb/pooled_net_requester" - -require "orb/util" - -module Orb - class Client < Orb::BaseClient - attr_reader( - :default_params, - :top_level, - :coupons, - :credit_notes, - :customers, - :events, - :invoice_line_items, - :invoices, - :items, - :metrics, - :plans, - :prices, - :subscriptions - ) - def auth_headers - { "Authorization" => "Bearer #{@api_key}" } - end - def initialize( - environment: nil, - api_key: nil, - requester: nil, - base_url: nil - ) - environments = { production: "https://api.withorb.com/v1" } - @default_headers = {} - @default_params = {} - @api_key = [api_key, ENV["ORB_API_KEY"]].find { |value| !value.nil? } - super( - server_uri_string: environments[environment&.to_sym] || base_url, - headers: @default_headers - ) - - @requester = requester || Orb::PooledNetRequester.new - @top_level = Orb::Resources::TopLevelResource.new(client: self) - @coupons = Orb::Resources::CouponsResource.new(client: self) - @credit_notes = Orb::Resources::CreditNotesResource.new(client: self) - @customers = Orb::Resources::CustomersResource.new(client: self) - @events = Orb::Resources::EventsResource.new(client: self) - @invoice_line_items = - Orb::Resources::InvoiceLineItemsResource.new(client: self) - @invoices = Orb::Resources::InvoicesResource.new(client: self) - @items = Orb::Resources::ItemsResource.new(client: self) - @metrics = Orb::Resources::MetricsResource.new(client: self) - @plans = Orb::Resources::PlansResource.new(client: self) - @prices = Orb::Resources::PricesResource.new(client: self) - @subscriptions = Orb::Resources::SubscriptionsResource.new(client: self) - end - def make_status_error(err_msg:, body:, response:) - type = (body["type"] if body.is_a? Hash) - if type == - "https://docs.withorb.com/reference/error-responses#400-constraint-violation" - return( - Orb::HTTP::ConstraintViolation.new( - err_msg: err_msg, - response: response, - body: body - ) - ) - end - if type == - "https://docs.withorb.com/reference/error-responses#400-duplicate-resource-creation" - return( - Orb::HTTP::DuplicateResourceCreation.new( - err_msg: err_msg, - response: response, - body: body - ) - ) - end - if type == - "https://docs.withorb.com/reference/error-responses#404-feature-not-available" - return( - Orb::HTTP::FeatureNotAvailable.new( - err_msg: err_msg, - response: response, - body: body - ) - ) - end - if type == - "https://docs.withorb.com/reference/error-responses#400-request-validation-errors" - return( - Orb::HTTP::RequestValidationError.new( - err_msg: err_msg, - response: response, - body: body - ) - ) - end - if type == - "https://docs.withorb.com/reference/error-responses#401-authentication-error" - return( - Orb::HTTP::OrbAuthenticationError.new( - err_msg: err_msg, - response: response, - body: body - ) - ) - end - if type == - "https://docs.withorb.com/reference/error-responses#404-resource-not-found" - return( - Orb::HTTP::ResourceNotFound.new( - err_msg: err_msg, - response: response, - body: body - ) - ) - end - if type == - "https://docs.withorb.com/reference/error-responses#404-url-not-found" - return( - Orb::HTTP::URLNotFound.new( - err_msg: err_msg, - response: response, - body: body - ) - ) - end - if type == - "https://docs.withorb.com/reference/error-responses#409-resource-conflict" - return( - Orb::HTTP::ResourceConflict.new( - err_msg: err_msg, - response: response, - body: body - ) - ) - end - if type == - "https://docs.withorb.com/reference/error-responses#413-request-too-large" - return( - Orb::HTTP::RequestTooLarge.new( - err_msg: err_msg, - response: response, - body: body - ) - ) - end - if type == - "https://docs.withorb.com/reference/error-responses#413-resource-too-large" - return( - Orb::HTTP::ResourceTooLarge.new( - err_msg: err_msg, - response: response, - body: body - ) - ) - end - if type == - "https://docs.withorb.com/reference/error-responses#429-too-many-requests" - return( - Orb::HTTP::TooManyRequests.new( - err_msg: err_msg, - response: response, - body: body - ) - ) - end - if type == - "https://docs.withorb.com/reference/error-responses#500-internal-server-error" - return( - Orb::HTTP::OrbInternalServerError.new( - err_msg: err_msg, - response: response, - body: body - ) - ) - end - case response.code.to_i - when 500..599 - Orb::HTTP::OrbInternalServerError.new( - err_msg: err_msg, - response: response, - body: { - status => 500, - type => - "https://docs.withorb.com/reference/error-responses#500-internal-server-error", - detail => nil, - title => nil - } - ) - when 400 - Orb::HTTP::BadRequestError.new( - err_msg: err_msg, - response: response, - body: body - ) - when 401 - Orb::HTTP::AuthenticationError.new( - err_msg: err_msg, - response: response, - body: body - ) - when 403 - Orb::HTTP::PermissionDeniedError.new( - err_msg: err_msg, - response: response, - body: body - ) - when 404 - Orb::HTTP::NotFoundError.new( - err_msg: err_msg, - response: response, - body: body - ) - when 409 - Orb::HTTP::ConflictError.new( - err_msg: err_msg, - response: response, - body: body - ) - when 422 - Orb::HTTP::UnprocessableEntityError.new( - err_msg: err_msg, - response: response, - body: body - ) - when 429 - Orb::HTTP::RateLimitError.new( - err_msg: err_msg, - response: response, - body: body - ) - when 500..599 - Orb::HTTP::InternalServerError.new( - err_msg: err_msg, - response: response, - body: body - ) - else - Orb::HTTP::APIStatusError.new( - err_msg: err_msg, - response: response, - body: body - ) - end - end - end -end diff --git a/lib/orb/page.rb b/lib/orb/page.rb new file mode 100644 index 00000000..2887c447 --- /dev/null +++ b/lib/orb/page.rb @@ -0,0 +1,124 @@ +# frozen_string_literal: true + +module Orb + # @example + # ```ruby + # if page.has_next? + # page = page.next_page + # end + # ``` + # + # @example + # ```ruby + # page.auto_paging_each do |item| + # # item ... + # end + # ``` + # + # @example + # ```ruby + # items = page.to_enum.take(2) + # + # items => Array + # ``` + class Page + include Orb::BasePage + + # @return [Array] + attr_accessor :data + + # @return [PaginationMetadata] + attr_accessor :pagination_metadata + + # @private + # + # @param client [Orb::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}] + # @param unwrapped [Hash{Symbol=>Object}] + # + def initialize(client:, req:, headers:, unwrapped:) + @client = client + @req = req + + model = req.fetch(:model) + + case unwrapped + in {data: data} if data.is_a?(Array) || data.nil? + @data = data&.map { |row| model.coerce(row) } + else + end + + case unwrapped + in {pagination_metadata: pagination_metadata} if pagination_metadata.is_a?(Hash) || pagination_metadata.is_nil? + @pagination_metadata = Orb::Page::PaginationMetadata.coerce(pagination_metadata) + else + end + end + + # @return [Boolean] + # + def next_page? + !pagination_metadata&.next_cursor.nil? + end + + # @raise [Orb::HTTP::Error] + # @return [Orb::Page] + # + def next_page + unless next_page? + raise "No more pages available; please check #next_page? before calling #next_page" + end + + req = Orb::Util.deep_merge(@req, {query: {cursor: pagination_metadata&.next_cursor}}) + @client.request(req) + end + + # @param blk [Proc] + # + def auto_paging_each(&blk) + unless block_given? + raise ArgumentError.new("A block must be given to #auto_paging_each") + end + page = self + loop do + page.data&.each { |row| blk.call(row) } + break unless page.next_page? + page = page.next_page + end + end + + # @return [String] + # + def inspect + "#<#{self.class}:0x#{object_id.to_s(16)} data=#{data.inspect} pagination_metadata=#{pagination_metadata.inspect}>" + end + + # @example + # ```ruby + # pagination_metadata => { + # has_more: Orb::BooleanModel, + # next_cursor: String + # } + # ``` + class PaginationMetadata < Orb::BaseModel + # @!attribute has_more + # + # @return [Boolean] + required :has_more, Orb::BooleanModel + + # @!attribute next_cursor + # + # @return [String, nil] + required :next_cursor, String, nil?: true + + # @!parse + # # @param has_more [Boolean] + # # @param next_cursor [String, nil] + # # + # def initialize(has_more:, next_cursor:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + end +end diff --git a/lib/orb/pagination.rb b/lib/orb/pagination.rb deleted file mode 100644 index ed39e429..00000000 --- a/lib/orb/pagination.rb +++ /dev/null @@ -1,34 +0,0 @@ -require "orb/base_pagination" -require "orb/model" -class PagePaginationMetadata < Orb::Model - # @!attribute [rw] has_more - required :has_more, Orb::BooleanModel - # @!attribute [rw] next_cursor - required :next_cursor, String -end - -class Page < Orb::Model - include Orb::Pagination::Page - required :data, Orb::ArrayOf.new(Orb::Unknown) - required :pagination_metadata, PagePaginationMetadata - def initialize(client:, request:, json:) - super() - # ensure we can reuse fields in inherited models. - # Class instance vars do not propagate by inheritance, - # and we don't want to use class vars. - self.class.fields = - Page.fields&.merge(self.class.fields) || self.class.fields - @json = json - @client = client - @request = request - end - def next_page? - @data.dig(:pagination_metadata, :next_cursor) - end - def next_page_options - { query: { "cursor" => @data.dig(:pagination_metadata, :next_cursor) } } - end - def page_items - @data[:data] - end -end diff --git a/lib/orb/pooled_net_requester.rb b/lib/orb/pooled_net_requester.rb index 409c2be1..74fd1d47 100644 --- a/lib/orb/pooled_net_requester.rb +++ b/lib/orb/pooled_net_requester.rb @@ -1,66 +1,94 @@ -# typed: true # frozen_string_literal: true -require "connection_pool" -require "net/http" -require_relative "requester" - -# TODO: read https://gist.github.com/TheRusskiy/bcec13fda6589d13ef8a658bda561a7e. -# since it looks like net conn options also change reuse identity. -# TODO parameterizing this -- max conns, etc module Orb + # @private + # class PooledNetRequester - include Requester - def initialize @mutex = Mutex.new @pools = {} end - def get_pool(req) - hostname = req[:host] - scheme = req[:scheme] - port = - req[:port] || - case scheme.to_sym - when :https - Net::HTTP.https_default_port - else - Net::HTTP.http_default_port - end + # @private + # + # @param url [URL::Generic] + # @param timeout [Float] + # + # @return [ConnectionPool] + # + private def get_pool(url) + origin = Orb::Util.uri_origin(url) @mutex.synchronize do - @pools[hostname] ||= ConnectionPool.new do - conn = Net::HTTP.new(hostname, port = port) - conn.use_ssl = scheme.to_sym == :https - conn.start - conn + @pools[origin] ||= ConnectionPool.new(size: Etc.nprocessors) do + port = + case [url.port, url.scheme] + in [Integer, _] + url.port + in [nil, "http" | "ws"] + Net::HTTP.http_default_port + in [nil, "https" | "wss"] + Net::HTTP.https_default_port + end + + session = Net::HTTP.new(url.host, port) + session.use_ssl = %w[https wss].include?(url.scheme) + session.max_retries = 0 + session end - @pools[hostname] end end + # @private + # + # @param req [Hash{Symbol => Object}] + # @option req [Symbol] :method + # @option req [URI::Generic] :url + # @option req [Hash{String => String}] :headers + # @option req [String, Hash] :body + # @option req [Float] :timeout + # + # @return [Net::HTTPResponse] + # def execute(req) - get_pool(req).with do |conn| - # Net can't understand posting to a URI representing only path + query, - # so we concatenate - query_string = ("?#{URI.encode_www_form(req[:query])}" if req[:query]) - uri_string = (req[:path] || "/") + (query_string || "") - case req[:method] - when :get - conn.get(uri_string, req[:headers]) - when :patch - conn.patch(uri_string, req[:body], req[:headers]) - when :put - conn.put(uri_string, req[:body], req[:headers]) - when :post - conn.post(uri_string, req[:body], req[:headers]) - # TODO: more verbs - when :delete - conn.delete(uri_string, req[:headers]) - else - raise NotImplementedError.new, req[:method] - end + method, url, headers, body, timeout = req.fetch_values(:method, :url, :headers, :body, :timeout) + + request = Net::HTTPGenericRequest.new( + method.to_s.upcase, + !body.nil?, + ![:head, :options].include?(method), + url.to_s + ) + + headers.each { |k, v| request[k] = v } + case body + in String | nil + request.body = body + in IO | StringIO + request.body_stream = body + end + + # This timeout is for acquiring a connection from the pool + # The default 5 seconds seems too short, lets just have a nearly unbounded queue for now + # + # TODO: revisit this around granular timeout / concurrency control + get_pool(url).with(timeout: 600) do |conn| + conn.open_timeout = timeout + conn.read_timeout = timeout + conn.write_timeout = timeout + conn.continue_timeout = timeout + + conn.start unless conn.started? + + conn.request(request) + # rubocop:disable Lint/RescueException + rescue Exception => e + # rubocop:enable Lint/RescueException + # should close connection on all errors to ensure no invalid state persists + conn.finish if conn.started? + raise e end + rescue ConnectionPool::TimeoutError + raise Orb::APITimeoutError.new(url: url) end end end diff --git a/lib/orb/request_options.rb b/lib/orb/request_options.rb new file mode 100644 index 00000000..9e600031 --- /dev/null +++ b/lib/orb/request_options.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +module Orb + # @private + # + # @abstract + # + module RequestParameters + # @!parse + # # Options to specify HTTP behaviour for this request. + # # @return [Orb::RequestOptions, Hash{Symbol=>Object}] + # attr_accessor :request_options + + # @param mod [Module] + # + def self.included(mod) + return unless mod <= Orb::BaseModel + + mod.extend(Orb::RequestParameters::Converter) + mod.optional(:request_options, Orb::RequestOptions) + end + + # @private + # + module Converter + # @private + # + # @param params [Object] + # + # @return [Array(Object, Hash{Symbol=>Object})] + # + def dump_request(params) + case (dumped = dump(params)) + in Hash + [dumped.except(:request_options), dumped[:request_options]] + else + [dumped, nil] + end + end + end + end + + # Specify HTTP behaviour to use for a specific request. These options supplement + # or override those provided at the client level. + # + # When making a request, you can pass an actual {RequestOptions} instance, or + # simply pass a Hash with symbol keys matching the attributes on this class. + class RequestOptions < Orb::BaseModel + # @private + # + # @param opts [Orb::RequestOptions, Hash{Symbol=>Object}] + # + # @raise [ArgumentError] + # + def self.validate!(opts) + case opts + in Orb::RequestOptions | Hash + opts.to_h.each_key do |k| + unless fields.include?(k) + raise ArgumentError.new("Request `opts` keys must be one of #{fields.keys}, got #{k.inspect}") + end + end + else + raise ArgumentError.new("Request `opts` must be a Hash or RequestOptions, got #{opts.inspect}") + end + end + + # @!attribute idempotency_key + # Idempotency key to send with request and all associated retries. Will only be + # sent for write requests. + # + # @return [String, nil] + optional :idempotency_key, String + + # @!attribute extra_query + # Extra query params to send with the request. These are `.merge`’d into any + # `query` given at the client level. + # + # @return [Hash{String=>Array, String, nil}, nil] + optional :extra_query, Orb::HashOf[Orb::ArrayOf[String]] + + # @!attribute extra_headers + # Extra headers to send with the request. These are `.merged`’d into any + # `extra_headers` given at the client level. + # + # @return [Hash{String=>String, nil}, nil] + optional :extra_headers, Orb::HashOf[String, nil?: true] + + # @!attribute extra_body + # Extra data to send with the request. These are deep merged into any data + # generated as part of the normal request. + # + # @return [Hash{Symbol=>Object}, nil] + optional :extra_body, Orb::HashOf[Orb::Unknown] + + # @!attribute max_retries + # Maximum number of retries to attempt after a failed initial request. + # + # @return [Integer, nil] + optional :max_retries, Integer + + # @!attribute timeout + # Request timeout in seconds. + # + # @return [Float, nil] + optional :timeout, Float + + # @!parse + # # Returns a new instance of RequestOptions. + # # + # # @param values [Hash{Symbol=>Object}] + # # + # def initialize(values = {}) = super + end +end diff --git a/lib/orb/requester.rb b/lib/orb/requester.rb deleted file mode 100644 index e5a1fafa..00000000 --- a/lib/orb/requester.rb +++ /dev/null @@ -1,13 +0,0 @@ -# typed: false -# type: strong -# frozen_string_literal: true - -# an abstraction for executing a single http request message exchange. -# TODO types of requests and responses so people can implement. Does Net have default request/response types that aren't terrible? -module Orb - module Requester - def execute(_request) - raise "Not implemented" - end - end -end diff --git a/lib/orb/resources/alerts.rb b/lib/orb/resources/alerts.rb new file mode 100644 index 00000000..38b9e33b --- /dev/null +++ b/lib/orb/resources/alerts.rb @@ -0,0 +1,259 @@ +# frozen_string_literal: true + +module Orb + module Resources + class Alerts + # This endpoint retrieves an alert by its ID. + # + # @param alert_id [String] + # + # @param params [Orb::Models::AlertRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Alert] + # + def retrieve(alert_id, params = {}) + @client.request( + method: :get, + path: ["alerts/%0s", alert_id], + model: Orb::Models::Alert, + options: params[:request_options] + ) + end + + # This endpoint updates the thresholds of an alert. + # + # @param alert_configuration_id [String] + # + # @param params [Orb::Models::AlertUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :thresholds The thresholds that define the values at which the alert will be triggered. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Alert] + # + def update(alert_configuration_id, params) + parsed, options = Orb::Models::AlertUpdateParams.dump_request(params) + @client.request( + method: :put, + path: ["alerts/%0s", alert_configuration_id], + body: parsed, + model: Orb::Models::Alert, + options: options + ) + end + + # This endpoint returns a list of alerts within Orb. + # + # The request must specify one of `customer_id`, `external_customer_id`, or + # `subscription_id`. + # + # If querying by subscripion_id, the endpoint will return the subscription level + # alerts as well as the plan level alerts associated with the subscription. + # + # The list of alerts is ordered starting from the most recently created alert. + # This endpoint follows Orb's + # [standardized pagination format](/api-reference/pagination). + # + # @param params [Orb::Models::AlertListParams, Hash{Symbol=>Object}] . + # + # @option params [Time, nil] :created_at_gt + # + # @option params [Time, nil] :created_at_gte + # + # @option params [Time, nil] :created_at_lt + # + # @option params [Time, nil] :created_at_lte + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [String, nil] :customer_id Fetch alerts scoped to this customer_id + # + # @option params [String, nil] :external_customer_id Fetch alerts scoped to this external_customer_id + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [String, nil] :subscription_id Fetch alerts scoped to this subscription_id + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(params = {}) + parsed, options = Orb::Models::AlertListParams.dump_request(params) + @client.request( + method: :get, + path: "alerts", + query: parsed, + page: Orb::Page, + model: Orb::Models::Alert, + options: options + ) + end + + # This endpoint creates a new alert to monitor a customer's credit balance. There + # are three types of alerts that can be scoped to customers: + # `credit_balance_depleted`, `credit_balance_dropped`, and + # `credit_balance_recovered`. Customers can have a maximum of one of each type of + # alert per [credit balance currency](/product-catalog/prepurchase). + # `credit_balance_dropped` alerts require a list of thresholds to be provided + # while `credit_balance_depleted` and `credit_balance_recovered` alerts do not + # require thresholds. + # + # @param customer_id [String] + # + # @param params [Orb::Models::AlertCreateForCustomerParams, Hash{Symbol=>Object}] . + # + # @option params [String] :currency The case sensitive currency or custom pricing unit to use for this alert. + # + # @option params [Symbol, Orb::Models::AlertCreateForCustomerParams::Type] :type The type of alert to create. This must be a valid alert type. + # + # @option params [Array, nil] :thresholds The thresholds that define the values at which the alert will be triggered. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Alert] + # + def create_for_customer(customer_id, params) + parsed, options = Orb::Models::AlertCreateForCustomerParams.dump_request(params) + @client.request( + method: :post, + path: ["alerts/customer_id/%0s", customer_id], + body: parsed, + model: Orb::Models::Alert, + options: options + ) + end + + # This endpoint creates a new alert to monitor a customer's credit balance. There + # are three types of alerts that can be scoped to customers: + # `credit_balance_depleted`, `credit_balance_dropped`, and + # `credit_balance_recovered`. Customers can have a maximum of one of each type of + # alert per [credit balance currency](/product-catalog/prepurchase). + # `credit_balance_dropped` alerts require a list of thresholds to be provided + # while `credit_balance_depleted` and `credit_balance_recovered` alerts do not + # require thresholds. + # + # @param external_customer_id [String] + # + # @param params [Orb::Models::AlertCreateForExternalCustomerParams, Hash{Symbol=>Object}] . + # + # @option params [String] :currency The case sensitive currency or custom pricing unit to use for this alert. + # + # @option params [Symbol, Orb::Models::AlertCreateForExternalCustomerParams::Type] :type The type of alert to create. This must be a valid alert type. + # + # @option params [Array, nil] :thresholds The thresholds that define the values at which the alert will be triggered. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Alert] + # + def create_for_external_customer(external_customer_id, params) + parsed, options = Orb::Models::AlertCreateForExternalCustomerParams.dump_request(params) + @client.request( + method: :post, + path: ["alerts/external_customer_id/%0s", external_customer_id], + body: parsed, + model: Orb::Models::Alert, + options: options + ) + end + + # This endpoint is used to create alerts at the subscription level. + # + # Subscription level alerts can be one of two types: `usage_exceeded` or + # `cost_exceeded`. A `usage_exceeded` alert is scoped to a particular metric and + # is triggered when the usage of that metric exceeds predefined thresholds during + # the current billing cycle. A `cost_exceeded` alert is triggered when the total + # amount due during the current billing cycle surpasses predefined thresholds. + # `cost_exceeded` alerts do not include burndown of pre-purchase credits. Each + # subscription can have one `cost_exceeded` alert and one `usage_exceeded` alert + # per metric that is a part of the subscription. Alerts are triggered based on + # usage or cost conditions met during the current billing cycle. + # + # @param subscription_id [String] + # + # @param params [Orb::Models::AlertCreateForSubscriptionParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :thresholds The thresholds that define the values at which the alert will be triggered. + # + # @option params [Symbol, Orb::Models::AlertCreateForSubscriptionParams::Type] :type The type of alert to create. This must be a valid alert type. + # + # @option params [String, nil] :metric_id The metric to track usage for. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Alert] + # + def create_for_subscription(subscription_id, params) + parsed, options = Orb::Models::AlertCreateForSubscriptionParams.dump_request(params) + @client.request( + method: :post, + path: ["alerts/subscription_id/%0s", subscription_id], + body: parsed, + model: Orb::Models::Alert, + options: options + ) + end + + # This endpoint allows you to disable an alert. To disable a plan-level alert for + # a specific subscription, you must include the `subscription_id`. The + # `subscription_id` is not required for customer or subscription level alerts. + # + # @param alert_configuration_id [String] + # + # @param params [Orb::Models::AlertDisableParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :subscription_id Used to update the status of a plan alert scoped to this subscription_id + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Alert] + # + def disable(alert_configuration_id, params = {}) + parsed, options = Orb::Models::AlertDisableParams.dump_request(params) + @client.request( + method: :post, + path: ["alerts/%0s/disable", alert_configuration_id], + query: parsed, + model: Orb::Models::Alert, + options: options + ) + end + + # This endpoint allows you to enable an alert. To enable a plan-level alert for a + # specific subscription, you must include the `subscription_id`. The + # `subscription_id` is not required for customer or subscription level alerts. + # + # @param alert_configuration_id [String] + # + # @param params [Orb::Models::AlertEnableParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :subscription_id Used to update the status of a plan alert scoped to this subscription_id + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Alert] + # + def enable(alert_configuration_id, params = {}) + parsed, options = Orb::Models::AlertEnableParams.dump_request(params) + @client.request( + method: :post, + path: ["alerts/%0s/enable", alert_configuration_id], + query: parsed, + model: Orb::Models::Alert, + options: options + ) + end + + # @param client [Orb::Client] + # + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/orb/resources/coupons.rb b/lib/orb/resources/coupons.rb new file mode 100644 index 00000000..82760f3b --- /dev/null +++ b/lib/orb/resources/coupons.rb @@ -0,0 +1,124 @@ +# frozen_string_literal: true + +module Orb + module Resources + class Coupons + # @return [Orb::Resources::Coupons::Subscriptions] + attr_reader :subscriptions + + # This endpoint allows the creation of coupons, which can then be redeemed at + # subscription creation or plan change. + # + # @param params [Orb::Models::CouponCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::Models::CouponCreateParams::Discount::NewCouponPercentageDiscount, Orb::Models::CouponCreateParams::Discount::NewCouponAmountDiscount] :discount + # + # @option params [String] :redemption_code This string can be used to redeem this coupon for a given subscription. + # + # @option params [Integer, nil] :duration_in_months This allows for a coupon's discount to apply for a limited time (determined in + # months); a `null` value here means "unlimited time". + # + # @option params [Integer, nil] :max_redemptions The maximum number of redemptions allowed for this coupon before it is + # exhausted;`null` here means "unlimited". + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Coupon] + # + def create(params) + parsed, options = Orb::Models::CouponCreateParams.dump_request(params) + @client.request( + method: :post, + path: "coupons", + body: parsed, + model: Orb::Models::Coupon, + options: options + ) + end + + # This endpoint returns a list of all coupons for an account in a list format. + # + # The list of coupons is ordered starting from the most recently created coupon. + # The response also includes `pagination_metadata`, which lets the caller retrieve + # the next page of results if they exist. More information about pagination can be + # found in the Pagination-metadata schema. + # + # @param params [Orb::Models::CouponListParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [String, nil] :redemption_code Filter to coupons matching this redemption code. + # + # @option params [Boolean, nil] :show_archived Show archived coupons as well (by default, this endpoint only returns active + # coupons). + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(params = {}) + parsed, options = Orb::Models::CouponListParams.dump_request(params) + @client.request( + method: :get, + path: "coupons", + query: parsed, + page: Orb::Page, + model: Orb::Models::Coupon, + options: options + ) + end + + # This endpoint allows a coupon to be archived. Archived coupons can no longer be + # redeemed, and will be hidden from lists of active coupons. Additionally, once a + # coupon is archived, its redemption code can be reused for a different coupon. + # + # @param coupon_id [String] + # + # @param params [Orb::Models::CouponArchiveParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Coupon] + # + def archive(coupon_id, params = {}) + @client.request( + method: :post, + path: ["coupons/%0s/archive", coupon_id], + model: Orb::Models::Coupon, + options: params[:request_options] + ) + end + + # This endpoint retrieves a coupon by its ID. To fetch coupons by their redemption + # code, use the [List coupons](list-coupons) endpoint with the redemption_code + # parameter. + # + # @param coupon_id [String] + # + # @param params [Orb::Models::CouponFetchParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Coupon] + # + def fetch(coupon_id, params = {}) + @client.request( + method: :get, + path: ["coupons/%0s", coupon_id], + model: Orb::Models::Coupon, + options: params[:request_options] + ) + end + + # @param client [Orb::Client] + # + def initialize(client:) + @client = client + @subscriptions = Orb::Resources::Coupons::Subscriptions.new(client: client) + end + end + end +end diff --git a/lib/orb/resources/coupons/coupons.rb b/lib/orb/resources/coupons/coupons.rb deleted file mode 100644 index 533f7d0d..00000000 --- a/lib/orb/resources/coupons/coupons.rb +++ /dev/null @@ -1,73 +0,0 @@ -require "orb/model" -require "orb/models/coupon" -require "orb/pagination" -require "orb/resources/coupons/subscriptions" -module Orb - module Resources - class CouponPage < Page - required :data, Orb::ArrayOf.new(Orb::Models::Coupon) - end - - class CouponsResource - attr_reader :subscriptions - def initialize(client:) - @client = client - @subscriptions = - Orb::Resources::Coupons::SubscriptionsResource.new(client: client) - end - def create( - discount: Orb::NotGiven.instance, - redemption_code: Orb::NotGiven.instance, - duration_in_months: Orb::NotGiven.instance, - max_redemptions: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/coupons", - body: { - discount: discount, - redemption_code: redemption_code, - duration_in_months: duration_in_months, - max_redemptions: max_redemptions - }, - query: nil - } - - @client.request(model: Orb::Models::Coupon, **request) - end - def list( - cursor: Orb::NotGiven.instance, - limit: Orb::NotGiven.instance, - redemption_code: Orb::NotGiven.instance, - show_archived: Orb::NotGiven.instance - ) - request = { - method: :get, - path: "/coupons", - query: { - cursor: cursor, - limit: limit, - redemption_code: redemption_code, - show_archived: show_archived - } - } - - @client.request(page: CouponPage, **request) - end - def archive(coupon_id) - request = { - method: :post, - path: "/coupons/#{coupon_id}/archive", - query: nil - } - - @client.request(model: Orb::Models::Coupon, **request) - end - def fetch(coupon_id) - request = { method: :get, path: "/coupons/#{coupon_id}", query: nil } - - @client.request(model: Orb::Models::Coupon, **request) - end - end - end -end diff --git a/lib/orb/resources/coupons/subscriptions.rb b/lib/orb/resources/coupons/subscriptions.rb index ec3963fb..3dc12c7d 100644 --- a/lib/orb/resources/coupons/subscriptions.rb +++ b/lib/orb/resources/coupons/subscriptions.rb @@ -1,34 +1,44 @@ -require "orb/model" -require "orb/models/subscription" -require "orb/pagination" +# frozen_string_literal: true + module Orb module Resources - module Coupons - class SubscriptionPage < Page - required :data, Orb::ArrayOf.new(Orb::Models::Subscription) - end + class Coupons + class Subscriptions + # This endpoint returns a list of all subscriptions that have redeemed a given + # coupon as a [paginated](/api-reference/pagination) list, ordered starting from + # the most recently created subscription. For a full discussion of the + # subscription resource, see [Subscription](/core-concepts#subscription). + # + # @param coupon_id [String] + # + # @param params [Orb::Models::Coupons::SubscriptionListParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(coupon_id, params = {}) + parsed, options = Orb::Models::Coupons::SubscriptionListParams.dump_request(params) + @client.request( + method: :get, + path: ["coupons/%0s/subscriptions", coupon_id], + query: parsed, + page: Orb::Page, + model: Orb::Models::Subscription, + options: options + ) + end - class SubscriptionsResource - attr_reader + # @param client [Orb::Client] + # def initialize(client:) @client = client end - def list( - coupon_id, - cursor: Orb::NotGiven.instance, - limit: Orb::NotGiven.instance - ) - request = { - method: :get, - path: "/coupons/#{coupon_id}/subscriptions", - query: { - cursor: cursor, - limit: limit - } - } - - @client.request(page: SubscriptionPage, **request) - end end end end diff --git a/lib/orb/resources/credit_notes.rb b/lib/orb/resources/credit_notes.rb index 0e04b3a5..5493dc54 100644 --- a/lib/orb/resources/credit_notes.rb +++ b/lib/orb/resources/credit_notes.rb @@ -1,37 +1,85 @@ -require "orb/model" -require "orb/models/credit_note" -require "orb/pagination" +# frozen_string_literal: true + module Orb module Resources - class CreditNotePage < Page - required :data, Orb::ArrayOf.new(Orb::Models::CreditNote) - end - - class CreditNotesResource - attr_reader - def initialize(client:) - @client = client + class CreditNotes + # This endpoint is used to create a single + # [`Credit Note`](/invoicing/credit-notes). + # + # @param params [Orb::Models::CreditNoteCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :line_items + # + # @option params [String, nil] :memo An optional memo to attach to the credit note. + # + # @option params [Symbol, Orb::Models::CreditNoteCreateParams::Reason, nil] :reason An optional reason for the credit note. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::CreditNote] + # + def create(params) + parsed, options = Orb::Models::CreditNoteCreateParams.dump_request(params) + @client.request( + method: :post, + path: "credit_notes", + body: parsed, + model: Orb::Models::CreditNote, + options: options + ) end - def list(cursor: Orb::NotGiven.instance, limit: Orb::NotGiven.instance) - request = { - method: :get, - path: "/credit_notes", - query: { - cursor: cursor, - limit: limit - } - } - @client.request(page: CreditNotePage, **request) + # Get a paginated list of CreditNotes. Users can also filter by customer_id, + # subscription_id, or external_customer_id. The credit notes will be returned in + # reverse chronological order by `creation_time`. + # + # @param params [Orb::Models::CreditNoteListParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(params = {}) + parsed, options = Orb::Models::CreditNoteListParams.dump_request(params) + @client.request( + method: :get, + path: "credit_notes", + query: parsed, + page: Orb::Page, + model: Orb::Models::CreditNote, + options: options + ) end - def fetch(credit_note_id) - request = { + + # This endpoint is used to fetch a single [`Credit Note`](/invoicing/credit-notes) + # given an identifier. + # + # @param credit_note_id [String] + # + # @param params [Orb::Models::CreditNoteFetchParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::CreditNote] + # + def fetch(credit_note_id, params = {}) + @client.request( method: :get, - path: "/credit_notes/#{credit_note_id}", - query: nil - } + path: ["credit_notes/%0s", credit_note_id], + model: Orb::Models::CreditNote, + options: params[:request_options] + ) + end - @client.request(model: Orb::Models::CreditNote, **request) + # @param client [Orb::Client] + # + def initialize(client:) + @client = client end end end diff --git a/lib/orb/resources/customers.rb b/lib/orb/resources/customers.rb new file mode 100644 index 00000000..18acc9ac --- /dev/null +++ b/lib/orb/resources/customers.rb @@ -0,0 +1,726 @@ +# frozen_string_literal: true + +module Orb + module Resources + class Customers + # @return [Orb::Resources::Customers::Costs] + attr_reader :costs + + # @return [Orb::Resources::Customers::Credits] + attr_reader :credits + + # @return [Orb::Resources::Customers::BalanceTransactions] + attr_reader :balance_transactions + + # This operation is used to create an Orb customer, who is party to the core + # billing relationship. See [Customer](/core-concepts##customer) for an overview + # of the customer resource. + # + # This endpoint is critical in the following Orb functionality: + # + # - Automated charges can be configured by setting `payment_provider` and + # `payment_provider_id` to automatically issue invoices + # - [Customer ID Aliases](/events-and-metrics/customer-aliases) can be configured + # by setting `external_customer_id` + # - [Timezone localization](/essentials/timezones) can be configured on a + # per-customer basis by setting the `timezone` parameter + # + # @param params [Orb::Models::CustomerCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :email A valid customer email, to be used for notifications. When Orb triggers payment + # through a payment gateway, this email will be used for any automatically issued + # receipts. + # + # @option params [String] :name The full name of the customer + # + # @option params [Orb::Models::CustomerCreateParams::AccountingSyncConfiguration, nil] :accounting_sync_configuration + # + # @option params [Array, nil] :additional_emails Additional email addresses for this customer. If populated, these email + # addresses will be CC'd for customer communications. + # + # @option params [Boolean, nil] :auto_collection Used to determine if invoices for this customer will automatically attempt to + # charge a saved payment method, if available. This parameter defaults to `True` + # when a payment provider is provided on customer creation. + # + # @option params [Orb::Models::CustomerCreateParams::BillingAddress, nil] :billing_address + # + # @option params [String, nil] :currency An ISO 4217 currency string used for the customer's invoices and balance. If not + # set at creation time, will be set at subscription creation time. + # + # @option params [Boolean, nil] :email_delivery + # + # @option params [String, nil] :external_customer_id An optional user-defined ID for this customer resource, used throughout the + # system as an alias for this Customer. Use this field to identify a customer by + # an existing identifier in your system. + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [Symbol, Orb::Models::CustomerCreateParams::PaymentProvider, nil] :payment_provider This is used for creating charges or invoices in an external system via Orb. + # When not in test mode, the connection must first be configured in the Orb + # webapp. + # + # @option params [String, nil] :payment_provider_id The ID of this customer in an external payments solution, such as Stripe. This + # is used for creating charges or invoices in the external system via Orb. + # + # @option params [Orb::Models::CustomerCreateParams::ReportingConfiguration, nil] :reporting_configuration + # + # @option params [Orb::Models::CustomerCreateParams::ShippingAddress, nil] :shipping_address + # + # @option params [Orb::Models::CustomerCreateParams::TaxConfiguration::NewAvalaraTaxConfiguration, Orb::Models::CustomerCreateParams::TaxConfiguration::NewTaxJarConfiguration, nil] :tax_configuration + # + # @option params [Orb::Models::CustomerCreateParams::TaxID, nil] :tax_id Tax IDs are commonly required to be displayed on customer invoices, which are + # added to the headers of invoices. + # + # ### Supported Tax ID Countries and Types + # + # | Country | Type | Description | + # | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # | Andorra | `ad_nrt` | Andorran NRT Number | + # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # | Austria | `eu_vat` | European VAT Number | + # | Bahrain | `bh_vat` | Bahraini VAT Number | + # | Belgium | `eu_vat` | European VAT Number | + # | Bolivia | `bo_tin` | Bolivian Tax ID | + # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # | Brazil | `br_cpf` | Brazilian CPF Number | + # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # | Bulgaria | `eu_vat` | European VAT Number | + # | Canada | `ca_bn` | Canadian BN | + # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # | Chile | `cl_tin` | Chilean TIN | + # | China | `cn_tin` | Chinese Tax ID | + # | Colombia | `co_nit` | Colombian NIT Number | + # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # | Croatia | `eu_vat` | European VAT Number | + # | Cyprus | `eu_vat` | European VAT Number | + # | Czech Republic | `eu_vat` | European VAT Number | + # | Denmark | `eu_vat` | European VAT Number | + # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # | Estonia | `eu_vat` | European VAT Number | + # | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # | Finland | `eu_vat` | European VAT Number | + # | France | `eu_vat` | European VAT Number | + # | Georgia | `ge_vat` | Georgian VAT | + # | Germany | `eu_vat` | European VAT Number | + # | Greece | `eu_vat` | European VAT Number | + # | Hong Kong | `hk_br` | Hong Kong BR Number | + # | Hungary | `eu_vat` | European VAT Number | + # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # | Iceland | `is_vat` | Icelandic VAT | + # | India | `in_gst` | Indian GST Number | + # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # | Ireland | `eu_vat` | European VAT Number | + # | Israel | `il_vat` | Israel VAT | + # | Italy | `eu_vat` | European VAT Number | + # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # | Latvia | `eu_vat` | European VAT Number | + # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # | Lithuania | `eu_vat` | European VAT Number | + # | Luxembourg | `eu_vat` | European VAT Number | + # | Malaysia | `my_frp` | Malaysian FRP Number | + # | Malaysia | `my_itn` | Malaysian ITN | + # | Malaysia | `my_sst` | Malaysian SST Number | + # | Malta | `eu_vat ` | European VAT Number | + # | Mexico | `mx_rfc` | Mexican RFC Number | + # | Netherlands | `eu_vat` | European VAT Number | + # | New Zealand | `nz_gst` | New Zealand GST Number | + # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # | Norway | `no_vat` | Norwegian VAT Number | + # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # | Oman | `om_vat` | Omani VAT Number | + # | Peru | `pe_ruc` | Peruvian RUC Number | + # | Philippines | `ph_tin ` | Philippines Tax Identification Number | + # | Poland | `eu_vat` | European VAT Number | + # | Portugal | `eu_vat` | European VAT Number | + # | Romania | `eu_vat` | European VAT Number | + # | Romania | `ro_tin` | Romanian Tax ID Number | + # | Russia | `ru_inn` | Russian INN | + # | Russia | `ru_kpp` | Russian KPP | + # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # | Serbia | `rs_pib` | Serbian PIB Number | + # | Singapore | `sg_gst` | Singaporean GST | + # | Singapore | `sg_uen` | Singaporean UEN | + # | Slovakia | `eu_vat` | European VAT Number | + # | Slovenia | `eu_vat` | European VAT Number | + # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # | South Africa | `za_vat` | South African VAT Number | + # | South Korea | `kr_brn` | Korean BRN | + # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # | Spain | `eu_vat` | European VAT Number | + # | Sweden | `eu_vat` | European VAT Number | + # | Switzerland | `ch_vat` | Switzerland VAT Number | + # | Taiwan | `tw_vat` | Taiwanese VAT | + # | Thailand | `th_vat` | Thai VAT | + # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # | Ukraine | `ua_vat` | Ukrainian VAT | + # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # | United States | `us_ein` | United States EIN | + # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # + # @option params [String, nil] :timezone A timezone identifier from the IANA timezone database, such as + # `"America/Los_Angeles"`. This defaults to your account's timezone if not set. + # This cannot be changed after customer creation. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Customer] + # + def create(params) + parsed, options = Orb::Models::CustomerCreateParams.dump_request(params) + @client.request( + method: :post, + path: "customers", + body: parsed, + model: Orb::Models::Customer, + options: options + ) + end + + # This endpoint can be used to update the `payment_provider`, + # `payment_provider_id`, `name`, `email`, `email_delivery`, `tax_id`, + # `auto_collection`, `metadata`, `shipping_address`, `billing_address`, and + # `additional_emails` of an existing customer. Other fields on a customer are + # currently immutable. + # + # @param customer_id [String] + # + # @param params [Orb::Models::CustomerUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration, nil] :accounting_sync_configuration + # + # @option params [Array, nil] :additional_emails Additional email addresses for this customer. If populated, these email + # addresses will be CC'd for customer communications. + # + # @option params [Boolean, nil] :auto_collection Used to determine if invoices for this customer will automatically attempt to + # charge a saved payment method, if available. This parameter defaults to `True` + # when a payment provider is provided on customer creation. + # + # @option params [Orb::Models::CustomerUpdateParams::BillingAddress, nil] :billing_address + # + # @option params [String, nil] :currency An ISO 4217 currency string used for the customer's invoices and balance. If not + # set at creation time, will be set at subscription creation time. + # + # @option params [String, nil] :email A valid customer email, to be used for invoicing and notifications. + # + # @option params [Boolean, nil] :email_delivery + # + # @option params [String, nil] :external_customer_id The external customer ID. This can only be set if empty and the customer has no + # past or current subscriptions. + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [String, nil] :name The full name of the customer + # + # @option params [Symbol, Orb::Models::CustomerUpdateParams::PaymentProvider, nil] :payment_provider This is used for creating charges or invoices in an external system via Orb. + # When not in test mode: + # + # - the connection must first be configured in the Orb webapp. + # - if the provider is an invoicing provider (`stripe_invoice`, `quickbooks`, + # `bill.com`, `netsuite`), any product mappings must first be configured with + # the Orb team. + # + # @option params [String, nil] :payment_provider_id The ID of this customer in an external payments solution, such as Stripe. This + # is used for creating charges or invoices in the external system via Orb. + # + # @option params [Orb::Models::CustomerUpdateParams::ReportingConfiguration, nil] :reporting_configuration + # + # @option params [Orb::Models::CustomerUpdateParams::ShippingAddress, nil] :shipping_address + # + # @option params [Orb::Models::CustomerUpdateParams::TaxConfiguration::NewAvalaraTaxConfiguration, Orb::Models::CustomerUpdateParams::TaxConfiguration::NewTaxJarConfiguration, nil] :tax_configuration + # + # @option params [Orb::Models::CustomerUpdateParams::TaxID, nil] :tax_id Tax IDs are commonly required to be displayed on customer invoices, which are + # added to the headers of invoices. + # + # ### Supported Tax ID Countries and Types + # + # | Country | Type | Description | + # | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # | Andorra | `ad_nrt` | Andorran NRT Number | + # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # | Austria | `eu_vat` | European VAT Number | + # | Bahrain | `bh_vat` | Bahraini VAT Number | + # | Belgium | `eu_vat` | European VAT Number | + # | Bolivia | `bo_tin` | Bolivian Tax ID | + # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # | Brazil | `br_cpf` | Brazilian CPF Number | + # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # | Bulgaria | `eu_vat` | European VAT Number | + # | Canada | `ca_bn` | Canadian BN | + # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # | Chile | `cl_tin` | Chilean TIN | + # | China | `cn_tin` | Chinese Tax ID | + # | Colombia | `co_nit` | Colombian NIT Number | + # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # | Croatia | `eu_vat` | European VAT Number | + # | Cyprus | `eu_vat` | European VAT Number | + # | Czech Republic | `eu_vat` | European VAT Number | + # | Denmark | `eu_vat` | European VAT Number | + # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # | Estonia | `eu_vat` | European VAT Number | + # | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # | Finland | `eu_vat` | European VAT Number | + # | France | `eu_vat` | European VAT Number | + # | Georgia | `ge_vat` | Georgian VAT | + # | Germany | `eu_vat` | European VAT Number | + # | Greece | `eu_vat` | European VAT Number | + # | Hong Kong | `hk_br` | Hong Kong BR Number | + # | Hungary | `eu_vat` | European VAT Number | + # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # | Iceland | `is_vat` | Icelandic VAT | + # | India | `in_gst` | Indian GST Number | + # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # | Ireland | `eu_vat` | European VAT Number | + # | Israel | `il_vat` | Israel VAT | + # | Italy | `eu_vat` | European VAT Number | + # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # | Latvia | `eu_vat` | European VAT Number | + # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # | Lithuania | `eu_vat` | European VAT Number | + # | Luxembourg | `eu_vat` | European VAT Number | + # | Malaysia | `my_frp` | Malaysian FRP Number | + # | Malaysia | `my_itn` | Malaysian ITN | + # | Malaysia | `my_sst` | Malaysian SST Number | + # | Malta | `eu_vat ` | European VAT Number | + # | Mexico | `mx_rfc` | Mexican RFC Number | + # | Netherlands | `eu_vat` | European VAT Number | + # | New Zealand | `nz_gst` | New Zealand GST Number | + # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # | Norway | `no_vat` | Norwegian VAT Number | + # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # | Oman | `om_vat` | Omani VAT Number | + # | Peru | `pe_ruc` | Peruvian RUC Number | + # | Philippines | `ph_tin ` | Philippines Tax Identification Number | + # | Poland | `eu_vat` | European VAT Number | + # | Portugal | `eu_vat` | European VAT Number | + # | Romania | `eu_vat` | European VAT Number | + # | Romania | `ro_tin` | Romanian Tax ID Number | + # | Russia | `ru_inn` | Russian INN | + # | Russia | `ru_kpp` | Russian KPP | + # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # | Serbia | `rs_pib` | Serbian PIB Number | + # | Singapore | `sg_gst` | Singaporean GST | + # | Singapore | `sg_uen` | Singaporean UEN | + # | Slovakia | `eu_vat` | European VAT Number | + # | Slovenia | `eu_vat` | European VAT Number | + # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # | South Africa | `za_vat` | South African VAT Number | + # | South Korea | `kr_brn` | Korean BRN | + # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # | Spain | `eu_vat` | European VAT Number | + # | Sweden | `eu_vat` | European VAT Number | + # | Switzerland | `ch_vat` | Switzerland VAT Number | + # | Taiwan | `tw_vat` | Taiwanese VAT | + # | Thailand | `th_vat` | Thai VAT | + # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # | Ukraine | `ua_vat` | Ukrainian VAT | + # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # | United States | `us_ein` | United States EIN | + # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Customer] + # + def update(customer_id, params = {}) + parsed, options = Orb::Models::CustomerUpdateParams.dump_request(params) + @client.request( + method: :put, + path: ["customers/%0s", customer_id], + body: parsed, + model: Orb::Models::Customer, + options: options + ) + end + + # This endpoint returns a list of all customers for an account. The list of + # customers is ordered starting from the most recently created customer. This + # endpoint follows Orb's + # [standardized pagination format](/api-reference/pagination). + # + # See [Customer](/core-concepts##customer) for an overview of the customer model. + # + # @param params [Orb::Models::CustomerListParams, Hash{Symbol=>Object}] . + # + # @option params [Time, nil] :created_at_gt + # + # @option params [Time, nil] :created_at_gte + # + # @option params [Time, nil] :created_at_lt + # + # @option params [Time, nil] :created_at_lte + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(params = {}) + parsed, options = Orb::Models::CustomerListParams.dump_request(params) + @client.request( + method: :get, + path: "customers", + query: parsed, + page: Orb::Page, + model: Orb::Models::Customer, + options: options + ) + end + + # This performs a deletion of this customer, its subscriptions, and its invoices, + # provided the customer does not have any issued invoices. Customers with issued + # invoices cannot be deleted. This operation is irreversible. Note that this is a + # _soft_ deletion, but the data will be inaccessible through the API and Orb + # dashboard. + # + # For a hard-deletion, please reach out to the Orb team directly. + # + # **Note**: This operation happens asynchronously and can be expected to take a + # few minutes to propagate to related resources. However, querying for the + # customer on subsequent GET requests while deletion is in process will reflect + # its deletion with a `deleted: true` property. Once the customer deletion has + # been fully processed, the customer will not be returned in the API. + # + # On successful processing, this returns an empty dictionary (`{}`) in the API. + # + # @param customer_id [String] + # + # @param params [Orb::Models::CustomerDeleteParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [nil] + # + def delete(customer_id, params = {}) + @client.request( + method: :delete, + path: ["customers/%0s", customer_id], + model: NilClass, + options: params[:request_options] + ) + end + + # This endpoint is used to fetch customer details given an identifier. If the + # `Customer` is in the process of being deleted, only the properties `id` and + # `deleted: true` will be returned. + # + # See the [Customer resource](/core-concepts#customer) for a full discussion of + # the Customer model. + # + # @param customer_id [String] + # + # @param params [Orb::Models::CustomerFetchParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Customer] + # + def fetch(customer_id, params = {}) + @client.request( + method: :get, + path: ["customers/%0s", customer_id], + model: Orb::Models::Customer, + options: params[:request_options] + ) + end + + # This endpoint is used to fetch customer details given an `external_customer_id` + # (see [Customer ID Aliases](/events-and-metrics/customer-aliases)). + # + # Note that the resource and semantics of this endpoint exactly mirror + # [Get Customer](fetch-customer). + # + # @param external_customer_id [String] + # + # @param params [Orb::Models::CustomerFetchByExternalIDParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Customer] + # + def fetch_by_external_id(external_customer_id, params = {}) + @client.request( + method: :get, + path: ["customers/external_customer_id/%0s", external_customer_id], + model: Orb::Models::Customer, + options: params[:request_options] + ) + end + + # Sync Orb's payment methods for the customer with their gateway. + # + # This method can be called before taking an action that may cause the customer to + # be charged, ensuring that the most up-to-date payment method is charged. + # + # **Note**: This functionality is currently only available for Stripe. + # + # @param external_customer_id [String] + # + # @param params [Orb::Models::CustomerSyncPaymentMethodsFromGatewayParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [nil] + # + def sync_payment_methods_from_gateway(external_customer_id, params = {}) + @client.request( + method: :post, + path: [ + "customers/external_customer_id/%0s/sync_payment_methods_from_gateway", + external_customer_id + ], + model: NilClass, + options: params[:request_options] + ) + end + + # Sync Orb's payment methods for the customer with their gateway. + # + # This method can be called before taking an action that may cause the customer to + # be charged, ensuring that the most up-to-date payment method is charged. + # + # **Note**: This functionality is currently only available for Stripe. + # + # @param customer_id [String] + # + # @param params [Orb::Models::CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIDParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [nil] + # + def sync_payment_methods_from_gateway_by_external_customer_id(customer_id, params = {}) + @client.request( + method: :post, + path: ["customers/%0s/sync_payment_methods_from_gateway", customer_id], + model: NilClass, + options: params[:request_options] + ) + end + + # This endpoint is used to update customer details given an `external_customer_id` + # (see [Customer ID Aliases](/events-and-metrics/customer-aliases)). Note that the + # resource and semantics of this endpoint exactly mirror + # [Update Customer](update-customer). + # + # @param id [String] + # + # @param params [Orb::Models::CustomerUpdateByExternalIDParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration, nil] :accounting_sync_configuration + # + # @option params [Array, nil] :additional_emails Additional email addresses for this customer. If populated, these email + # addresses will be CC'd for customer communications. + # + # @option params [Boolean, nil] :auto_collection Used to determine if invoices for this customer will automatically attempt to + # charge a saved payment method, if available. This parameter defaults to `True` + # when a payment provider is provided on customer creation. + # + # @option params [Orb::Models::CustomerUpdateByExternalIDParams::BillingAddress, nil] :billing_address + # + # @option params [String, nil] :currency An ISO 4217 currency string used for the customer's invoices and balance. If not + # set at creation time, will be set at subscription creation time. + # + # @option params [String, nil] :email A valid customer email, to be used for invoicing and notifications. + # + # @option params [Boolean, nil] :email_delivery + # + # @option params [String, nil] :external_customer_id The external customer ID. This can only be set if empty and the customer has no + # past or current subscriptions. + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [String, nil] :name The full name of the customer + # + # @option params [Symbol, Orb::Models::CustomerUpdateByExternalIDParams::PaymentProvider, nil] :payment_provider This is used for creating charges or invoices in an external system via Orb. + # When not in test mode: + # + # - the connection must first be configured in the Orb webapp. + # - if the provider is an invoicing provider (`stripe_invoice`, `quickbooks`, + # `bill.com`, `netsuite`), any product mappings must first be configured with + # the Orb team. + # + # @option params [String, nil] :payment_provider_id The ID of this customer in an external payments solution, such as Stripe. This + # is used for creating charges or invoices in the external system via Orb. + # + # @option params [Orb::Models::CustomerUpdateByExternalIDParams::ReportingConfiguration, nil] :reporting_configuration + # + # @option params [Orb::Models::CustomerUpdateByExternalIDParams::ShippingAddress, nil] :shipping_address + # + # @option params [Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewAvalaraTaxConfiguration, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewTaxJarConfiguration, nil] :tax_configuration + # + # @option params [Orb::Models::CustomerUpdateByExternalIDParams::TaxID, nil] :tax_id Tax IDs are commonly required to be displayed on customer invoices, which are + # added to the headers of invoices. + # + # ### Supported Tax ID Countries and Types + # + # | Country | Type | Description | + # | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + # | Andorra | `ad_nrt` | Andorran NRT Number | + # | Argentina | `ar_cuit` | Argentinian Tax ID Number | + # | Australia | `au_abn` | Australian Business Number (AU ABN) | + # | Australia | `au_arn` | Australian Taxation Office Reference Number | + # | Austria | `eu_vat` | European VAT Number | + # | Bahrain | `bh_vat` | Bahraini VAT Number | + # | Belgium | `eu_vat` | European VAT Number | + # | Bolivia | `bo_tin` | Bolivian Tax ID | + # | Brazil | `br_cnpj` | Brazilian CNPJ Number | + # | Brazil | `br_cpf` | Brazilian CPF Number | + # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + # | Bulgaria | `eu_vat` | European VAT Number | + # | Canada | `ca_bn` | Canadian BN | + # | Canada | `ca_gst_hst` | Canadian GST/HST Number | + # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + # | Canada | `ca_qst` | Canadian QST Number (Québec) | + # | Chile | `cl_tin` | Chilean TIN | + # | China | `cn_tin` | Chinese Tax ID | + # | Colombia | `co_nit` | Colombian NIT Number | + # | Costa Rica | `cr_tin` | Costa Rican Tax ID | + # | Croatia | `eu_vat` | European VAT Number | + # | Cyprus | `eu_vat` | European VAT Number | + # | Czech Republic | `eu_vat` | European VAT Number | + # | Denmark | `eu_vat` | European VAT Number | + # | Dominican Republic | `do_rcn` | Dominican RCN Number | + # | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + # | Egypt | `eg_tin` | Egyptian Tax Identification Number | + # | El Salvador | `sv_nit` | El Salvadorian NIT Number | + # | Estonia | `eu_vat` | European VAT Number | + # | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + # | Finland | `eu_vat` | European VAT Number | + # | France | `eu_vat` | European VAT Number | + # | Georgia | `ge_vat` | Georgian VAT | + # | Germany | `eu_vat` | European VAT Number | + # | Greece | `eu_vat` | European VAT Number | + # | Hong Kong | `hk_br` | Hong Kong BR Number | + # | Hungary | `eu_vat` | European VAT Number | + # | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + # | Iceland | `is_vat` | Icelandic VAT | + # | India | `in_gst` | Indian GST Number | + # | Indonesia | `id_npwp` | Indonesian NPWP Number | + # | Ireland | `eu_vat` | European VAT Number | + # | Israel | `il_vat` | Israel VAT | + # | Italy | `eu_vat` | European VAT Number | + # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + # | Latvia | `eu_vat` | European VAT Number | + # | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + # | Lithuania | `eu_vat` | European VAT Number | + # | Luxembourg | `eu_vat` | European VAT Number | + # | Malaysia | `my_frp` | Malaysian FRP Number | + # | Malaysia | `my_itn` | Malaysian ITN | + # | Malaysia | `my_sst` | Malaysian SST Number | + # | Malta | `eu_vat ` | European VAT Number | + # | Mexico | `mx_rfc` | Mexican RFC Number | + # | Netherlands | `eu_vat` | European VAT Number | + # | New Zealand | `nz_gst` | New Zealand GST Number | + # | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + # | Norway | `no_vat` | Norwegian VAT Number | + # | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + # | Oman | `om_vat` | Omani VAT Number | + # | Peru | `pe_ruc` | Peruvian RUC Number | + # | Philippines | `ph_tin ` | Philippines Tax Identification Number | + # | Poland | `eu_vat` | European VAT Number | + # | Portugal | `eu_vat` | European VAT Number | + # | Romania | `eu_vat` | European VAT Number | + # | Romania | `ro_tin` | Romanian Tax ID Number | + # | Russia | `ru_inn` | Russian INN | + # | Russia | `ru_kpp` | Russian KPP | + # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + # | Serbia | `rs_pib` | Serbian PIB Number | + # | Singapore | `sg_gst` | Singaporean GST | + # | Singapore | `sg_uen` | Singaporean UEN | + # | Slovakia | `eu_vat` | European VAT Number | + # | Slovenia | `eu_vat` | European VAT Number | + # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + # | South Africa | `za_vat` | South African VAT Number | + # | South Korea | `kr_brn` | Korean BRN | + # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + # | Spain | `eu_vat` | European VAT Number | + # | Sweden | `eu_vat` | European VAT Number | + # | Switzerland | `ch_vat` | Switzerland VAT Number | + # | Taiwan | `tw_vat` | Taiwanese VAT | + # | Thailand | `th_vat` | Thai VAT | + # | Turkey | `tr_tin` | Turkish Tax Identification Number | + # | Ukraine | `ua_vat` | Ukrainian VAT | + # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + # | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + # | United Kingdom | `gb_vat` | United Kingdom VAT Number | + # | United States | `us_ein` | United States EIN | + # | Uruguay | `uy_ruc` | Uruguayan RUC Number | + # | Venezuela | `ve_rif` | Venezuelan RIF Number | + # | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Customer] + # + def update_by_external_id(id, params = {}) + parsed, options = Orb::Models::CustomerUpdateByExternalIDParams.dump_request(params) + @client.request( + method: :put, + path: ["customers/external_customer_id/%0s", id], + body: parsed, + model: Orb::Models::Customer, + options: options + ) + end + + # @param client [Orb::Client] + # + def initialize(client:) + @client = client + @costs = Orb::Resources::Customers::Costs.new(client: client) + @credits = Orb::Resources::Customers::Credits.new(client: client) + @balance_transactions = Orb::Resources::Customers::BalanceTransactions.new(client: client) + end + end + end +end diff --git a/lib/orb/resources/customers/balance_transactions.rb b/lib/orb/resources/customers/balance_transactions.rb index 84fabac7..5cbcb750 100644 --- a/lib/orb/resources/customers/balance_transactions.rb +++ b/lib/orb/resources/customers/balance_transactions.rb @@ -1,65 +1,103 @@ -require "orb/model" -require "orb/models/balance_transaction_create_response" -require "orb/models/balance_transaction_list_response" -require "orb/pagination" +# frozen_string_literal: true + module Orb module Resources - module Customers - class BalanceTransactionListResponsePage < Page - required :data, - Orb::ArrayOf.new(Orb::Models::BalanceTransactionListResponse) - end - - class BalanceTransactionsResource - attr_reader - def initialize(client:) - @client = client - end - def create( - customer_id, - amount: Orb::NotGiven.instance, - type: Orb::NotGiven.instance, - description: Orb::NotGiven.instance - ) - request = { + class Customers + class BalanceTransactions + # Creates an immutable balance transaction that updates the customer's balance and + # returns back the newly created transaction. + # + # @param customer_id [String] + # + # @param params [Orb::Models::Customers::BalanceTransactionCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :amount + # + # @option params [Symbol, Orb::Models::Customers::BalanceTransactionCreateParams::Type] :type + # + # @option params [String, nil] :description An optional description that can be specified around this entry. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Customers::BalanceTransactionCreateResponse] + # + def create(customer_id, params) + parsed, options = Orb::Models::Customers::BalanceTransactionCreateParams.dump_request(params) + @client.request( method: :post, - path: "/customers/#{customer_id}/balance_transactions", - body: { - amount: amount, - type: type, - description: description - }, - query: nil - } + path: ["customers/%0s/balance_transactions", customer_id], + body: parsed, + model: Orb::Models::Customers::BalanceTransactionCreateResponse, + options: options + ) + end + # ## The customer balance + # + # The customer balance is an amount in the customer's currency, which Orb + # automatically applies to subsequent invoices. This balance can be adjusted + # manually via Orb's webapp on the customer details page. You can use this balance + # to provide a fixed mid-period credit to the customer. Commonly, this is done due + # to system downtime/SLA violation, or an adhoc adjustment discussed with the + # customer. + # + # If the balance is a positive value at the time of invoicing, it represents that + # the customer has credit that should be used to offset the amount due on the next + # issued invoice. In this case, Orb will automatically reduce the next invoice by + # the balance amount, and roll over any remaining balance if the invoice is fully + # discounted. + # + # If the balance is a negative value at the time of invoicing, Orb will increase + # the invoice's amount due with a positive adjustment, and reset the balance to 0. + # + # This endpoint retrieves all customer balance transactions in reverse + # chronological order for a single customer, providing a complete audit trail of + # all adjustments and invoice applications. + # + # ## Eligibility + # + # The customer balance can only be applied to invoices or adjusted manually if + # invoices are not synced to a separate invoicing provider. If a payment gateway + # such as Stripe is used, the balance will be applied to the invoice before + # forwarding payment to the gateway. + # + # @param customer_id [String] + # + # @param params [Orb::Models::Customers::BalanceTransactionListParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Time, nil] :operation_time_gt + # + # @option params [Time, nil] :operation_time_gte + # + # @option params [Time, nil] :operation_time_lt + # + # @option params [Time, nil] :operation_time_lte + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(customer_id, params = {}) + parsed, options = Orb::Models::Customers::BalanceTransactionListParams.dump_request(params) @client.request( - model: Orb::Models::BalanceTransactionCreateResponse, - **request + method: :get, + path: ["customers/%0s/balance_transactions", customer_id], + query: parsed, + page: Orb::Page, + model: Orb::Models::Customers::BalanceTransactionListResponse, + options: options ) end - def list( - customer_id, - cursor: Orb::NotGiven.instance, - limit: Orb::NotGiven.instance, - operation_time_gt: Orb::NotGiven.instance, - operation_time_gte: Orb::NotGiven.instance, - operation_time_lt: Orb::NotGiven.instance, - operation_time_lte: Orb::NotGiven.instance - ) - request = { - method: :get, - path: "/customers/#{customer_id}/balance_transactions", - query: { - cursor: cursor, - limit: limit, - "operation_time[gt]": operation_time_gt, - "operation_time[gte]": operation_time_gte, - "operation_time[lt]": operation_time_lt, - "operation_time[lte]": operation_time_lte - } - } - @client.request(page: BalanceTransactionListResponsePage, **request) + # @param client [Orb::Client] + # + def initialize(client:) + @client = client end end end diff --git a/lib/orb/resources/customers/costs.rb b/lib/orb/resources/customers/costs.rb index bc6be732..160254a8 100644 --- a/lib/orb/resources/customers/costs.rb +++ b/lib/orb/resources/customers/costs.rb @@ -1,58 +1,310 @@ -require "orb/model" -require "orb/models/cost_list_by_external_id_response" -require "orb/models/cost_list_response" +# frozen_string_literal: true + module Orb module Resources - module Customers - class CostsResource - attr_reader - def initialize(client:) - @client = client - end - def list( - customer_id, - group_by: Orb::NotGiven.instance, - timeframe_end: Orb::NotGiven.instance, - timeframe_start: Orb::NotGiven.instance, - view_mode: Orb::NotGiven.instance - ) - request = { + class Customers + class Costs + # This endpoint is used to fetch a day-by-day snapshot of a customer's costs in + # Orb, calculated by applying pricing information to the underlying usage (see the + # [subscription usage endpoint](/api-reference/subscription/fetch-subscription-usage) + # to fetch usage per metric, in usage units rather than a currency). + # + # This endpoint can be leveraged for internal tooling and to provide a more + # transparent billing experience for your end users: + # + # 1. Understand the cost breakdown per line item historically and in real-time for + # the current billing period. + # 2. Provide customer visibility into how different services are contributing to + # the overall invoice with a per-day timeseries (as compared to the + # [upcoming invoice](/api-reference/invoice/fetch-upcoming-invoice) resource, + # which represents a snapshot for the current period). + # 3. Assess how minimums and discounts affect your customers by teasing apart + # costs directly as a result of usage, as opposed to minimums and discounts at + # the plan and price level. + # 4. Gain insight into key customer health metrics, such as the percent + # utilization of the minimum committed spend. + # + # ## Fetching subscriptions + # + # By default, this endpoint fetches the currently active subscription for the + # customer, and returns cost information for the subscription's current billing + # period, broken down by each participating price. If there are no currently + # active subscriptions, this will instead default to the most recently active + # subscription or return an empty series if none are found. For example, if your + # plan charges for compute hours, job runs, and data syncs, then this endpoint + # would provide a daily breakdown of your customer's cost for each of those axes. + # + # If timeframe bounds are specified, Orb fetches all subscriptions that were + # active in that timeframe. If two subscriptions overlap on a single day, costs + # from each price will be summed, and prices for both subscriptions will be + # included in the breakdown. + # + # ## Prepaid plans + # + # For plans that include prices which deduct credits rather than accrue in-arrears + # charges in a billable currency, this endpoint will return the total deduction + # amount, in credits, for the specified timeframe. + # + # ## Cumulative subtotals and totals + # + # Since the subtotal and total must factor in any billing-period level discounts + # and minimums, it's most meaningful to consider costs relative to the start of + # the subscription's billing period. As a result, by default this endpoint returns + # cumulative totals since the beginning of the billing period. In particular, the + # `timeframe_start` of a returned timeframe window is _always_ the beginning of + # the billing period and `timeframe_end` is incremented one day at a time to build + # the result. + # + # A customer that uses a few API calls a day but has a minimum commitment might + # exhibit the following pattern for their subtotal and total in the first few days + # of the month. Here, we assume that each API call is $2.50, the customer's plan + # has a monthly minimum of $50 for this price, and that the subscription's billing + # period bounds are aligned to the first of the month: + # + # | timeframe_start | timeframe_end | Cumulative usage | Subtotal | Total (incl. commitment) | + # | --------------- | ------------- | ---------------- | -------- | ------------------------ | + # | 2023-02-01 | 2023-02-02 | 9 | $22.50 | $50.00 | + # | 2023-02-01 | 2023-02-03 | 19 | $47.50 | $50.00 | + # | 2023-02-01 | 2023-02-04 | 20 | $50.00 | $50.00 | + # | 2023-02-01 | 2023-02-05 | 28 | $70.00 | $70.00 | + # | 2023-02-01 | 2023-02-06 | 36 | $90.00 | $90.00 | + # + # ### Periodic values + # + # When the query parameter `view_mode=periodic` is specified, Orb will return an + # incremental day-by-day view of costs. In this case, there will always be a + # one-day difference between `timeframe_start` and `timeframe_end` for the + # timeframes returned. This is a transform on top of the cumulative costs, + # calculated by taking the difference of each timeframe with the last. Note that + # in the above example, the `Total` value would be 0 for the second two data + # points, since the minimum commitment has not yet been hit and each day is not + # contributing anything to the total cost. + # + # ## Timeframe bounds + # + # For an active subscription, both timeframes should be specified in the request. + # If a subscription starts or ends within the timeframe, the response will only + # include windows where the subscription is active. If a subscription has ended, + # no timeframe bounds need to be specified and the response will default to the + # billing period when the subscription was last active. + # + # As noted above, `timeframe_start` for a given cumulative datapoint is always the + # beginning of the billing period, and `timeframe_end` is incremented one day at a + # time to construct the response. When a timeframe is passed in that is not + # aligned to the current subscription's billing period, the response will contain + # cumulative totals from multiple billing periods. + # + # Suppose the queried customer has a subscription aligned to the 15th of every + # month. If this endpoint is queried with the date range `2023-06-01` - + # `2023-07-01`, the first data point will represent about half a billing period's + # worth of costs, accounting for accruals from the start of the billing period and + # inclusive of the first day of the timeframe + # (`timeframe_start = 2023-05-15 00:00:00`, `timeframe_end = 2023-06-02 00:00:00`) + # + # | datapoint index | timeframe_start | timeframe_end | + # | --------------- | --------------- | ------------- | + # | 0 | 2023-05-15 | 2023-06-02 | + # | 1 | 2023-05-15 | 2023-06-03 | + # | 2 | ... | ... | + # | 3 | 2023-05-15 | 2023-06-14 | + # | 4 | 2023-06-15 | 2023-06-16 | + # | 5 | 2023-06-15 | 2023-06-17 | + # | 6 | ... | ... | + # | 7 | 2023-06-15 | 2023-07-01 | + # + # You can see this sliced timeframe visualized + # [here](https://i.imgur.com/TXhYgme.png). + # + # ### Matrix prices + # + # When a price uses matrix pricing, it's important to view costs grouped by those + # matrix dimensions. Orb will return `price_groups` with the `grouping_key` and + # `secondary_grouping_key` based on the matrix price definition, for each + # `grouping_value` and `secondary_grouping_value` available. + # + # @param customer_id [String] + # + # @param params [Orb::Models::Customers::CostListParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :currency The currency or custom pricing unit to use. + # + # @option params [Time, nil] :timeframe_end Costs returned are exclusive of `timeframe_end`. + # + # @option params [Time, nil] :timeframe_start Costs returned are inclusive of `timeframe_start`. + # + # @option params [Symbol, Orb::Models::Customers::CostListParams::ViewMode, nil] :view_mode Controls whether Orb returns cumulative costs since the start of the billing + # period, or incremental day-by-day costs. If your customer has minimums or + # discounts, it's strongly recommended that you use the default cumulative + # behavior. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Customers::CostListResponse] + # + def list(customer_id, params = {}) + parsed, options = Orb::Models::Customers::CostListParams.dump_request(params) + @client.request( method: :get, - path: "/customers/#{customer_id}/costs", - query: { - group_by: group_by, - timeframe_end: timeframe_end, - timeframe_start: timeframe_start, - view_mode: view_mode - } - } - - @client.request(model: Orb::Models::CostListResponse, **request) + path: ["customers/%0s/costs", customer_id], + query: parsed, + model: Orb::Models::Customers::CostListResponse, + options: options + ) end - def list_by_external_id( - external_customer_id, - group_by: Orb::NotGiven.instance, - timeframe_end: Orb::NotGiven.instance, - timeframe_start: Orb::NotGiven.instance, - view_mode: Orb::NotGiven.instance - ) - request = { - method: :get, - path: - "/customers/external_customer_id/#{external_customer_id}/costs", - query: { - group_by: group_by, - timeframe_end: timeframe_end, - timeframe_start: timeframe_start, - view_mode: view_mode - } - } + # This endpoint is used to fetch a day-by-day snapshot of a customer's costs in + # Orb, calculated by applying pricing information to the underlying usage (see the + # [subscription usage endpoint](/api-reference/subscription/fetch-subscription-usage) + # to fetch usage per metric, in usage units rather than a currency). + # + # This endpoint can be leveraged for internal tooling and to provide a more + # transparent billing experience for your end users: + # + # 1. Understand the cost breakdown per line item historically and in real-time for + # the current billing period. + # 2. Provide customer visibility into how different services are contributing to + # the overall invoice with a per-day timeseries (as compared to the + # [upcoming invoice](/api-reference/invoice/fetch-upcoming-invoice) resource, + # which represents a snapshot for the current period). + # 3. Assess how minimums and discounts affect your customers by teasing apart + # costs directly as a result of usage, as opposed to minimums and discounts at + # the plan and price level. + # 4. Gain insight into key customer health metrics, such as the percent + # utilization of the minimum committed spend. + # + # ## Fetching subscriptions + # + # By default, this endpoint fetches the currently active subscription for the + # customer, and returns cost information for the subscription's current billing + # period, broken down by each participating price. If there are no currently + # active subscriptions, this will instead default to the most recently active + # subscription or return an empty series if none are found. For example, if your + # plan charges for compute hours, job runs, and data syncs, then this endpoint + # would provide a daily breakdown of your customer's cost for each of those axes. + # + # If timeframe bounds are specified, Orb fetches all subscriptions that were + # active in that timeframe. If two subscriptions overlap on a single day, costs + # from each price will be summed, and prices for both subscriptions will be + # included in the breakdown. + # + # ## Prepaid plans + # + # For plans that include prices which deduct credits rather than accrue in-arrears + # charges in a billable currency, this endpoint will return the total deduction + # amount, in credits, for the specified timeframe. + # + # ## Cumulative subtotals and totals + # + # Since the subtotal and total must factor in any billing-period level discounts + # and minimums, it's most meaningful to consider costs relative to the start of + # the subscription's billing period. As a result, by default this endpoint returns + # cumulative totals since the beginning of the billing period. In particular, the + # `timeframe_start` of a returned timeframe window is _always_ the beginning of + # the billing period and `timeframe_end` is incremented one day at a time to build + # the result. + # + # A customer that uses a few API calls a day but has a minimum commitment might + # exhibit the following pattern for their subtotal and total in the first few days + # of the month. Here, we assume that each API call is $2.50, the customer's plan + # has a monthly minimum of $50 for this price, and that the subscription's billing + # period bounds are aligned to the first of the month: + # + # | timeframe_start | timeframe_end | Cumulative usage | Subtotal | Total (incl. commitment) | + # | --------------- | ------------- | ---------------- | -------- | ------------------------ | + # | 2023-02-01 | 2023-02-02 | 9 | $22.50 | $50.00 | + # | 2023-02-01 | 2023-02-03 | 19 | $47.50 | $50.00 | + # | 2023-02-01 | 2023-02-04 | 20 | $50.00 | $50.00 | + # | 2023-02-01 | 2023-02-05 | 28 | $70.00 | $70.00 | + # | 2023-02-01 | 2023-02-06 | 36 | $90.00 | $90.00 | + # + # ### Periodic values + # + # When the query parameter `view_mode=periodic` is specified, Orb will return an + # incremental day-by-day view of costs. In this case, there will always be a + # one-day difference between `timeframe_start` and `timeframe_end` for the + # timeframes returned. This is a transform on top of the cumulative costs, + # calculated by taking the difference of each timeframe with the last. Note that + # in the above example, the `Total` value would be 0 for the second two data + # points, since the minimum commitment has not yet been hit and each day is not + # contributing anything to the total cost. + # + # ## Timeframe bounds + # + # For an active subscription, both timeframes should be specified in the request. + # If a subscription starts or ends within the timeframe, the response will only + # include windows where the subscription is active. If a subscription has ended, + # no timeframe bounds need to be specified and the response will default to the + # billing period when the subscription was last active. + # + # As noted above, `timeframe_start` for a given cumulative datapoint is always the + # beginning of the billing period, and `timeframe_end` is incremented one day at a + # time to construct the response. When a timeframe is passed in that is not + # aligned to the current subscription's billing period, the response will contain + # cumulative totals from multiple billing periods. + # + # Suppose the queried customer has a subscription aligned to the 15th of every + # month. If this endpoint is queried with the date range `2023-06-01` - + # `2023-07-01`, the first data point will represent about half a billing period's + # worth of costs, accounting for accruals from the start of the billing period and + # inclusive of the first day of the timeframe + # (`timeframe_start = 2023-05-15 00:00:00`, `timeframe_end = 2023-06-02 00:00:00`) + # + # | datapoint index | timeframe_start | timeframe_end | + # | --------------- | --------------- | ------------- | + # | 0 | 2023-05-15 | 2023-06-02 | + # | 1 | 2023-05-15 | 2023-06-03 | + # | 2 | ... | ... | + # | 3 | 2023-05-15 | 2023-06-14 | + # | 4 | 2023-06-15 | 2023-06-16 | + # | 5 | 2023-06-15 | 2023-06-17 | + # | 6 | ... | ... | + # | 7 | 2023-06-15 | 2023-07-01 | + # + # You can see this sliced timeframe visualized + # [here](https://i.imgur.com/TXhYgme.png). + # + # ### Matrix prices + # + # When a price uses matrix pricing, it's important to view costs grouped by those + # matrix dimensions. Orb will return `price_groups` with the `grouping_key` and + # `secondary_grouping_key` based on the matrix price definition, for each + # `grouping_value` and `secondary_grouping_value` available. + # + # @param external_customer_id [String] + # + # @param params [Orb::Models::Customers::CostListByExternalIDParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :currency The currency or custom pricing unit to use. + # + # @option params [Time, nil] :timeframe_end Costs returned are exclusive of `timeframe_end`. + # + # @option params [Time, nil] :timeframe_start Costs returned are inclusive of `timeframe_start`. + # + # @option params [Symbol, Orb::Models::Customers::CostListByExternalIDParams::ViewMode, nil] :view_mode Controls whether Orb returns cumulative costs since the start of the billing + # period, or incremental day-by-day costs. If your customer has minimums or + # discounts, it's strongly recommended that you use the default cumulative + # behavior. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Customers::CostListByExternalIDResponse] + # + def list_by_external_id(external_customer_id, params = {}) + parsed, options = Orb::Models::Customers::CostListByExternalIDParams.dump_request(params) @client.request( - model: Orb::Models::CostListByExternalIDResponse, - **request + method: :get, + path: ["customers/external_customer_id/%0s/costs", external_customer_id], + query: parsed, + model: Orb::Models::Customers::CostListByExternalIDResponse, + options: options ) end + + # @param client [Orb::Client] + # + def initialize(client:) + @client = client + end end end end diff --git a/lib/orb/resources/customers/credits.rb b/lib/orb/resources/customers/credits.rb new file mode 100644 index 00000000..fa214b4b --- /dev/null +++ b/lib/orb/resources/customers/credits.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +module Orb + module Resources + class Customers + class Credits + # @return [Orb::Resources::Customers::Credits::Ledger] + attr_reader :ledger + + # @return [Orb::Resources::Customers::Credits::TopUps] + attr_reader :top_ups + + # Returns a paginated list of unexpired, non-zero credit blocks for a customer. + # + # If `include_all_blocks` is set to `true`, all credit blocks (including expired + # and depleted blocks) will be included in the response. + # + # Note that `currency` defaults to credits if not specified. To use a real world + # currency, set `currency` to an ISO 4217 string. + # + # @param customer_id [String] + # + # @param params [Orb::Models::Customers::CreditListParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :currency The ledger currency or custom pricing unit to use. + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Boolean] :include_all_blocks If set to True, all expired and depleted blocks, as well as active block will be + # returned. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(customer_id, params = {}) + parsed, options = Orb::Models::Customers::CreditListParams.dump_request(params) + @client.request( + method: :get, + path: ["customers/%0s/credits", customer_id], + query: parsed, + page: Orb::Page, + model: Orb::Models::Customers::CreditListResponse, + options: options + ) + end + + # Returns a paginated list of unexpired, non-zero credit blocks for a customer. + # + # If `include_all_blocks` is set to `true`, all credit blocks (including expired + # and depleted blocks) will be included in the response. + # + # Note that `currency` defaults to credits if not specified. To use a real world + # currency, set `currency` to an ISO 4217 string. + # + # @param external_customer_id [String] + # + # @param params [Orb::Models::Customers::CreditListByExternalIDParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :currency The ledger currency or custom pricing unit to use. + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Boolean] :include_all_blocks If set to True, all expired and depleted blocks, as well as active block will be + # returned. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list_by_external_id(external_customer_id, params = {}) + parsed, options = Orb::Models::Customers::CreditListByExternalIDParams.dump_request(params) + @client.request( + method: :get, + path: ["customers/external_customer_id/%0s/credits", external_customer_id], + query: parsed, + page: Orb::Page, + model: Orb::Models::Customers::CreditListByExternalIDResponse, + options: options + ) + end + + # @param client [Orb::Client] + # + def initialize(client:) + @client = client + @ledger = Orb::Resources::Customers::Credits::Ledger.new(client: client) + @top_ups = Orb::Resources::Customers::Credits::TopUps.new(client: client) + end + end + end + end +end diff --git a/lib/orb/resources/customers/credits/credits.rb b/lib/orb/resources/customers/credits/credits.rb deleted file mode 100644 index 2851856f..00000000 --- a/lib/orb/resources/customers/credits/credits.rb +++ /dev/null @@ -1,63 +0,0 @@ -require "orb/model" -require "orb/models/credit_list_by_external_id_response" -require "orb/models/credit_list_response" -require "orb/pagination" -require "orb/resources/customers/credits/ledger" -module Orb - module Resources - module Customers - class CreditListResponsePage < Page - required :data, Orb::ArrayOf.new(Orb::Models::CreditListResponse) - end - - class CreditListByExternalIDResponsePage < Page - required :data, - Orb::ArrayOf.new(Orb::Models::CreditListByExternalIDResponse) - end - - class CreditsResource - attr_reader :ledger - def initialize(client:) - @client = client - @ledger = - Orb::Resources::Customers::Credits::LedgerResource.new( - client: client - ) - end - def list( - customer_id, - cursor: Orb::NotGiven.instance, - limit: Orb::NotGiven.instance - ) - request = { - method: :get, - path: "/customers/#{customer_id}/credits", - query: { - cursor: cursor, - limit: limit - } - } - - @client.request(page: CreditListResponsePage, **request) - end - def list_by_external_id( - external_customer_id, - cursor: Orb::NotGiven.instance, - limit: Orb::NotGiven.instance - ) - request = { - method: :get, - path: - "/customers/external_customer_id/#{external_customer_id}/credits", - query: { - cursor: cursor, - limit: limit - } - } - - @client.request(page: CreditListByExternalIDResponsePage, **request) - end - end - end - end -end diff --git a/lib/orb/resources/customers/credits/ledger.rb b/lib/orb/resources/customers/credits/ledger.rb index 5301dd25..0d013480 100644 --- a/lib/orb/resources/customers/credits/ledger.rb +++ b/lib/orb/resources/customers/credits/ledger.rb @@ -1,344 +1,594 @@ -require "orb/model" -require "orb/models/ledger_list_by_external_id_response" -require "orb/models/ledger_list_response" -require "orb/pagination" +# frozen_string_literal: true + module Orb module Resources - module Customers - module Credits - class LedgerListResponsePage < Page - required :data, Orb::ArrayOf.new(Orb::Models::LedgerListResponse) - end - - class LedgerListByExternalIDResponsePage < Page - required :data, - Orb::ArrayOf.new(Orb::Models::LedgerListByExternalIDResponse) - end - - class LedgerResource - attr_reader - def initialize(client:) - @client = client - end - def list( - customer_id, - created_at_gt: Orb::NotGiven.instance, - created_at_gte: Orb::NotGiven.instance, - created_at_lt: Orb::NotGiven.instance, - created_at_lte: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - cursor: Orb::NotGiven.instance, - entry_status: Orb::NotGiven.instance, - entry_type: Orb::NotGiven.instance, - limit: Orb::NotGiven.instance, - minimum_amount: Orb::NotGiven.instance - ) - request = { + class Customers + class Credits + class Ledger + # The credits ledger provides _auditing_ functionality over Orb's credits system + # with a list of actions that have taken place to modify a customer's credit + # balance. This [paginated endpoint](/api-reference/pagination) lists these + # entries, starting from the most recent ledger entry. + # + # More details on using Orb's real-time credit feature are + # [here](/product-catalog/prepurchase). + # + # There are four major types of modifications to credit balance, detailed below. + # + # ## Increment + # + # Credits (which optionally expire on a future date) can be added via the API + # ([Add Ledger Entry](create-ledger-entry)). The ledger entry for such an action + # will always contain the total eligible starting and ending balance for the + # customer at the time the entry was added to the ledger. + # + # ## Decrement + # + # Deductions can occur as a result of an API call to create a ledger entry (see + # [Add Ledger Entry](create-ledger-entry)), or automatically as a result of + # incurring usage. Both ledger entries present the `decrement` entry type. + # + # As usage for a customer is reported into Orb, credits may be deducted according + # to the customer's plan configuration. An automated deduction of this type will + # result in a ledger entry, also with a starting and ending balance. In order to + # provide better tracing capabilities for automatic deductions, Orb always + # associates each automatic deduction with the `event_id` at the time of + # ingestion, used to pinpoint _why_ credit deduction took place and to ensure that + # credits are never deducted without an associated usage event. + # + # By default, Orb uses an algorithm that automatically deducts from the _soonest + # expiring credit block_ first in order to ensure that all credits are utilized + # appropriately. As an example, if trial credits with an expiration date of 2 + # weeks from now are present for a customer, they will be used before any + # deductions take place from a non-expiring credit block. + # + # If there are multiple blocks with the same expiration date, Orb will deduct from + # the block with the _lower cost basis_ first (e.g. trial credits with a $0 cost + # basis before paid credits with a $5.00 cost basis). + # + # It's also possible for a single usage event's deduction to _span_ credit blocks. + # In this case, Orb will deduct from the next block, ending at the credit block + # which consists of unexpiring credits. Each of these deductions will lead to a + # _separate_ ledger entry, one per credit block that is deducted from. By default, + # the customer's total credit balance in Orb can be negative as a result of a + # decrement. + # + # ## Expiration change + # + # The expiry of credits can be changed as a result of the API (See + # [Add Ledger Entry](create-ledger-entry)). This will create a ledger entry that + # specifies the balance as well as the initial and target expiry dates. + # + # Note that for this entry type, `starting_balance` will equal `ending_balance`, + # and the `amount` represents the balance transferred. The credit block linked to + # the ledger entry is the source credit block from which there was an expiration + # change + # + # ## Credits expiry + # + # When a set of credits expire on pre-set expiration date, the customer's balance + # automatically reflects this change and adds an entry to the ledger indicating + # this event. Note that credit expiry should always happen close to a date + # boundary in the customer's timezone. + # + # ## Void initiated + # + # Credit blocks can be voided via the API. The `amount` on this entry corresponds + # to the number of credits that were remaining in the block at time of void. + # `void_reason` will be populated if the void is created with a reason. + # + # ## Void + # + # When a set of credits is voided, the customer's balance automatically reflects + # this change and adds an entry to the ledger indicating this event. + # + # ## Amendment + # + # When credits are added to a customer's balance as a result of a correction, this + # entry will be added to the ledger to indicate the adjustment of credits. + # + # @param customer_id [String] + # + # @param params [Orb::Models::Customers::Credits::LedgerListParams, Hash{Symbol=>Object}] . + # + # @option params [Time, nil] :created_at_gt + # + # @option params [Time, nil] :created_at_gte + # + # @option params [Time, nil] :created_at_lt + # + # @option params [Time, nil] :created_at_lte + # + # @option params [String, nil] :currency The ledger currency or custom pricing unit to use. + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Symbol, Orb::Models::Customers::Credits::LedgerListParams::EntryStatus, nil] :entry_status + # + # @option params [Symbol, Orb::Models::Customers::Credits::LedgerListParams::EntryType, nil] :entry_type + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [String, nil] :minimum_amount + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(customer_id, params = {}) + parsed, options = Orb::Models::Customers::Credits::LedgerListParams.dump_request(params) + @client.request( method: :get, - path: "/customers/#{customer_id}/credits/ledger", - query: { - "created_at[gt]": created_at_gt, - "created_at[gte]": created_at_gte, - "created_at[lt]": created_at_lt, - "created_at[lte]": created_at_lte, - currency: currency, - cursor: cursor, - entry_status: entry_status, - entry_type: entry_type, - limit: limit, - minimum_amount: minimum_amount - } - } - - @client.request(page: LedgerListResponsePage, **request) + path: ["customers/%0s/credits/ledger", customer_id], + query: parsed, + page: Orb::Page, + model: Orb::Models::Customers::Credits::LedgerListResponse, + options: options + ) end - def create_entry( - customer_id, - amount: Orb::NotGiven.instance, - entry_type: Orb::NotGiven.instance, - description: Orb::NotGiven.instance, - effective_date: Orb::NotGiven.instance, - expiry_date: Orb::NotGiven.instance, - invoice_settings: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance, - per_unit_cost_basis: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/customers/#{customer_id}/credits/ledger_entry", - body: { - amount: amount, - entry_type: entry_type, - description: description, - effective_date: effective_date, - expiry_date: expiry_date, - invoice_settings: invoice_settings, - metadata: metadata, - per_unit_cost_basis: per_unit_cost_basis - }, - query: nil - } - @client.request(**request) - end - def create_entry( - customer_id, - amount: Orb::NotGiven.instance, - entry_type: Orb::NotGiven.instance, - description: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance - ) - request = { + # This endpoint allows you to create a new ledger entry for a specified customer's + # balance. This can be used to increment balance, deduct credits, and change the + # expiry date of existing credits. + # + # ## Effects of adding a ledger entry + # + # 1. After calling this endpoint, [Fetch Credit Balance](fetch-customer-credits) + # will return a credit block that represents the changes (i.e. balance changes + # or transfers). + # 2. A ledger entry will be added to the credits ledger for this customer, and + # therefore returned in the + # [View Credits Ledger](fetch-customer-credits-ledger) response as well as + # serialized in the response to this request. In the case of deductions without + # a specified block, multiple ledger entries may be created if the deduction + # spans credit blocks. + # 3. If `invoice_settings` is specified, an invoice will be created that reflects + # the cost of the credits (based on `amount` and `per_unit_cost_basis`). + # + # ## Adding credits + # + # Adding credits is done by creating an entry of type `increment`. This requires + # the caller to specify a number of credits as well as an optional expiry date in + # `YYYY-MM-DD` format. Orb also recommends specifying a description to assist with + # auditing. When adding credits, the caller can also specify a cost basis + # per-credit, to indicate how much in USD a customer paid for a single credit in a + # block. This can later be used for revenue recognition. + # + # The following snippet illustrates a sample request body to increment credits + # which will expire in January of 2022. + # + # ```json + # { + # "entry_type": "increment", + # "amount": 100, + # "expiry_date": "2022-12-28", + # "per_unit_cost_basis": "0.20", + # "description": "Purchased 100 credits" + # } + # ``` + # + # Note that by default, Orb will always first increment any _negative_ balance in + # existing blocks before adding the remaining amount to the desired credit block. + # + # ### Invoicing for credits + # + # By default, Orb manipulates the credit ledger but does not charge for credits. + # However, if you pass `invoice_settings` in the body of this request, Orb will + # also generate a one-off invoice for the customer for the credits pre-purchase. + # Note that you _must_ provide the `per_unit_cost_basis`, since the total charges + # on the invoice are calculated by multiplying the cost basis with the number of + # credit units added. + # + # ## Deducting Credits + # + # Orb allows you to deduct credits from a customer by creating an entry of type + # `decrement`. Orb matches the algorithm for automatic deductions for determining + # which credit blocks to decrement from. In the case that the deduction leads to + # multiple ledger entries, the response from this endpoint will be the final + # deduction. Orb also optionally allows specifying a description to assist with + # auditing. + # + # The following snippet illustrates a sample request body to decrement credits. + # + # ```json + # { + # "entry_type": "decrement", + # "amount": 20, + # "description": "Removing excess credits" + # } + # ``` + # + # ## Changing credits expiry + # + # If you'd like to change when existing credits expire, you should create a ledger + # entry of type `expiration_change`. For this entry, the required parameter + # `expiry_date` identifies the _originating_ block, and the required parameter + # `target_expiry_date` identifies when the transferred credits should now expire. + # A new credit block will be created with expiry date `target_expiry_date`, with + # the same cost basis data as the original credit block, if present. + # + # Note that the balance of the block with the given `expiry_date` must be at least + # equal to the desired transfer amount determined by the `amount` parameter. + # + # The following snippet illustrates a sample request body to extend the expiration + # date of credits by one year: + # + # ```json + # { + # "entry_type": "expiration_change", + # "amount": 10, + # "expiry_date": "2022-12-28", + # "block_id": "UiUhFWeLHPrBY4Ad", + # "target_expiry_date": "2023-12-28", + # "description": "Extending credit validity" + # } + # ``` + # + # ## Voiding credits + # + # If you'd like to void a credit block, create a ledger entry of type `void`. For + # this entry, `block_id` is required to identify the block, and `amount` indicates + # how many credits to void, up to the block's initial balance. Pass in a + # `void_reason` of `refund` if the void is due to a refund. + # + # ## Amendment + # + # If you'd like to undo a decrement on a credit block, create a ledger entry of + # type `amendment`. For this entry, `block_id` is required to identify the block + # that was originally decremented from, and `amount` indicates how many credits to + # return to the customer, up to the block's initial balance. + # + # @param customer_id [String] + # + # @param params [Orb::Models::Customers::Credits::LedgerCreateEntryParams, Hash{Symbol=>Object}] . + # + # @option params [Float] :amount The number of credits to effect. Note that this is required for increment, + # decrement or void operations. + # + # @option params [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::EntryType] :entry_type + # + # @option params [String, nil] :currency The currency or custom pricing unit to use for this ledger entry. If this is a + # real-world currency, it must match the customer's invoicing currency. + # + # @option params [String, nil] :description Optional metadata that can be specified when adding ledger results via the API. + # For example, this can be used to note an increment refers to trial credits, or + # for noting corrections as a result of an incident, etc. + # + # @option params [Time, nil] :effective_date An ISO 8601 format date that denotes when this credit balance should become + # available for use. + # + # @option params [Time, nil] :expiry_date An ISO 8601 format date that identifies the origination credit block to expire + # + # @option params [Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings, nil] :invoice_settings Passing `invoice_settings` automatically generates an invoice for the newly + # added credits. If `invoice_settings` is passed, you must specify + # per_unit_cost_basis, as the calculation of the invoice total is done on that + # basis. + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [String, nil] :per_unit_cost_basis Can only be specified when entry_type=increment. How much, in the customer's + # currency, a customer paid for a single credit in this block + # + # @option params [Date] :target_expiry_date A future date (specified in YYYY-MM-DD format) used for expiration change, + # denoting when credits transferred (as part of a partial block expiration) should + # expire. + # + # @option params [String] :block_id The ID of the block to reverse a decrement from. + # + # @option params [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::VoidReason, nil] :void_reason Can only be specified when `entry_type=void`. The reason for the void. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry] + # + def create_entry(customer_id, params) + parsed, options = Orb::Models::Customers::Credits::LedgerCreateEntryParams.dump_request(params) + @client.request( method: :post, - path: "/customers/#{customer_id}/credits/ledger_entry", - body: { - amount: amount, - entry_type: entry_type, - description: description, - metadata: metadata - }, - query: nil - } - - @client.request(**request) + path: ["customers/%0s/credits/ledger_entry", customer_id], + body: parsed, + model: Orb::Models::Customers::Credits::LedgerCreateEntryResponse, + options: options + ) end - def create_entry( - customer_id, - entry_type: Orb::NotGiven.instance, - expiry_date: Orb::NotGiven.instance, - target_expiry_date: Orb::NotGiven.instance, - amount: Orb::NotGiven.instance, - block_id: Orb::NotGiven.instance, - description: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/customers/#{customer_id}/credits/ledger_entry", - body: { - entry_type: entry_type, - expiry_date: expiry_date, - target_expiry_date: target_expiry_date, - amount: amount, - block_id: block_id, - description: description, - metadata: metadata - }, - query: nil - } - @client.request(**request) - end - def create_entry( - customer_id, - amount: Orb::NotGiven.instance, - block_id: Orb::NotGiven.instance, - entry_type: Orb::NotGiven.instance, - description: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance, - void_reason: Orb::NotGiven.instance - ) - request = { + # This endpoint allows you to create a new ledger entry for a specified customer's + # balance. This can be used to increment balance, deduct credits, and change the + # expiry date of existing credits. + # + # ## Effects of adding a ledger entry + # + # 1. After calling this endpoint, [Fetch Credit Balance](fetch-customer-credits) + # will return a credit block that represents the changes (i.e. balance changes + # or transfers). + # 2. A ledger entry will be added to the credits ledger for this customer, and + # therefore returned in the + # [View Credits Ledger](fetch-customer-credits-ledger) response as well as + # serialized in the response to this request. In the case of deductions without + # a specified block, multiple ledger entries may be created if the deduction + # spans credit blocks. + # 3. If `invoice_settings` is specified, an invoice will be created that reflects + # the cost of the credits (based on `amount` and `per_unit_cost_basis`). + # + # ## Adding credits + # + # Adding credits is done by creating an entry of type `increment`. This requires + # the caller to specify a number of credits as well as an optional expiry date in + # `YYYY-MM-DD` format. Orb also recommends specifying a description to assist with + # auditing. When adding credits, the caller can also specify a cost basis + # per-credit, to indicate how much in USD a customer paid for a single credit in a + # block. This can later be used for revenue recognition. + # + # The following snippet illustrates a sample request body to increment credits + # which will expire in January of 2022. + # + # ```json + # { + # "entry_type": "increment", + # "amount": 100, + # "expiry_date": "2022-12-28", + # "per_unit_cost_basis": "0.20", + # "description": "Purchased 100 credits" + # } + # ``` + # + # Note that by default, Orb will always first increment any _negative_ balance in + # existing blocks before adding the remaining amount to the desired credit block. + # + # ### Invoicing for credits + # + # By default, Orb manipulates the credit ledger but does not charge for credits. + # However, if you pass `invoice_settings` in the body of this request, Orb will + # also generate a one-off invoice for the customer for the credits pre-purchase. + # Note that you _must_ provide the `per_unit_cost_basis`, since the total charges + # on the invoice are calculated by multiplying the cost basis with the number of + # credit units added. + # + # ## Deducting Credits + # + # Orb allows you to deduct credits from a customer by creating an entry of type + # `decrement`. Orb matches the algorithm for automatic deductions for determining + # which credit blocks to decrement from. In the case that the deduction leads to + # multiple ledger entries, the response from this endpoint will be the final + # deduction. Orb also optionally allows specifying a description to assist with + # auditing. + # + # The following snippet illustrates a sample request body to decrement credits. + # + # ```json + # { + # "entry_type": "decrement", + # "amount": 20, + # "description": "Removing excess credits" + # } + # ``` + # + # ## Changing credits expiry + # + # If you'd like to change when existing credits expire, you should create a ledger + # entry of type `expiration_change`. For this entry, the required parameter + # `expiry_date` identifies the _originating_ block, and the required parameter + # `target_expiry_date` identifies when the transferred credits should now expire. + # A new credit block will be created with expiry date `target_expiry_date`, with + # the same cost basis data as the original credit block, if present. + # + # Note that the balance of the block with the given `expiry_date` must be at least + # equal to the desired transfer amount determined by the `amount` parameter. + # + # The following snippet illustrates a sample request body to extend the expiration + # date of credits by one year: + # + # ```json + # { + # "entry_type": "expiration_change", + # "amount": 10, + # "expiry_date": "2022-12-28", + # "block_id": "UiUhFWeLHPrBY4Ad", + # "target_expiry_date": "2023-12-28", + # "description": "Extending credit validity" + # } + # ``` + # + # ## Voiding credits + # + # If you'd like to void a credit block, create a ledger entry of type `void`. For + # this entry, `block_id` is required to identify the block, and `amount` indicates + # how many credits to void, up to the block's initial balance. Pass in a + # `void_reason` of `refund` if the void is due to a refund. + # + # ## Amendment + # + # If you'd like to undo a decrement on a credit block, create a ledger entry of + # type `amendment`. For this entry, `block_id` is required to identify the block + # that was originally decremented from, and `amount` indicates how many credits to + # return to the customer, up to the block's initial balance. + # + # @param external_customer_id [String] + # + # @param params [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams, Hash{Symbol=>Object}] . + # + # @option params [Float] :amount The number of credits to effect. Note that this is required for increment, + # decrement or void operations. + # + # @option params [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::EntryType] :entry_type + # + # @option params [String, nil] :currency The currency or custom pricing unit to use for this ledger entry. If this is a + # real-world currency, it must match the customer's invoicing currency. + # + # @option params [String, nil] :description Optional metadata that can be specified when adding ledger results via the API. + # For example, this can be used to note an increment refers to trial credits, or + # for noting corrections as a result of an incident, etc. + # + # @option params [Time, nil] :effective_date An ISO 8601 format date that denotes when this credit balance should become + # available for use. + # + # @option params [Time, nil] :expiry_date An ISO 8601 format date that identifies the origination credit block to expire + # + # @option params [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings, nil] :invoice_settings Passing `invoice_settings` automatically generates an invoice for the newly + # added credits. If `invoice_settings` is passed, you must specify + # per_unit_cost_basis, as the calculation of the invoice total is done on that + # basis. + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [String, nil] :per_unit_cost_basis Can only be specified when entry_type=increment. How much, in the customer's + # currency, a customer paid for a single credit in this block + # + # @option params [Date] :target_expiry_date A future date (specified in YYYY-MM-DD format) used for expiration change, + # denoting when credits transferred (as part of a partial block expiration) should + # expire. + # + # @option params [String] :block_id The ID of the block to reverse a decrement from. + # + # @option params [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::VoidReason, nil] :void_reason Can only be specified when `entry_type=void`. The reason for the void. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry] + # + def create_entry_by_external_id(external_customer_id, params) + parsed, options = Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams.dump_request(params) + @client.request( method: :post, - path: "/customers/#{customer_id}/credits/ledger_entry", - body: { - amount: amount, - block_id: block_id, - entry_type: entry_type, - description: description, - metadata: metadata, - void_reason: void_reason - }, - query: nil - } - - @client.request(**request) + path: ["customers/external_customer_id/%0s/credits/ledger_entry", external_customer_id], + body: parsed, + model: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse, + options: options + ) end - def create_entry( - customer_id, - amount: Orb::NotGiven.instance, - block_id: Orb::NotGiven.instance, - entry_type: Orb::NotGiven.instance, - description: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/customers/#{customer_id}/credits/ledger_entry", - body: { - amount: amount, - block_id: block_id, - entry_type: entry_type, - description: description, - metadata: metadata - }, - query: nil - } - @client.request(**request) - end - def create_entry_by_external_id( - external_customer_id, - amount: Orb::NotGiven.instance, - entry_type: Orb::NotGiven.instance, - description: Orb::NotGiven.instance, - effective_date: Orb::NotGiven.instance, - expiry_date: Orb::NotGiven.instance, - invoice_settings: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance, - per_unit_cost_basis: Orb::NotGiven.instance - ) - request = { - method: :post, - path: - "/customers/external_customer_id/#{external_customer_id}/credits/ledger_entry", - body: { - amount: amount, - entry_type: entry_type, - description: description, - effective_date: effective_date, - expiry_date: expiry_date, - invoice_settings: invoice_settings, - metadata: metadata, - per_unit_cost_basis: per_unit_cost_basis - }, - query: nil - } - - @client.request(**request) - end - def create_entry_by_external_id( - external_customer_id, - amount: Orb::NotGiven.instance, - entry_type: Orb::NotGiven.instance, - description: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance - ) - request = { - method: :post, - path: - "/customers/external_customer_id/#{external_customer_id}/credits/ledger_entry", - body: { - amount: amount, - entry_type: entry_type, - description: description, - metadata: metadata - }, - query: nil - } - - @client.request(**request) - end - def create_entry_by_external_id( - external_customer_id, - entry_type: Orb::NotGiven.instance, - expiry_date: Orb::NotGiven.instance, - target_expiry_date: Orb::NotGiven.instance, - amount: Orb::NotGiven.instance, - block_id: Orb::NotGiven.instance, - description: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance - ) - request = { - method: :post, - path: - "/customers/external_customer_id/#{external_customer_id}/credits/ledger_entry", - body: { - entry_type: entry_type, - expiry_date: expiry_date, - target_expiry_date: target_expiry_date, - amount: amount, - block_id: block_id, - description: description, - metadata: metadata - }, - query: nil - } - - @client.request(**request) - end - def create_entry_by_external_id( - external_customer_id, - amount: Orb::NotGiven.instance, - block_id: Orb::NotGiven.instance, - entry_type: Orb::NotGiven.instance, - description: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance, - void_reason: Orb::NotGiven.instance - ) - request = { - method: :post, - path: - "/customers/external_customer_id/#{external_customer_id}/credits/ledger_entry", - body: { - amount: amount, - block_id: block_id, - entry_type: entry_type, - description: description, - metadata: metadata, - void_reason: void_reason - }, - query: nil - } - - @client.request(**request) - end - def create_entry_by_external_id( - external_customer_id, - amount: Orb::NotGiven.instance, - block_id: Orb::NotGiven.instance, - entry_type: Orb::NotGiven.instance, - description: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance - ) - request = { - method: :post, - path: - "/customers/external_customer_id/#{external_customer_id}/credits/ledger_entry", - body: { - amount: amount, - block_id: block_id, - entry_type: entry_type, - description: description, - metadata: metadata - }, - query: nil - } - - @client.request(**request) - end - def list_by_external_id( - external_customer_id, - created_at_gt: Orb::NotGiven.instance, - created_at_gte: Orb::NotGiven.instance, - created_at_lt: Orb::NotGiven.instance, - created_at_lte: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - cursor: Orb::NotGiven.instance, - entry_status: Orb::NotGiven.instance, - entry_type: Orb::NotGiven.instance, - limit: Orb::NotGiven.instance, - minimum_amount: Orb::NotGiven.instance - ) - request = { + # The credits ledger provides _auditing_ functionality over Orb's credits system + # with a list of actions that have taken place to modify a customer's credit + # balance. This [paginated endpoint](/api-reference/pagination) lists these + # entries, starting from the most recent ledger entry. + # + # More details on using Orb's real-time credit feature are + # [here](/product-catalog/prepurchase). + # + # There are four major types of modifications to credit balance, detailed below. + # + # ## Increment + # + # Credits (which optionally expire on a future date) can be added via the API + # ([Add Ledger Entry](create-ledger-entry)). The ledger entry for such an action + # will always contain the total eligible starting and ending balance for the + # customer at the time the entry was added to the ledger. + # + # ## Decrement + # + # Deductions can occur as a result of an API call to create a ledger entry (see + # [Add Ledger Entry](create-ledger-entry)), or automatically as a result of + # incurring usage. Both ledger entries present the `decrement` entry type. + # + # As usage for a customer is reported into Orb, credits may be deducted according + # to the customer's plan configuration. An automated deduction of this type will + # result in a ledger entry, also with a starting and ending balance. In order to + # provide better tracing capabilities for automatic deductions, Orb always + # associates each automatic deduction with the `event_id` at the time of + # ingestion, used to pinpoint _why_ credit deduction took place and to ensure that + # credits are never deducted without an associated usage event. + # + # By default, Orb uses an algorithm that automatically deducts from the _soonest + # expiring credit block_ first in order to ensure that all credits are utilized + # appropriately. As an example, if trial credits with an expiration date of 2 + # weeks from now are present for a customer, they will be used before any + # deductions take place from a non-expiring credit block. + # + # If there are multiple blocks with the same expiration date, Orb will deduct from + # the block with the _lower cost basis_ first (e.g. trial credits with a $0 cost + # basis before paid credits with a $5.00 cost basis). + # + # It's also possible for a single usage event's deduction to _span_ credit blocks. + # In this case, Orb will deduct from the next block, ending at the credit block + # which consists of unexpiring credits. Each of these deductions will lead to a + # _separate_ ledger entry, one per credit block that is deducted from. By default, + # the customer's total credit balance in Orb can be negative as a result of a + # decrement. + # + # ## Expiration change + # + # The expiry of credits can be changed as a result of the API (See + # [Add Ledger Entry](create-ledger-entry)). This will create a ledger entry that + # specifies the balance as well as the initial and target expiry dates. + # + # Note that for this entry type, `starting_balance` will equal `ending_balance`, + # and the `amount` represents the balance transferred. The credit block linked to + # the ledger entry is the source credit block from which there was an expiration + # change + # + # ## Credits expiry + # + # When a set of credits expire on pre-set expiration date, the customer's balance + # automatically reflects this change and adds an entry to the ledger indicating + # this event. Note that credit expiry should always happen close to a date + # boundary in the customer's timezone. + # + # ## Void initiated + # + # Credit blocks can be voided via the API. The `amount` on this entry corresponds + # to the number of credits that were remaining in the block at time of void. + # `void_reason` will be populated if the void is created with a reason. + # + # ## Void + # + # When a set of credits is voided, the customer's balance automatically reflects + # this change and adds an entry to the ledger indicating this event. + # + # ## Amendment + # + # When credits are added to a customer's balance as a result of a correction, this + # entry will be added to the ledger to indicate the adjustment of credits. + # + # @param external_customer_id [String] + # + # @param params [Orb::Models::Customers::Credits::LedgerListByExternalIDParams, Hash{Symbol=>Object}] . + # + # @option params [Time, nil] :created_at_gt + # + # @option params [Time, nil] :created_at_gte + # + # @option params [Time, nil] :created_at_lt + # + # @option params [Time, nil] :created_at_lte + # + # @option params [String, nil] :currency The ledger currency or custom pricing unit to use. + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDParams::EntryStatus, nil] :entry_status + # + # @option params [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDParams::EntryType, nil] :entry_type + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [String, nil] :minimum_amount + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list_by_external_id(external_customer_id, params = {}) + parsed, options = Orb::Models::Customers::Credits::LedgerListByExternalIDParams.dump_request(params) + @client.request( method: :get, - path: - "/customers/external_customer_id/#{external_customer_id}/credits/ledger", - query: { - "created_at[gt]": created_at_gt, - "created_at[gte]": created_at_gte, - "created_at[lt]": created_at_lt, - "created_at[lte]": created_at_lte, - currency: currency, - cursor: cursor, - entry_status: entry_status, - entry_type: entry_type, - limit: limit, - minimum_amount: minimum_amount - } - } + path: ["customers/external_customer_id/%0s/credits/ledger", external_customer_id], + query: parsed, + page: Orb::Page, + model: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse, + options: options + ) + end - @client.request(page: LedgerListByExternalIDResponsePage, **request) + # @param client [Orb::Client] + # + def initialize(client:) + @client = client end end end diff --git a/lib/orb/resources/customers/credits/top_ups.rb b/lib/orb/resources/customers/credits/top_ups.rb new file mode 100644 index 00000000..392c34a9 --- /dev/null +++ b/lib/orb/resources/customers/credits/top_ups.rb @@ -0,0 +1,213 @@ +# frozen_string_literal: true + +module Orb + module Resources + class Customers + class Credits + class TopUps + # This endpoint allows you to create a new top-up for a specified customer's + # balance. While this top-up is active, the customer's balance will added in + # increments of the specified amount whenever the balance reaches the specified + # threshold. + # + # If a top-up already exists for this customer in the same currency, the existing + # top-up will be replaced. + # + # @param customer_id [String] + # + # @param params [Orb::Models::Customers::Credits::TopUpCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :amount The amount to increment when the threshold is reached. + # + # @option params [String] :currency The currency or custom pricing unit to use for this top-up. If this is a + # real-world currency, it must match the customer's invoicing currency. + # + # @option params [Orb::Models::Customers::Credits::TopUpCreateParams::InvoiceSettings] :invoice_settings Settings for invoices generated by triggered top-ups. + # + # @option params [String] :per_unit_cost_basis How much, in the customer's currency, to charge for each unit. + # + # @option params [String] :threshold The threshold at which to trigger the top-up. If the balance is at or below this + # threshold, the top-up will be triggered. + # + # @option params [Integer, nil] :expires_after The number of days or months after which the top-up expires. If unspecified, it + # does not expire. + # + # @option params [Symbol, Orb::Models::Customers::Credits::TopUpCreateParams::ExpiresAfterUnit, nil] :expires_after_unit The unit of expires_after. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Customers::Credits::TopUpCreateResponse] + # + def create(customer_id, params) + parsed, options = Orb::Models::Customers::Credits::TopUpCreateParams.dump_request(params) + @client.request( + method: :post, + path: ["customers/%0s/credits/top_ups", customer_id], + body: parsed, + model: Orb::Models::Customers::Credits::TopUpCreateResponse, + options: options + ) + end + + # List top-ups + # + # @param customer_id [String] + # + # @param params [Orb::Models::Customers::Credits::TopUpListParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(customer_id, params = {}) + parsed, options = Orb::Models::Customers::Credits::TopUpListParams.dump_request(params) + @client.request( + method: :get, + path: ["customers/%0s/credits/top_ups", customer_id], + query: parsed, + page: Orb::Page, + model: Orb::Models::Customers::Credits::TopUpListResponse, + options: options + ) + end + + # Delete top-up + # + # @param top_up_id [String] + # + # @param params [Orb::Models::Customers::Credits::TopUpDeleteParams, Hash{Symbol=>Object}] . + # + # @option params [String] :customer_id + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [nil] + # + def delete(top_up_id, params) + parsed, options = Orb::Models::Customers::Credits::TopUpDeleteParams.dump_request(params) + customer_id = parsed.fetch(:customer_id) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :delete, + path: ["customers/%0s/credits/top_ups/%1s", customer_id, top_up_id], + model: NilClass, + options: options + ) + end + + # This endpoint allows you to create a new top-up for a specified customer's + # balance. While this top-up is active, the customer's balance will added in + # increments of the specified amount whenever the balance reaches the specified + # threshold. + # + # If a top-up already exists for this customer in the same currency, the existing + # top-up will be replaced. + # + # @param external_customer_id [String] + # + # @param params [Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams, Hash{Symbol=>Object}] . + # + # @option params [String] :amount The amount to increment when the threshold is reached. + # + # @option params [String] :currency The currency or custom pricing unit to use for this top-up. If this is a + # real-world currency, it must match the customer's invoicing currency. + # + # @option params [Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::InvoiceSettings] :invoice_settings Settings for invoices generated by triggered top-ups. + # + # @option params [String] :per_unit_cost_basis How much, in the customer's currency, to charge for each unit. + # + # @option params [String] :threshold The threshold at which to trigger the top-up. If the balance is at or below this + # threshold, the top-up will be triggered. + # + # @option params [Integer, nil] :expires_after The number of days or months after which the top-up expires. If unspecified, it + # does not expire. + # + # @option params [Symbol, Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::ExpiresAfterUnit, nil] :expires_after_unit The unit of expires_after. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse] + # + def create_by_external_id(external_customer_id, params) + parsed, options = Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams.dump_request(params) + @client.request( + method: :post, + path: ["customers/external_customer_id/%0s/credits/top_ups", external_customer_id], + body: parsed, + model: Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse, + options: options + ) + end + + # Delete top-up by external ID + # + # @param top_up_id [String] + # + # @param params [Orb::Models::Customers::Credits::TopUpDeleteByExternalIDParams, Hash{Symbol=>Object}] . + # + # @option params [String] :external_customer_id + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [nil] + # + def delete_by_external_id(top_up_id, params) + parsed, options = Orb::Models::Customers::Credits::TopUpDeleteByExternalIDParams.dump_request(params) + external_customer_id = parsed.fetch(:external_customer_id) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :delete, + path: [ + "customers/external_customer_id/%0s/credits/top_ups/%1s", + external_customer_id, + top_up_id + ], + model: NilClass, + options: options + ) + end + + # List top-ups by external ID + # + # @param external_customer_id [String] + # + # @param params [Orb::Models::Customers::Credits::TopUpListByExternalIDParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list_by_external_id(external_customer_id, params = {}) + parsed, options = Orb::Models::Customers::Credits::TopUpListByExternalIDParams.dump_request(params) + @client.request( + method: :get, + path: ["customers/external_customer_id/%0s/credits/top_ups", external_customer_id], + query: parsed, + page: Orb::Page, + model: Orb::Models::Customers::Credits::TopUpListByExternalIDResponse, + options: options + ) + end + + # @param client [Orb::Client] + # + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/orb/resources/customers/customers.rb b/lib/orb/resources/customers/customers.rb deleted file mode 100644 index 5c89d8ee..00000000 --- a/lib/orb/resources/customers/customers.rb +++ /dev/null @@ -1,205 +0,0 @@ -require "orb/model" -require "orb/models/customer" -require "orb/pagination" -require "orb/resources/customers/balance_transactions" -require "orb/resources/customers/costs" -require "orb/resources/customers/credits/credits" -require "orb/resources/customers/usage" -module Orb - module Resources - class CustomerPage < Page - required :data, Orb::ArrayOf.new(Orb::Models::Customer) - end - - class CustomersResource - attr_reader :costs, :usage, :credits, :balance_transactions - def initialize(client:) - @client = client - @costs = Orb::Resources::Customers::CostsResource.new(client: client) - @usage = Orb::Resources::Customers::UsageResource.new(client: client) - @credits = - Orb::Resources::Customers::CreditsResource.new(client: client) - @balance_transactions = - Orb::Resources::Customers::BalanceTransactionsResource.new( - client: client - ) - end - def create( - email: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - accounting_sync_configuration: Orb::NotGiven.instance, - additional_emails: Orb::NotGiven.instance, - auto_collection: Orb::NotGiven.instance, - billing_address: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - email_delivery: Orb::NotGiven.instance, - external_customer_id: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance, - payment_provider: Orb::NotGiven.instance, - payment_provider_id: Orb::NotGiven.instance, - reporting_configuration: Orb::NotGiven.instance, - shipping_address: Orb::NotGiven.instance, - tax_id: Orb::NotGiven.instance, - timezone: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/customers", - body: { - email: email, - name: name, - accounting_sync_configuration: accounting_sync_configuration, - additional_emails: additional_emails, - auto_collection: auto_collection, - billing_address: billing_address, - currency: currency, - email_delivery: email_delivery, - external_customer_id: external_customer_id, - metadata: metadata, - payment_provider: payment_provider, - payment_provider_id: payment_provider_id, - reporting_configuration: reporting_configuration, - shipping_address: shipping_address, - tax_id: tax_id, - timezone: timezone - }, - query: nil - } - - @client.request(model: Orb::Models::Customer, **request) - end - def update( - customer_id, - accounting_sync_configuration: Orb::NotGiven.instance, - additional_emails: Orb::NotGiven.instance, - auto_collection: Orb::NotGiven.instance, - billing_address: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - email: Orb::NotGiven.instance, - email_delivery: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - payment_provider: Orb::NotGiven.instance, - payment_provider_id: Orb::NotGiven.instance, - reporting_configuration: Orb::NotGiven.instance, - shipping_address: Orb::NotGiven.instance, - tax_id: Orb::NotGiven.instance - ) - request = { - method: :put, - path: "/customers/#{customer_id}", - body: { - accounting_sync_configuration: accounting_sync_configuration, - additional_emails: additional_emails, - auto_collection: auto_collection, - billing_address: billing_address, - currency: currency, - email: email, - email_delivery: email_delivery, - metadata: metadata, - name: name, - payment_provider: payment_provider, - payment_provider_id: payment_provider_id, - reporting_configuration: reporting_configuration, - shipping_address: shipping_address, - tax_id: tax_id - }, - query: nil - } - - @client.request(model: Orb::Models::Customer, **request) - end - def list( - created_at_gt: Orb::NotGiven.instance, - created_at_gte: Orb::NotGiven.instance, - created_at_lt: Orb::NotGiven.instance, - created_at_lte: Orb::NotGiven.instance, - cursor: Orb::NotGiven.instance, - limit: Orb::NotGiven.instance - ) - request = { - method: :get, - path: "/customers", - query: { - "created_at[gt]": created_at_gt, - "created_at[gte]": created_at_gte, - "created_at[lt]": created_at_lt, - "created_at[lte]": created_at_lte, - cursor: cursor, - limit: limit - } - } - - @client.request(page: CustomerPage, **request) - end - def delete(customer_id) - request = { - method: :delete, - path: "/customers/#{customer_id}", - query: nil - } - - @client.request(model: NilClass, **request) - end - def fetch(customer_id) - request = { - method: :get, - path: "/customers/#{customer_id}", - query: nil - } - - @client.request(model: Orb::Models::Customer, **request) - end - def fetch_by_external_id(external_customer_id) - request = { - method: :get, - path: "/customers/external_customer_id/#{external_customer_id}", - query: nil - } - - @client.request(model: Orb::Models::Customer, **request) - end - def update_by_external_id( - id, - accounting_sync_configuration: Orb::NotGiven.instance, - additional_emails: Orb::NotGiven.instance, - auto_collection: Orb::NotGiven.instance, - billing_address: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - email: Orb::NotGiven.instance, - email_delivery: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - payment_provider: Orb::NotGiven.instance, - payment_provider_id: Orb::NotGiven.instance, - reporting_configuration: Orb::NotGiven.instance, - shipping_address: Orb::NotGiven.instance, - tax_id: Orb::NotGiven.instance - ) - request = { - method: :put, - path: "/customers/external_customer_id/#{id}", - body: { - accounting_sync_configuration: accounting_sync_configuration, - additional_emails: additional_emails, - auto_collection: auto_collection, - billing_address: billing_address, - currency: currency, - email: email, - email_delivery: email_delivery, - metadata: metadata, - name: name, - payment_provider: payment_provider, - payment_provider_id: payment_provider_id, - reporting_configuration: reporting_configuration, - shipping_address: shipping_address, - tax_id: tax_id - }, - query: nil - } - - @client.request(model: Orb::Models::Customer, **request) - end - end - end -end diff --git a/lib/orb/resources/customers/usage.rb b/lib/orb/resources/customers/usage.rb deleted file mode 100644 index 599a6798..00000000 --- a/lib/orb/resources/customers/usage.rb +++ /dev/null @@ -1,58 +0,0 @@ -require "orb/model" -require "orb/models/usage_update_by_external_id_response" -require "orb/models/usage_update_response" -module Orb - module Resources - module Customers - class UsageResource - attr_reader - def initialize(client:) - @client = client - end - def update( - id, - events: Orb::NotGiven.instance, - timeframe_end: Orb::NotGiven.instance, - timeframe_start: Orb::NotGiven.instance - ) - request = { - method: :patch, - path: "/customers/#{id}/usage", - body: { - events: events - }, - query: { - timeframe_end: timeframe_end, - timeframe_start: timeframe_start - } - } - - @client.request(model: Orb::Models::UsageUpdateResponse, **request) - end - def update_by_external_id( - id, - events: Orb::NotGiven.instance, - timeframe_end: Orb::NotGiven.instance, - timeframe_start: Orb::NotGiven.instance - ) - request = { - method: :patch, - path: "/customers/external_customer_id/#{id}/usage", - body: { - events: events - }, - query: { - timeframe_end: timeframe_end, - timeframe_start: timeframe_start - } - } - - @client.request( - model: Orb::Models::UsageUpdateByExternalIDResponse, - **request - ) - end - end - end - end -end diff --git a/lib/orb/resources/dimensional_price_groups.rb b/lib/orb/resources/dimensional_price_groups.rb new file mode 100644 index 00000000..c50e8007 --- /dev/null +++ b/lib/orb/resources/dimensional_price_groups.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +module Orb + module Resources + class DimensionalPriceGroups + # @return [Orb::Resources::DimensionalPriceGroups::ExternalDimensionalPriceGroupID] + attr_reader :external_dimensional_price_group_id + + # A dimensional price group is used to partition the result of a billable metric + # by a set of dimensions. Prices in a price group must specify the parition used + # to derive their usage. + # + # For example, suppose we have a billable metric that measures the number of + # widgets used and we want to charge differently depending on the color of the + # widget. We can create a price group with a dimension "color" and two prices: one + # that charges $10 per red widget and one that charges $20 per blue widget. + # + # @param params [Orb::Models::DimensionalPriceGroupCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :billable_metric_id + # + # @option params [Array] :dimensions The set of keys (in order) used to disambiguate prices in the group. + # + # @option params [String] :name + # + # @option params [String, nil] :external_dimensional_price_group_id + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::DimensionalPriceGroup] + # + def create(params) + parsed, options = Orb::Models::DimensionalPriceGroupCreateParams.dump_request(params) + @client.request( + method: :post, + path: "dimensional_price_groups", + body: parsed, + model: Orb::Models::DimensionalPriceGroup, + options: options + ) + end + + # Fetch dimensional price group + # + # @param dimensional_price_group_id [String] + # + # @param params [Orb::Models::DimensionalPriceGroupRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::DimensionalPriceGroup] + # + def retrieve(dimensional_price_group_id, params = {}) + @client.request( + method: :get, + path: ["dimensional_price_groups/%0s", dimensional_price_group_id], + model: Orb::Models::DimensionalPriceGroup, + options: params[:request_options] + ) + end + + # List dimensional price groups + # + # @param params [Orb::Models::DimensionalPriceGroupListParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(params = {}) + parsed, options = Orb::Models::DimensionalPriceGroupListParams.dump_request(params) + @client.request( + method: :get, + path: "dimensional_price_groups", + query: parsed, + page: Orb::Page, + model: Orb::Models::DimensionalPriceGroup, + options: options + ) + end + + # @param client [Orb::Client] + # + def initialize(client:) + @client = client + @external_dimensional_price_group_id = Orb::Resources::DimensionalPriceGroups::ExternalDimensionalPriceGroupID.new(client: client) + end + end + end +end diff --git a/lib/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rb b/lib/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rb new file mode 100644 index 00000000..a4ad4400 --- /dev/null +++ b/lib/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Orb + module Resources + class DimensionalPriceGroups + class ExternalDimensionalPriceGroupID + # Fetch dimensional price group by external ID + # + # @param external_dimensional_price_group_id [String] + # + # @param params [Orb::Models::DimensionalPriceGroups::ExternalDimensionalPriceGroupIDRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::DimensionalPriceGroup] + # + def retrieve(external_dimensional_price_group_id, params = {}) + @client.request( + method: :get, + path: [ + "dimensional_price_groups/external_dimensional_price_group_id/%0s", + external_dimensional_price_group_id + ], + model: Orb::Models::DimensionalPriceGroup, + options: params[:request_options] + ) + end + + # @param client [Orb::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/orb/resources/events.rb b/lib/orb/resources/events.rb new file mode 100644 index 00000000..aafa3f5d --- /dev/null +++ b/lib/orb/resources/events.rb @@ -0,0 +1,432 @@ +# frozen_string_literal: true + +module Orb + module Resources + class Events + # @return [Orb::Resources::Events::Backfills] + attr_reader :backfills + + # @return [Orb::Resources::Events::Volume] + attr_reader :volume + + # This endpoint is used to amend a single usage event with a given `event_id`. + # `event_id` refers to the `idempotency_key` passed in during ingestion. The event + # will maintain its existing `event_id` after the amendment. + # + # This endpoint will mark the existing event as ignored, and Orb will only use the + # new event passed in the body of this request as the source of truth for that + # `event_id`. Note that a single event can be amended any number of times, so the + # same event can be overwritten in subsequent calls to this endpoint. Only a + # single event with a given `event_id` will be considered the source of truth at + # any given time. + # + # This is a powerful and audit-safe mechanism to retroactively update a single + # event in cases where you need to: + # + # - update an event with new metadata as you iterate on your pricing model + # - update an event based on the result of an external API call (e.g. call to a + # payment gateway succeeded or failed) + # + # This amendment API is always audit-safe. The process will still retain the + # original event, though it will be ignored for billing calculations. For auditing + # and data fidelity purposes, Orb never overwrites or permanently deletes ingested + # usage data. + # + # ## Request validation + # + # - The `timestamp` of the new event must match the `timestamp` of the existing + # event already ingested. As with ingestion, all timestamps must be sent in + # ISO8601 format with UTC timezone offset. + # - The `customer_id` or `external_customer_id` of the new event must match the + # `customer_id` or `external_customer_id` of the existing event already + # ingested. Exactly one of `customer_id` and `external_customer_id` should be + # specified, and similar to ingestion, the ID must identify a Customer resource + # within Orb. Unlike ingestion, for event amendment, we strictly enforce that + # the Customer must be in the Orb system, even during the initial integration + # period. We do not allow updating the `Customer` an event is associated with. + # - Orb does not accept an `idempotency_key` with the event in this endpoint, + # since this request is by design idempotent. On retryable errors, you should + # retry the request and assume the amendment operation has not succeeded until + # receipt of a 2xx. + # - The event's `timestamp` must fall within the customer's current subscription's + # billing period, or within the grace period of the customer's current + # subscription's previous billing period. + # - By default, no more than 100 events can be amended for a single customer in a + # 100 day period. For higher volume updates, consider using the + # [event backfill](create-backfill) endpoint. + # + # @param event_id [String] + # + # @param params [Orb::Models::EventUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :event_name A name to meaningfully identify the action or event type. + # + # @option params [Object] :properties A dictionary of custom properties. Values in this dictionary must be numeric, + # boolean, or strings. Nested dictionaries are disallowed. + # + # @option params [Time] :timestamp An ISO 8601 format date with no timezone offset (i.e. UTC). This should + # represent the time that usage was recorded, and is particularly important to + # attribute usage to a given billing period. + # + # @option params [String, nil] :customer_id The Orb Customer identifier + # + # @option params [String, nil] :external_customer_id An alias for the Orb customer, whose mapping is specified when creating the + # customer + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::EventUpdateResponse] + # + def update(event_id, params) + parsed, options = Orb::Models::EventUpdateParams.dump_request(params) + @client.request( + method: :put, + path: ["events/%0s", event_id], + body: parsed, + model: Orb::Models::EventUpdateResponse, + options: options + ) + end + + # This endpoint is used to deprecate a single usage event with a given `event_id`. + # `event_id` refers to the `idempotency_key` passed in during ingestion. + # + # This endpoint will mark the existing event as ignored. Note that if you attempt + # to re-ingest an event with the same `event_id` as a deprecated event, Orb will + # return an error. + # + # This is a powerful and audit-safe mechanism to retroactively deprecate a single + # event in cases where you need to: + # + # - no longer bill for an event that was improperly reported + # - no longer bill for an event based on the result of an external API call (e.g. + # call to a payment gateway failed and the user should not be billed) + # + # If you want to only change specific properties of an event, but keep the event + # as part of the billing calculation, use the [Amend event](amend-event) endpoint + # instead. + # + # This API is always audit-safe. The process will still retain the deprecated + # event, though it will be ignored for billing calculations. For auditing and data + # fidelity purposes, Orb never overwrites or permanently deletes ingested usage + # data. + # + # ## Request validation + # + # - Orb does not accept an `idempotency_key` with the event in this endpoint, + # since this request is by design idempotent. On retryable errors, you should + # retry the request and assume the deprecation operation has not succeeded until + # receipt of a 2xx. + # - The event's `timestamp` must fall within the customer's current subscription's + # billing period, or within the grace period of the customer's current + # subscription's previous billing period. Orb does not allow deprecating events + # for billing periods that have already invoiced customers. + # - The `customer_id` or the `external_customer_id` of the original event + # ingestion request must identify a Customer resource within Orb, even if this + # event was ingested during the initial integration period. We do not allow + # deprecating events for customers not in the Orb system. + # - By default, no more than 100 events can be deprecated for a single customer in + # a 100 day period. For higher volume updates, consider using the + # [event backfill](create-backfill) endpoint. + # + # @param event_id [String] + # + # @param params [Orb::Models::EventDeprecateParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::EventDeprecateResponse] + # + def deprecate(event_id, params = {}) + @client.request( + method: :put, + path: ["events/%0s/deprecate", event_id], + model: Orb::Models::EventDeprecateResponse, + options: params[:request_options] + ) + end + + # Orb's event ingestion model and API is designed around two core principles: + # + # 1. **Data fidelity**: The accuracy of your billing model depends on a robust + # foundation of events. Orb's API protocol encourages usage patterns that + # ensure that your data is consistently complete and correct. + # 2. **Fast integration**: Sending events into Orb requires no tedious setup steps + # or explicit field schema for your event shape, making it instant to start + # streaming in usage in real-time. + # + # ## Event shape + # + # Events are the starting point for all usage calculations in the system, and are + # simple at their core: + # + # ```ts + # { + # // customer_id and external_customer_id are used to + # // attribute usage to a given Customer. Exactly one of these + # // should be specified in a given ingestion event. + # + # // `customer_id` is the Orb generated identifier for the Customer, + # // which is returned from the Create customer API call. + # customer_id: string, + # + # // external_customer_id is an alternate identifier which is associated + # // with a Customer at creation time. This is treated as an alias for + # // customer_id, and is usually set to an identifier native to your system. + # external_customer_id: string, + # + # // A string name identifying the event, usually a usage + # // action. By convention, this should not contain any whitespace. + # event_name: string, + # + # // An ISO 8601 format date with no timezone offset. + # // This should represent the time that usage occurred + # // and is important to attribute usage to a given + # // billing period. See the notes below on determining the timestamp. + # // e.g. 2020-12-09T16:09:53Z + # timestamp: string, + # + # // A unique value, generated by the client, that is + # // used to de-duplicate events. + # // Exactly one event with a given + # // idempotency key will be ingested, which allows for + # // safe request retries. + # idempotency_key: string + # + # // Optional custom metadata to attach to the event. + # // This might include a numeric value used for aggregation, + # // or a string/boolean value used for filtering. + # // The schema of this dictionary need not be pre-declared, and + # // properties can be added at any time. + # properties: { + # [key: string]?: string | number | boolean, + # }, + # } + # ``` + # + # ## Required fields + # + # Because events streamed to Orb are meant to be as flexible as possible, there + # are only a few required fields in every event. + # + # - We recommend that `idempotency_key` are unique strings that you generated with + # V4 UUIDs, but only require that they uniquely identify an event (i.e. don’t + # collide). + # - The `timestamp` field in the event body will be used to determine which + # billable period a given event falls into. For example, with a monthly billing + # cycle starting from the first of December, Orb will calculate metrics based on + # events that fall into the range + # `12-01 00:00:00 <= timestamp < 01-01 00:00:00`. + # + # ## Logging metadata + # + # Orb allows tagging events with metadata using a flexible properties dictionary. + # Since Orb does not enforce a rigid schema for this field-set, key-value pairs + # can be added dynamically as your events evolve. + # + # This dictionary can be helpful for a wide variety of use cases: + # + # - Numeric properties on events like `compute_time_ms` can later be inputs to our + # flexible query engine to determine usage. + # - Logging a region or cluster with each event can help you provide customers + # more granular visibility into their usage. + # + # We encourage logging this metadata with an eye towards future use cases to + # ensure full coverage for historical data. The datatype of the value in the + # properties dictionary is important for metric creation from an event source. + # Values that you wish to numerically aggregate should be of numeric type in the + # event. + # + # ## Determining event timestamp + # + # For cases where usage is being reported in real time as it is occurring, + # timestamp should correspond to the time that usage occurred. + # + # In cases where usage is reported in aggregate for a historical timeframe at a + # regular interval, we recommend setting the event `timestamp` to the midpoint of + # the interval. As an example, if you have an hourly reporter that sends data once + # an hour for the previous hour of usage, setting the `timestamp` to the half-hour + # mark will ensure that the usage is counted within the correct period. + # + # Note that other time-related fields (e.g. time elapsed) can be added to the + # properties dictionary as necessary. + # + # In cases where usage is reported in aggregate for a historical timeframe, the + # timestamp must be within the grace period set for your account. Events with + # `timestamp < current_time - grace_period` will not be accepted as a valid event, + # and will throw validation errors. Enforcing the grace period enables Orb to + # accurately map usage to the correct billing cycle and ensure that all usage is + # billed for in the corresponding billing period. + # + # In general, Orb does not expect events with future dated timestamps. In cases + # where the timestamp is at least 24 hours ahead of the current time, the event + # will not be accepted as a valid event, and will throw validation errors. + # + # ## Event validation + # + # Orb’s validation ensures that you recognize errors in your events as quickly as + # possible, and the API provides informative error messages to help you fix + # problems quickly. + # + # We validate the following: + # + # - Exactly one of `customer_id` and `external_customer_id` should be specified. + # - If the `customer_id` is specified, the customer in Orb must exist. + # - If the `external_customer_id` is specified, the customer in Orb does not need + # to exist. Events will be attributed to any future customers with the + # `external_customer_id` on subscription creation. + # - `timestamp` must conform to ISO 8601 and represent a timestamp at most 1 hour + # in the future. This timestamp should be sent in UTC timezone (no timezone + # offset). + # + # ## Idempotency and retry semantics + # + # Orb's idempotency guarantees allow you to implement safe retry logic in the + # event of network or machine failures, ensuring data fidelity. Each event in the + # request payload is associated with an idempotency key, and Orb guarantees that a + # single idempotency key will be successfully ingested at most once. Note that + # when Orb encounters events with duplicate idempotency keys and differing event + # bodies in a batch of events, the entire batch will be rejected. + # + # - Successful responses return a 200 HTTP status code. The response contains + # information about previously processed events. + # - Requests that return a `4xx` HTTP status code indicate a payload error and + # contain at least one event with a validation failure. An event with a + # validation failure can be re-sent to the ingestion endpoint (after the payload + # is fixed) with the original idempotency key since that key is not marked as + # processed. + # - Requests that return a `5xx` HTTP status code indicate a server-side failure. + # These requests should be retried in their entirety. + # + # ## API usage and limits + # + # The ingestion API is designed made for real-time streaming ingestion and + # architected for high throughput. Even if events are later deemed unnecessary or + # filtered out, we encourage you to log them to Orb if they may be relevant to + # billing calculations in the future. + # + # To take advantage of the real-time features of the Orb platform and avoid any + # chance of dropped events by producers, we recommend reporting events to Orb + # frequently. Optionally, events can also be briefly aggregated at the source, as + # this API accepts an array of event bodies. + # + # Orb does not currently enforce a hard rate-limit for API usage or a maximum + # request payload size, but please give us a heads up if you’re changing either of + # these factors by an order of magnitude from initial setup. + # + # ## Testing in debug mode + # + # The ingestion API supports a debug mode, which returns additional verbose output + # to indicate which event idempotency keys were newly ingested or duplicates from + # previous requests. To enable this mode, mark `debug=true` as a query parameter. + # + # If `debug=true` is not specified, the response will only contain + # `validation_failed`. Orb will still honor the idempotency guarantees set + # [here](/events-and-metrics/event-ingestion#event-volume-and-concurrency) in all + # cases. + # + # We strongly recommend that you only use debug mode as part of testing your + # initial Orb integration. Once you're ready to switch to production, disable + # debug mode to take advantage of improved performance and maximal throughput. + # + # #### Example: ingestion response with `debug=true` + # + # ```json + # { + # "debug": { + # "duplicate": [], + # "ingested": ["B7E83HDMfJPAunXW", "SJs5DQJ3TnwSqEZE", "8SivfDsNKwCeAXim"] + # }, + # "validation_failed": [] + # } + # ``` + # + # #### Example: ingestion response with `debug=false` + # + # ```json + # { + # "validation_failed": [] + # } + # ``` + # + # @param params [Orb::Models::EventIngestParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :events Body param: + # + # @option params [String, nil] :backfill_id Query param: If this ingestion request is part of a backfill, this parameter + # ties the ingested events to the backfill + # + # @option params [Boolean] :debug Query param: Flag to enable additional debug information in the endpoint + # response + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::EventIngestResponse] + # + def ingest(params) + parsed, options = Orb::Models::EventIngestParams.dump_request(params) + query_params = [:backfill_id, :debug] + @client.request( + method: :post, + path: "ingest", + query: parsed.slice(*query_params), + body: parsed.except(*query_params), + model: Orb::Models::EventIngestResponse, + options: options + ) + end + + # This endpoint returns a filtered set of events for an account in a + # [paginated list format](/api-reference/pagination). + # + # Note that this is a `POST` endpoint rather than a `GET` endpoint because it + # employs a JSON body for search criteria rather than query parameters, allowing + # for a more flexible search syntax. + # + # Note that a search criteria _must_ be specified. Currently, Orb supports the + # following criteria: + # + # - `event_ids`: This is an explicit array of IDs to filter by. Note that an + # event's ID is the `idempotency_key` that was originally used for ingestion. + # + # By default, Orb will not throw a `404` if no events matched, Orb will return an + # empty array for `data` instead. + # + # @param params [Orb::Models::EventSearchParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :event_ids This is an explicit array of IDs to filter by. Note that an event's ID is the + # idempotency_key that was originally used for ingestion, and this only supports + # events that have not been amended. Values in this array will be treated case + # sensitively. + # + # @option params [Time, nil] :timeframe_end The end of the timeframe, exclusive, in which to search events. If not + # specified, the current time is used. + # + # @option params [Time, nil] :timeframe_start The start of the timeframe, inclusive, in which to search events. If not + # specified, the one week ago is used. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::EventSearchResponse] + # + def search(params) + parsed, options = Orb::Models::EventSearchParams.dump_request(params) + @client.request( + method: :post, + path: "events/search", + body: parsed, + model: Orb::Models::EventSearchResponse, + options: options + ) + end + + # @param client [Orb::Client] + # + def initialize(client:) + @client = client + @backfills = Orb::Resources::Events::Backfills.new(client: client) + @volume = Orb::Resources::Events::Volume.new(client: client) + end + end + end +end diff --git a/lib/orb/resources/events/backfills.rb b/lib/orb/resources/events/backfills.rb index fb19ee2a..b77c0763 100644 --- a/lib/orb/resources/events/backfills.rb +++ b/lib/orb/resources/events/backfills.rb @@ -1,84 +1,186 @@ -require "orb/model" -require "orb/models/backfill_close_response" -require "orb/models/backfill_create_response" -require "orb/models/backfill_fetch_response" -require "orb/models/backfill_list_response" -require "orb/models/backfill_revert_response" -require "orb/pagination" +# frozen_string_literal: true + module Orb module Resources - module Events - class BackfillListResponsePage < Page - required :data, Orb::ArrayOf.new(Orb::Models::BackfillListResponse) - end - - class BackfillsResource - attr_reader - def initialize(client:) - @client = client - end - def create( - timeframe_end: Orb::NotGiven.instance, - timeframe_start: Orb::NotGiven.instance, - close_time: Orb::NotGiven.instance, - customer_id: Orb::NotGiven.instance, - external_customer_id: Orb::NotGiven.instance, - replace_existing_events: Orb::NotGiven.instance - ) - request = { + class Events + class Backfills + # Creating the backfill enables adding or replacing past events, even those that + # are older than the ingestion grace period. Performing a backfill in Orb involves + # 3 steps: + # + # 1. Create the backfill, specifying its parameters. + # 2. [Ingest](ingest) usage events, referencing the backfill (query parameter + # `backfill_id`). + # 3. [Close](close-backfill) the backfill, propagating the update in past usage + # throughout Orb. + # + # Changes from a backfill are not reflected until the backfill is closed, so you + # won’t need to worry about your customers seeing partially updated usage data. + # Backfills are also reversible, so you’ll be able to revert a backfill if you’ve + # made a mistake. + # + # This endpoint will return a backfill object, which contains an `id`. That `id` + # can then be used as the `backfill_id` query parameter to the event ingestion + # endpoint to associate ingested events with this backfill. The effects (e.g. + # updated usage graphs) of this backfill will not take place until the backfill is + # closed. + # + # If the `replace_existing_events` is `true`, existing events in the backfill's + # timeframe will be replaced with the newly ingested events associated with the + # backfill. If `false`, newly ingested events will be added to the existing + # events. + # + # If a `customer_id` or `external_customer_id` is specified, the backfill will + # only affect events for that customer. If neither is specified, the backfill will + # affect all customers. + # + # When `replace_existing_events` is `true`, this indicates that existing events in + # the timeframe should no longer be counted towards invoiced usage. In this + # scenario, the parameter `filter` can be optionally added which enables filtering + # using + # [computed properties](/extensibility/advanced-metrics#computed-properties). The + # expressiveness of computed properties allows you to deprecate existing events + # based on both a period of time and specific property values. + # + # @param params [Orb::Models::Events::BackfillCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :timeframe_end The (exclusive) end of the usage timeframe affected by this backfill. + # + # @option params [Time] :timeframe_start The (inclusive) start of the usage timeframe affected by this backfill. + # + # @option params [Time, nil] :close_time The time at which no more events will be accepted for this backfill. The + # backfill will automatically begin reflecting throughout Orb at the close time. + # If not specified, it will default to 1 day after the creation of the backfill. + # + # @option params [String, nil] :customer_id The Orb-generated ID of the customer to which this backfill is scoped. Omitting + # this field will scope the backfill to all customers. + # + # @option params [String, nil] :deprecation_filter A boolean + # [computed property](/extensibility/advanced-metrics#computed-properties) used to + # filter the set of events to deprecate + # + # @option params [String, nil] :external_customer_id The external customer ID of the customer to which this backfill is scoped. + # Omitting this field will scope the backfill to all customers. + # + # @option params [Boolean] :replace_existing_events If true, replaces all existing events in the timeframe with the newly ingested + # events. If false, adds the newly ingested events to the existing events. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Events::BackfillCreateResponse] + # + def create(params) + parsed, options = Orb::Models::Events::BackfillCreateParams.dump_request(params) + @client.request( method: :post, - path: "/events/backfills", - body: { - timeframe_end: timeframe_end, - timeframe_start: timeframe_start, - close_time: close_time, - customer_id: customer_id, - external_customer_id: external_customer_id, - replace_existing_events: replace_existing_events - }, - query: nil - } - - @client.request(model: Orb::Models::BackfillCreateResponse, **request) + path: "events/backfills", + body: parsed, + model: Orb::Models::Events::BackfillCreateResponse, + options: options + ) end - def list(cursor: Orb::NotGiven.instance, limit: Orb::NotGiven.instance) - request = { - method: :get, - path: "/events/backfills", - query: { - cursor: cursor, - limit: limit - } - } - @client.request(page: BackfillListResponsePage, **request) + # This endpoint returns a list of all backfills in a list format. + # + # The list of backfills is ordered starting from the most recently created + # backfill. The response also includes + # [`pagination_metadata`](/api-reference/pagination), which lets the caller + # retrieve the next page of results if they exist. More information about + # pagination can be found in the [Pagination-metadata schema](pagination). + # + # @param params [Orb::Models::Events::BackfillListParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(params = {}) + parsed, options = Orb::Models::Events::BackfillListParams.dump_request(params) + @client.request( + method: :get, + path: "events/backfills", + query: parsed, + page: Orb::Page, + model: Orb::Models::Events::BackfillListResponse, + options: options + ) end - def close(backfill_id) - request = { - method: :post, - path: "/events/backfills/#{backfill_id}/close", - query: nil - } - @client.request(model: Orb::Models::BackfillCloseResponse, **request) + # Closing a backfill makes the updated usage visible in Orb. Upon closing a + # backfill, Orb will asynchronously reflect the updated usage in invoice amounts + # and usage graphs. Once all of the updates are complete, the backfill's status + # will transition to `reflected`. + # + # @param backfill_id [String] + # + # @param params [Orb::Models::Events::BackfillCloseParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Events::BackfillCloseResponse] + # + def close(backfill_id, params = {}) + @client.request( + method: :post, + path: ["events/backfills/%0s/close", backfill_id], + model: Orb::Models::Events::BackfillCloseResponse, + options: params[:request_options] + ) end - def fetch(backfill_id) - request = { - method: :get, - path: "/events/backfills/#{backfill_id}", - query: nil - } - @client.request(model: Orb::Models::BackfillFetchResponse, **request) + # This endpoint is used to fetch a backfill given an identifier. + # + # @param backfill_id [String] + # + # @param params [Orb::Models::Events::BackfillFetchParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Events::BackfillFetchResponse] + # + def fetch(backfill_id, params = {}) + @client.request( + method: :get, + path: ["events/backfills/%0s", backfill_id], + model: Orb::Models::Events::BackfillFetchResponse, + options: params[:request_options] + ) end - def revert(backfill_id) - request = { + + # Reverting a backfill undoes all the effects of closing the backfill. If the + # backfill is reflected, the status will transition to `pending_revert` while the + # effects of the backfill are undone. Once all effects are undone, the backfill + # will transition to `reverted`. + # + # If a backfill is reverted before its closed, no usage will be updated as a + # result of the backfill and it will immediately transition to `reverted`. + # + # @param backfill_id [String] + # + # @param params [Orb::Models::Events::BackfillRevertParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Events::BackfillRevertResponse] + # + def revert(backfill_id, params = {}) + @client.request( method: :post, - path: "/events/backfills/#{backfill_id}/revert", - query: nil - } + path: ["events/backfills/%0s/revert", backfill_id], + model: Orb::Models::Events::BackfillRevertResponse, + options: params[:request_options] + ) + end - @client.request(model: Orb::Models::BackfillRevertResponse, **request) + # @param client [Orb::Client] + # + def initialize(client:) + @client = client end end end diff --git a/lib/orb/resources/events/events.rb b/lib/orb/resources/events/events.rb deleted file mode 100644 index d0c96eaa..00000000 --- a/lib/orb/resources/events/events.rb +++ /dev/null @@ -1,81 +0,0 @@ -require "orb/model" -require "orb/models/event_deprecate_response" -require "orb/models/event_ingest_response" -require "orb/models/event_search_response" -require "orb/models/event_update_response" -require "orb/resources/events/backfills" -module Orb - module Resources - class EventsResource - attr_reader :backfills - def initialize(client:) - @client = client - @backfills = - Orb::Resources::Events::BackfillsResource.new(client: client) - end - def update( - event_id, - event_name: Orb::NotGiven.instance, - properties: Orb::NotGiven.instance, - timestamp: Orb::NotGiven.instance, - customer_id: Orb::NotGiven.instance, - external_customer_id: Orb::NotGiven.instance - ) - request = { - method: :put, - path: "/events/#{event_id}", - body: { - event_name: event_name, - properties: properties, - timestamp: timestamp, - customer_id: customer_id, - external_customer_id: external_customer_id - }, - query: nil - } - - @client.request(model: Orb::Models::EventUpdateResponse, **request) - end - def deprecate(event_id) - request = { - method: :put, - path: "/events/#{event_id}/deprecate", - query: nil - } - - @client.request(model: Orb::Models::EventDeprecateResponse, **request) - end - def ingest( - events: Orb::NotGiven.instance, - backfill_id: Orb::NotGiven.instance, - debug: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/ingest", - body: { - events: events - }, - query: { - backfill_id: backfill_id, - debug: debug - } - } - - @client.request(model: Orb::Models::EventIngestResponse, **request) - end - def search(event_ids: Orb::NotGiven.instance) - request = { - method: :post, - path: "/events/search", - body: { - event_ids: event_ids - }, - query: nil - } - - @client.request(model: Orb::Models::EventSearchResponse, **request) - end - end - end -end diff --git a/lib/orb/resources/events/volume.rb b/lib/orb/resources/events/volume.rb new file mode 100644 index 00000000..2fee7910 --- /dev/null +++ b/lib/orb/resources/events/volume.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +module Orb + module Resources + class Events + class Volume + # This endpoint returns the event volume for an account in a + # [paginated list format](/api-reference/pagination). + # + # The event volume is aggregated by the hour and the + # [timestamp](/api-reference/event/ingest-events) field is used to determine which + # hour an event is associated with. Note, this means that late-arriving events + # increment the volume count for the hour window the timestamp is in, not the + # latest hour window. + # + # Each item in the response contains the count of events aggregated by the hour + # where the start and end time are hour-aligned and in UTC. When a specific + # timestamp is passed in for either start or end time, the response includes the + # hours the timestamp falls in. + # + # @param params [Orb::Models::Events::VolumeListParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :timeframe_start The start of the timeframe, inclusive, in which to return event volume. All + # datetime values are converted to UTC time. If the specified time isn't + # hour-aligned, the response includes the event volume count for the hour the time + # falls in. + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Time] :timeframe_end The end of the timeframe, exclusive, in which to return event volume. If not + # specified, the current time is used. All datetime values are converted to UTC + # time.If the specified time isn't hour-aligned, the response includes the event + # volumecount for the hour the time falls in. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Events::EventVolumes] + # + def list(params) + parsed, options = Orb::Models::Events::VolumeListParams.dump_request(params) + @client.request( + method: :get, + path: "events/volume", + query: parsed, + model: Orb::Models::Events::EventVolumes, + options: options + ) + end + + # @param client [Orb::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/orb/resources/invoice_line_items.rb b/lib/orb/resources/invoice_line_items.rb index d9a0b3bf..8de06d0f 100644 --- a/lib/orb/resources/invoice_line_items.rb +++ b/lib/orb/resources/invoice_line_items.rb @@ -1,39 +1,46 @@ -require "orb/model" -require "orb/models/invoice_line_item_create_response" +# frozen_string_literal: true + module Orb module Resources - class InvoiceLineItemsResource - attr_reader - def initialize(client:) - @client = client - end - def create( - amount: Orb::NotGiven.instance, - end_date: Orb::NotGiven.instance, - invoice_id: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - quantity: Orb::NotGiven.instance, - start_date: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/invoice_line_items", - body: { - amount: amount, - end_date: end_date, - invoice_id: invoice_id, - name: name, - quantity: quantity, - start_date: start_date - }, - query: nil - } - + class InvoiceLineItems + # This creates a one-off fixed fee invoice line item on an Invoice. This can only + # be done for invoices that are in a `draft` status. + # + # @param params [Orb::Models::InvoiceLineItemCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :amount The total amount in the invoice's currency to add to the line item. + # + # @option params [Date] :end_date A date string to specify the line item's end date in the customer's timezone. + # + # @option params [String] :invoice_id The id of the Invoice to add this line item. + # + # @option params [String] :name The item name associated with this line item. If an item with the same name + # exists in Orb, that item will be associated with the line item. + # + # @option params [Float] :quantity The number of units on the line item + # + # @option params [Date] :start_date A date string to specify the line item's start date in the customer's timezone. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::InvoiceLineItemCreateResponse] + # + def create(params) + parsed, options = Orb::Models::InvoiceLineItemCreateParams.dump_request(params) @client.request( + method: :post, + path: "invoice_line_items", + body: parsed, model: Orb::Models::InvoiceLineItemCreateResponse, - **request + options: options ) end + + # @param client [Orb::Client] + # + def initialize(client:) + @client = client + end end end end diff --git a/lib/orb/resources/invoices.rb b/lib/orb/resources/invoices.rb index 457e6f28..36e58ebf 100644 --- a/lib/orb/resources/invoices.rb +++ b/lib/orb/resources/invoices.rb @@ -1,150 +1,312 @@ -require "orb/model" -require "orb/models/invoice" -require "orb/models/invoice_fetch_upcoming_response" -require "orb/pagination" +# frozen_string_literal: true + module Orb module Resources - class InvoicePage < Page - required :data, Orb::ArrayOf.new(Orb::Models::Invoice) - end - - class InvoicesResource - attr_reader - def initialize(client:) - @client = client - end - def create( - currency: Orb::NotGiven.instance, - invoice_date: Orb::NotGiven.instance, - line_items: Orb::NotGiven.instance, - net_terms: Orb::NotGiven.instance, - customer_id: Orb::NotGiven.instance, - external_customer_id: Orb::NotGiven.instance, - memo: Orb::NotGiven.instance, - will_auto_issue: Orb::NotGiven.instance - ) - request = { + class Invoices + # This endpoint is used to create a one-off invoice for a customer. + # + # @param params [Orb::Models::InvoiceCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :currency An ISO 4217 currency string. Must be the same as the customer's currency if it + # is set. + # + # @option params [Time] :invoice_date Optional invoice date to set. Must be in the past, if not set, `invoice_date` is + # set to the current time in the customer's timezone. + # + # @option params [Array] :line_items + # + # @option params [Integer] :net_terms Determines the difference between the invoice issue date for subscription + # invoices as the date that they are due. A value of '0' here represents that the + # invoice is due on issue, whereas a value of 30 represents that the customer has + # 30 days to pay the invoice. + # + # @option params [String, nil] :customer_id The id of the `Customer` to create this invoice for. One of `customer_id` and + # `external_customer_id` are required. + # + # @option params [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::Discount::UsageDiscount, Orb::Models::AmountDiscount, nil] :discount An optional discount to attach to the invoice. + # + # @option params [String, nil] :external_customer_id The `external_customer_id` of the `Customer` to create this invoice for. One of + # `customer_id` and `external_customer_id` are required. + # + # @option params [String, nil] :memo An optional memo to attach to the invoice. + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [Boolean] :will_auto_issue When true, this invoice will automatically be issued upon creation. When false, + # the resulting invoice will require manual review to issue. Defaulted to false. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Invoice] + # + def create(params) + parsed, options = Orb::Models::InvoiceCreateParams.dump_request(params) + @client.request( method: :post, - path: "/invoices", - body: { - currency: currency, - invoice_date: invoice_date, - line_items: line_items, - net_terms: net_terms, - customer_id: customer_id, - external_customer_id: external_customer_id, - memo: memo, - will_auto_issue: will_auto_issue - }, - query: nil - } - - @client.request(model: Orb::Models::Invoice, **request) + path: "invoices", + body: parsed, + model: Orb::Models::Invoice, + options: options + ) end - def list( - amount: Orb::NotGiven.instance, - amount_gt: Orb::NotGiven.instance, - amount_lt: Orb::NotGiven.instance, - cursor: Orb::NotGiven.instance, - customer_id: Orb::NotGiven.instance, - date_type: Orb::NotGiven.instance, - due_date: Orb::NotGiven.instance, - due_date_window: Orb::NotGiven.instance, - due_date_gt: Orb::NotGiven.instance, - due_date_lt: Orb::NotGiven.instance, - external_customer_id: Orb::NotGiven.instance, - invoice_date_gt: Orb::NotGiven.instance, - invoice_date_gte: Orb::NotGiven.instance, - invoice_date_lt: Orb::NotGiven.instance, - invoice_date_lte: Orb::NotGiven.instance, - is_recurring: Orb::NotGiven.instance, - limit: Orb::NotGiven.instance, - status: Orb::NotGiven.instance, - subscription_id: Orb::NotGiven.instance - ) - request = { - method: :get, - path: "/invoices", - query: { - amount: amount, - "amount[gt]": amount_gt, - "amount[lt]": amount_lt, - cursor: cursor, - customer_id: customer_id, - date_type: date_type, - due_date: due_date, - due_date_window: due_date_window, - "due_date[gt]": due_date_gt, - "due_date[lt]": due_date_lt, - external_customer_id: external_customer_id, - "invoice_date[gt]": invoice_date_gt, - "invoice_date[gte]": invoice_date_gte, - "invoice_date[lt]": invoice_date_lt, - "invoice_date[lte]": invoice_date_lte, - is_recurring: is_recurring, - limit: limit, - "status[]": status, - subscription_id: subscription_id - } - } - @client.request(page: InvoicePage, **request) + # This endpoint allows you to update the `metadata` property on an invoice. If you + # pass null for the metadata value, it will clear any existing metadata for that + # invoice. + # + # `metadata` can be modified regardless of invoice state. + # + # @param invoice_id [String] + # + # @param params [Orb::Models::InvoiceUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Invoice] + # + def update(invoice_id, params = {}) + parsed, options = Orb::Models::InvoiceUpdateParams.dump_request(params) + @client.request( + method: :put, + path: ["invoices/%0s", invoice_id], + body: parsed, + model: Orb::Models::Invoice, + options: options + ) end - def fetch(invoice_id) - request = { method: :get, path: "/invoices/#{invoice_id}", query: nil } - @client.request(model: Orb::Models::Invoice, **request) + # This endpoint returns a list of all [`Invoice`](/core-concepts#invoice)s for an + # account in a list format. + # + # The list of invoices is ordered starting from the most recently issued invoice + # date. The response also includes + # [`pagination_metadata`](/api-reference/pagination), which lets the caller + # retrieve the next page of results if they exist. + # + # By default, this only returns invoices that are `issued`, `paid`, or `synced`. + # + # When fetching any `draft` invoices, this returns the last-computed invoice + # values for each draft invoice, which may not always be up-to-date since Orb + # regularly refreshes invoices asynchronously. + # + # @param params [Orb::Models::InvoiceListParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :amount + # + # @option params [String, nil] :amount_gt + # + # @option params [String, nil] :amount_lt + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [String, nil] :customer_id + # + # @option params [Symbol, Orb::Models::InvoiceListParams::DateType, nil] :date_type + # + # @option params [Date, nil] :due_date + # + # @option params [String, nil] :due_date_window Filters invoices by their due dates within a specific time range in the past. + # Specify the range as a number followed by 'd' (days) or 'm' (months). For + # example, '7d' filters invoices due in the last 7 days, and '2m' filters those + # due in the last 2 months. + # + # @option params [Date, nil] :due_date_gt + # + # @option params [Date, nil] :due_date_lt + # + # @option params [String, nil] :external_customer_id + # + # @option params [Time, nil] :invoice_date_gt + # + # @option params [Time, nil] :invoice_date_gte + # + # @option params [Time, nil] :invoice_date_lt + # + # @option params [Time, nil] :invoice_date_lte + # + # @option params [Boolean, nil] :is_recurring + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Array, nil] :status + # + # @option params [String, nil] :subscription_id + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(params = {}) + parsed, options = Orb::Models::InvoiceListParams.dump_request(params) + @client.request( + method: :get, + path: "invoices", + query: parsed, + page: Orb::Page, + model: Orb::Models::Invoice, + options: options + ) end - def fetch_upcoming(subscription_id: Orb::NotGiven.instance) - request = { + + # This endpoint is used to fetch an [`Invoice`](/core-concepts#invoice) given an + # identifier. + # + # @param invoice_id [String] + # + # @param params [Orb::Models::InvoiceFetchParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Invoice] + # + def fetch(invoice_id, params = {}) + @client.request( method: :get, - path: "/invoices/upcoming", - query: { - subscription_id: subscription_id - } - } + path: ["invoices/%0s", invoice_id], + model: Orb::Models::Invoice, + options: params[:request_options] + ) + end + # This endpoint can be used to fetch the upcoming + # [invoice](/core-concepts#invoice) for the current billing period given a + # subscription. + # + # @param params [Orb::Models::InvoiceFetchUpcomingParams, Hash{Symbol=>Object}] . + # + # @option params [String] :subscription_id + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::InvoiceFetchUpcomingResponse] + # + def fetch_upcoming(params) + parsed, options = Orb::Models::InvoiceFetchUpcomingParams.dump_request(params) @client.request( + method: :get, + path: "invoices/upcoming", + query: parsed, model: Orb::Models::InvoiceFetchUpcomingResponse, - **request + options: options ) end - def issue(invoice_id) - request = { - method: :post, - path: "/invoices/#{invoice_id}/issue", - query: nil - } - @client.request(model: Orb::Models::Invoice, **request) + # This endpoint allows an eligible invoice to be issued manually. This is only + # possible with invoices where status is `draft`, `will_auto_issue` is false, and + # an `eligible_to_issue_at` is a time in the past. Issuing an invoice could + # possibly trigger side effects, some of which could be customer-visible (e.g. + # sending emails, auto-collecting payment, syncing the invoice to external + # providers, etc). + # + # @param invoice_id [String] + # + # @param params [Orb::Models::InvoiceIssueParams, Hash{Symbol=>Object}] . + # + # @option params [Boolean] :synchronous If true, the invoice will be issued synchronously. If false, the invoice will be + # issued asynchronously. The synchronous option is only available for invoices + # that have no usage fees. If the invoice is configured to sync to an external + # provider, a successful response from this endpoint guarantees the invoice is + # present in the provider. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Invoice] + # + def issue(invoice_id, params = {}) + parsed, options = Orb::Models::InvoiceIssueParams.dump_request(params) + @client.request( + method: :post, + path: ["invoices/%0s/issue", invoice_id], + body: parsed, + model: Orb::Models::Invoice, + options: options + ) end - def mark_paid( - invoice_id, - external_id: Orb::NotGiven.instance, - notes: Orb::NotGiven.instance, - payment_received_date: Orb::NotGiven.instance - ) - request = { + + # This endpoint allows an invoice's status to be set the `paid` status. This can + # only be done to invoices that are in the `issued` status. + # + # @param invoice_id [String] + # + # @param params [Orb::Models::InvoiceMarkPaidParams, Hash{Symbol=>Object}] . + # + # @option params [Date] :payment_received_date A date string to specify the date of the payment. + # + # @option params [String, nil] :external_id An optional external ID to associate with the payment. + # + # @option params [String, nil] :notes An optional note to associate with the payment. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Invoice] + # + def mark_paid(invoice_id, params) + parsed, options = Orb::Models::InvoiceMarkPaidParams.dump_request(params) + @client.request( method: :post, - path: "/invoices/#{invoice_id}/mark_paid", - body: { - external_id: external_id, - notes: notes, - payment_received_date: payment_received_date - }, - query: nil - } + path: ["invoices/%0s/mark_paid", invoice_id], + body: parsed, + model: Orb::Models::Invoice, + options: options + ) + end - @client.request(model: Orb::Models::Invoice, **request) + # This endpoint collects payment for an invoice using the customer's default + # payment method. This action can only be taken on invoices with status "issued". + # + # @param invoice_id [String] + # + # @param params [Orb::Models::InvoicePayParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Invoice] + # + def pay(invoice_id, params = {}) + @client.request( + method: :post, + path: ["invoices/%0s/pay", invoice_id], + model: Orb::Models::Invoice, + options: params[:request_options] + ) end - def void(invoice_id) - request = { + + # This endpoint allows an invoice's status to be set the `void` status. This can + # only be done to invoices that are in the `issued` status. + # + # If the associated invoice has used the customer balance to change the amount + # due, the customer balance operation will be reverted. For example, if the + # invoice used $10 of customer balance, that amount will be added back to the + # customer balance upon voiding. + # + # @param invoice_id [String] + # + # @param params [Orb::Models::InvoiceVoidParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Invoice] + # + def void(invoice_id, params = {}) + @client.request( method: :post, - path: "/invoices/#{invoice_id}/void", - query: nil - } + path: ["invoices/%0s/void", invoice_id], + model: Orb::Models::Invoice, + options: params[:request_options] + ) + end - @client.request(model: Orb::Models::Invoice, **request) + # @param client [Orb::Client] + # + def initialize(client:) + @client = client end end end diff --git a/lib/orb/resources/items.rb b/lib/orb/resources/items.rb index e9d18fc4..72dd98b6 100644 --- a/lib/orb/resources/items.rb +++ b/lib/orb/resources/items.rb @@ -1,45 +1,103 @@ -require "orb/model" -require "orb/models/item" -require "orb/pagination" +# frozen_string_literal: true + module Orb module Resources - class ItemPage < Page - required :data, Orb::ArrayOf.new(Orb::Models::Item) - end - - class ItemsResource - attr_reader - def initialize(client:) - @client = client - end - def create(name: Orb::NotGiven.instance) - request = { + class Items + # This endpoint is used to create an [Item](/core-concepts#item). + # + # @param params [Orb::Models::ItemCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :name The name of the item. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Item] + # + def create(params) + parsed, options = Orb::Models::ItemCreateParams.dump_request(params) + @client.request( method: :post, - path: "/items", - body: { - name: name - }, - query: nil - } + path: "items", + body: parsed, + model: Orb::Models::Item, + options: options + ) + end - @client.request(model: Orb::Models::Item, **request) + # This endpoint can be used to update properties on the Item. + # + # @param item_id [String] + # + # @param params [Orb::Models::ItemUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Array, nil] :external_connections + # + # @option params [String, nil] :name + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Item] + # + def update(item_id, params = {}) + parsed, options = Orb::Models::ItemUpdateParams.dump_request(params) + @client.request( + method: :put, + path: ["items/%0s", item_id], + body: parsed, + model: Orb::Models::Item, + options: options + ) end - def list(cursor: Orb::NotGiven.instance, limit: Orb::NotGiven.instance) - request = { + + # This endpoint returns a list of all Items, ordered in descending order by + # creation time. + # + # @param params [Orb::Models::ItemListParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(params = {}) + parsed, options = Orb::Models::ItemListParams.dump_request(params) + @client.request( method: :get, - path: "/items", - query: { - cursor: cursor, - limit: limit - } - } + path: "items", + query: parsed, + page: Orb::Page, + model: Orb::Models::Item, + options: options + ) + end - @client.request(page: ItemPage, **request) + # This endpoint returns an item identified by its item_id. + # + # @param item_id [String] + # + # @param params [Orb::Models::ItemFetchParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Item] + # + def fetch(item_id, params = {}) + @client.request( + method: :get, + path: ["items/%0s", item_id], + model: Orb::Models::Item, + options: params[:request_options] + ) end - def fetch(item_id) - request = { method: :get, path: "/items/#{item_id}", query: nil } - @client.request(model: Orb::Models::Item, **request) + # @param client [Orb::Client] + # + def initialize(client:) + @client = client end end end diff --git a/lib/orb/resources/metrics.rb b/lib/orb/resources/metrics.rb index 9c0a4e69..3244aa3b 100644 --- a/lib/orb/resources/metrics.rb +++ b/lib/orb/resources/metrics.rb @@ -1,68 +1,127 @@ -require "orb/model" -require "orb/models/metric_create_response" -require "orb/models/metric_fetch_response" -require "orb/models/metric_list_response" -require "orb/pagination" +# frozen_string_literal: true + module Orb module Resources - class MetricListResponsePage < Page - required :data, Orb::ArrayOf.new(Orb::Models::MetricListResponse) - end - - class MetricsResource - attr_reader - def initialize(client:) - @client = client - end - def create( - description: Orb::NotGiven.instance, - item_id: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - sql: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance - ) - request = { + class Metrics + # This endpoint is used to create a [metric](/core-concepts###metric) using a SQL + # string. See [SQL support](/extensibility/advanced-metrics#sql-support) for a + # description of constructing SQL queries with examples. + # + # @param params [Orb::Models::MetricCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :description A description of the metric. + # + # @option params [String] :item_id The id of the item + # + # @option params [String] :name The name of the metric. + # + # @option params [String] :sql A sql string defining the metric. + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::BillableMetric] + # + def create(params) + parsed, options = Orb::Models::MetricCreateParams.dump_request(params) + @client.request( method: :post, - path: "/metrics", - body: { - description: description, - item_id: item_id, - name: name, - sql: sql, - metadata: metadata - }, - query: nil - } + path: "metrics", + body: parsed, + model: Orb::Models::BillableMetric, + options: options + ) + end - @client.request(model: Orb::Models::MetricCreateResponse, **request) + # This endpoint allows you to update the `metadata` property on a metric. If you + # pass `null` for the metadata value, it will clear any existing metadata for that + # invoice. + # + # @param metric_id [String] + # + # @param params [Orb::Models::MetricUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::BillableMetric] + # + def update(metric_id, params = {}) + parsed, options = Orb::Models::MetricUpdateParams.dump_request(params) + @client.request( + method: :put, + path: ["metrics/%0s", metric_id], + body: parsed, + model: Orb::Models::BillableMetric, + options: options + ) end - def list( - created_at_gt: Orb::NotGiven.instance, - created_at_gte: Orb::NotGiven.instance, - created_at_lt: Orb::NotGiven.instance, - created_at_lte: Orb::NotGiven.instance, - cursor: Orb::NotGiven.instance, - limit: Orb::NotGiven.instance - ) - request = { + + # This endpoint is used to fetch [metric](/core-concepts##metric) details given a + # metric identifier. It returns information about the metrics including its name, + # description, and item. + # + # @param params [Orb::Models::MetricListParams, Hash{Symbol=>Object}] . + # + # @option params [Time, nil] :created_at_gt + # + # @option params [Time, nil] :created_at_gte + # + # @option params [Time, nil] :created_at_lt + # + # @option params [Time, nil] :created_at_lte + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(params = {}) + parsed, options = Orb::Models::MetricListParams.dump_request(params) + @client.request( method: :get, - path: "/metrics", - query: { - "created_at[gt]": created_at_gt, - "created_at[gte]": created_at_gte, - "created_at[lt]": created_at_lt, - "created_at[lte]": created_at_lte, - cursor: cursor, - limit: limit - } - } + path: "metrics", + query: parsed, + page: Orb::Page, + model: Orb::Models::BillableMetric, + options: options + ) + end - @client.request(page: MetricListResponsePage, **request) + # This endpoint is used to list [metrics](/core-concepts#metric). It returns + # information about the metrics including its name, description, and item. + # + # @param metric_id [String] + # + # @param params [Orb::Models::MetricFetchParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::BillableMetric] + # + def fetch(metric_id, params = {}) + @client.request( + method: :get, + path: ["metrics/%0s", metric_id], + model: Orb::Models::BillableMetric, + options: params[:request_options] + ) end - def fetch(metric_id) - request = { method: :get, path: "/metrics/#{metric_id}", query: nil } - @client.request(model: Orb::Models::MetricFetchResponse, **request) + # @param client [Orb::Client] + # + def initialize(client:) + @client = client end end end diff --git a/lib/orb/resources/plans.rb b/lib/orb/resources/plans.rb new file mode 100644 index 00000000..2ca6c7c6 --- /dev/null +++ b/lib/orb/resources/plans.rb @@ -0,0 +1,165 @@ +# frozen_string_literal: true + +module Orb + module Resources + class Plans + # @return [Orb::Resources::Plans::ExternalPlanID] + attr_reader :external_plan_id + + # This endpoint allows creation of plans including their prices. + # + # @param params [Orb::Models::PlanCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :currency An ISO 4217 currency string for invoices generated by subscriptions on this + # plan. + # + # @option params [String] :name + # + # @option params [Array] :prices Prices for this plan. If the plan has phases, this includes prices across all + # phases of the plan. + # + # @option params [String, nil] :default_invoice_memo Free-form text which is available on the invoice PDF and the Orb invoice portal. + # + # @option params [String, nil] :external_plan_id + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [Integer, nil] :net_terms The net terms determines the difference between the invoice date and the issue + # date for the invoice. If you intend the invoice to be due on issue, set this + # to 0. + # + # @option params [Symbol, Orb::Models::PlanCreateParams::Status] :status The status of the plan to create (either active or draft). If not specified, + # this defaults to active. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Plan] + # + def create(params) + parsed, options = Orb::Models::PlanCreateParams.dump_request(params) + @client.request( + method: :post, + path: "plans", + body: parsed, + model: Orb::Models::Plan, + options: options + ) + end + + # This endpoint can be used to update the `external_plan_id`, and `metadata` of an + # existing plan. + # + # Other fields on a customer are currently immutable. + # + # @param plan_id [String] + # + # @param params [Orb::Models::PlanUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :external_plan_id An optional user-defined ID for this plan resource, used throughout the system + # as an alias for this Plan. Use this field to identify a plan by an existing + # identifier in your system. + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Plan] + # + def update(plan_id, params = {}) + parsed, options = Orb::Models::PlanUpdateParams.dump_request(params) + @client.request( + method: :put, + path: ["plans/%0s", plan_id], + body: parsed, + model: Orb::Models::Plan, + options: options + ) + end + + # This endpoint returns a list of all [plans](/core-concepts#plan-and-price) for + # an account in a list format. The list of plans is ordered starting from the most + # recently created plan. The response also includes + # [`pagination_metadata`](/api-reference/pagination), which lets the caller + # retrieve the next page of results if they exist. + # + # @param params [Orb::Models::PlanListParams, Hash{Symbol=>Object}] . + # + # @option params [Time, nil] :created_at_gt + # + # @option params [Time, nil] :created_at_gte + # + # @option params [Time, nil] :created_at_lt + # + # @option params [Time, nil] :created_at_lte + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Symbol, Orb::Models::PlanListParams::Status] :status The plan status to filter to ('active', 'archived', or 'draft'). + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(params = {}) + parsed, options = Orb::Models::PlanListParams.dump_request(params) + @client.request( + method: :get, + path: "plans", + query: parsed, + page: Orb::Page, + model: Orb::Models::Plan, + options: options + ) + end + + # This endpoint is used to fetch [plan](/core-concepts#plan-and-price) details + # given a plan identifier. It returns information about the prices included in the + # plan and their configuration, as well as the product that the plan is attached + # to. + # + # ## Serialized prices + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given [Price](/core-concepts#plan-and-price) + # object. The `model_type` field determines the key for the configuration object + # that is present. A detailed explanation of price types can be found in the + # [Price schema](/core-concepts#plan-and-price). + # + # ## Phases + # + # Orb supports plan phases, also known as contract ramps. For plans with phases, + # the serialized prices refer to all prices across all phases. + # + # @param plan_id [String] + # + # @param params [Orb::Models::PlanFetchParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Plan] + # + def fetch(plan_id, params = {}) + @client.request( + method: :get, + path: ["plans/%0s", plan_id], + model: Orb::Models::Plan, + options: params[:request_options] + ) + end + + # @param client [Orb::Client] + # + def initialize(client:) + @client = client + @external_plan_id = Orb::Resources::Plans::ExternalPlanID.new(client: client) + end + end + end +end diff --git a/lib/orb/resources/plans/external_plan_id.rb b/lib/orb/resources/plans/external_plan_id.rb index 7e9e7414..d50c45d7 100644 --- a/lib/orb/resources/plans/external_plan_id.rb +++ b/lib/orb/resources/plans/external_plan_id.rb @@ -1,38 +1,79 @@ -require "orb/model" -require "orb/models/plan" +# frozen_string_literal: true + module Orb module Resources - module Plans - class ExternalPlanIDResource - attr_reader - def initialize(client:) - @client = client - end - def update( - other_external_plan_id, - external_plan_id: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance - ) - request = { + class Plans + class ExternalPlanID + # This endpoint can be used to update the `external_plan_id`, and `metadata` of an + # existing plan. + # + # Other fields on a customer are currently immutable. + # + # @param other_external_plan_id [String] + # + # @param params [Orb::Models::Plans::ExternalPlanIDUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :external_plan_id An optional user-defined ID for this plan resource, used throughout the system + # as an alias for this Plan. Use this field to identify a plan by an existing + # identifier in your system. + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Plan] + # + def update(other_external_plan_id, params = {}) + parsed, options = Orb::Models::Plans::ExternalPlanIDUpdateParams.dump_request(params) + @client.request( method: :put, - path: "/plans/external_plan_id/#{other_external_plan_id}", - body: { - external_plan_id: external_plan_id, - metadata: metadata - }, - query: nil - } - - @client.request(model: Orb::Models::Plan, **request) + path: ["plans/external_plan_id/%0s", other_external_plan_id], + body: parsed, + model: Orb::Models::Plan, + options: options + ) end - def fetch(external_plan_id) - request = { + + # This endpoint is used to fetch [plan](/core-concepts##plan-and-price) details + # given an external_plan_id identifier. It returns information about the prices + # included in the plan and their configuration, as well as the product that the + # plan is attached to. + # + # If multiple plans are found to contain the specified external_plan_id, the + # active plans will take priority over archived ones, and among those, the + # endpoint will return the most recently created plan. + # + # ## Serialized prices + # + # Orb supports a few different pricing models out of the box. Each of these models + # is serialized differently in a given [Price](/core-concepts#plan-and-price) + # object. The `model_type` field determines the key for the configuration object + # that is present. A detailed explanation of price types can be found in the + # [Price schema](/core-concepts#plan-and-price). " + # + # @param external_plan_id [String] + # + # @param params [Orb::Models::Plans::ExternalPlanIDFetchParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Plan] + # + def fetch(external_plan_id, params = {}) + @client.request( method: :get, - path: "/plans/external_plan_id/#{external_plan_id}", - query: nil - } + path: ["plans/external_plan_id/%0s", external_plan_id], + model: Orb::Models::Plan, + options: params[:request_options] + ) + end - @client.request(model: Orb::Models::Plan, **request) + # @param client [Orb::Client] + # + def initialize(client:) + @client = client end end end diff --git a/lib/orb/resources/plans/plans.rb b/lib/orb/resources/plans/plans.rb deleted file mode 100644 index 3266007e..00000000 --- a/lib/orb/resources/plans/plans.rb +++ /dev/null @@ -1,93 +0,0 @@ -require "orb/model" -require "orb/models/plan" -require "orb/pagination" -require "orb/resources/plans/external_plan_id" -module Orb - module Resources - class PlanPage < Page - required :data, Orb::ArrayOf.new(Orb::Models::Plan) - end - - class PlansResource - attr_reader :external_plan_id - def initialize(client:) - @client = client - @external_plan_id = - Orb::Resources::Plans::ExternalPlanIDResource.new(client: client) - end - def create( - currency: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - prices: Orb::NotGiven.instance, - default_invoice_memo: Orb::NotGiven.instance, - external_plan_id: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance, - net_terms: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/plans", - body: { - currency: currency, - name: name, - prices: prices, - default_invoice_memo: default_invoice_memo, - external_plan_id: external_plan_id, - metadata: metadata, - net_terms: net_terms - }, - query: nil - } - - @client.request(model: Orb::Models::Plan, **request) - end - def update( - plan_id, - external_plan_id: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance - ) - request = { - method: :put, - path: "/plans/#{plan_id}", - body: { - external_plan_id: external_plan_id, - metadata: metadata - }, - query: nil - } - - @client.request(model: Orb::Models::Plan, **request) - end - def list( - created_at_gt: Orb::NotGiven.instance, - created_at_gte: Orb::NotGiven.instance, - created_at_lt: Orb::NotGiven.instance, - created_at_lte: Orb::NotGiven.instance, - cursor: Orb::NotGiven.instance, - limit: Orb::NotGiven.instance, - status: Orb::NotGiven.instance - ) - request = { - method: :get, - path: "/plans", - query: { - "created_at[gt]": created_at_gt, - "created_at[gte]": created_at_gte, - "created_at[lt]": created_at_lt, - "created_at[lte]": created_at_lte, - cursor: cursor, - limit: limit, - status: status - } - } - - @client.request(page: PlanPage, **request) - end - def fetch(plan_id) - request = { method: :get, path: "/plans/#{plan_id}", query: nil } - - @client.request(model: Orb::Models::Plan, **request) - end - end - end -end diff --git a/lib/orb/resources/prices.rb b/lib/orb/resources/prices.rb new file mode 100644 index 00000000..7b27c09a --- /dev/null +++ b/lib/orb/resources/prices.rb @@ -0,0 +1,263 @@ +# frozen_string_literal: true + +module Orb + module Resources + class Prices + # @return [Orb::Resources::Prices::ExternalPriceID] + attr_reader :external_price_id + + # This endpoint is used to create a [price](/product-catalog/price-configuration). + # A price created using this endpoint is always an add-on, meaning that it’s not + # associated with a specific plan and can instead be individually added to + # subscriptions, including subscriptions on different plans. + # + # An `external_price_id` can be optionally specified as an alias to allow + # ergonomic interaction with prices in the Orb API. + # + # See the [Price resource](/product-catalog/price-configuration) for the + # specification of different price model configurations possible in this endpoint. + # + # @param params [Orb::Models::PriceCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, Orb::Models::PriceCreateParams::Cadence] :cadence The cadence to bill for this price on. + # + # @option params [String] :currency An ISO 4217 currency string for which this price is billed in. + # + # @option params [String] :item_id The id of the item the plan will be associated with. + # + # @option params [Symbol, Orb::Models::PriceCreateParams::ModelType] :model_type + # + # @option params [String] :name The name of the price. + # + # @option params [Orb::Models::PriceCreateParams::UnitConfig] :unit_config + # + # @option params [String, nil] :billable_metric_id The id of the billable metric for the price. Only needed if the price is + # usage-based. + # + # @option params [Boolean, nil] :billed_in_advance If the Price represents a fixed cost, the price will be billed in-advance if + # this is true, and in-arrears if this is false. + # + # @option params [Orb::Models::PriceCreateParams::BillingCycleConfiguration, nil] :billing_cycle_configuration For custom cadence: specifies the duration of the billing period in days or + # months. + # + # @option params [Float, nil] :conversion_rate The per unit conversion rate of the price currency to the invoicing currency. + # + # @option params [String, nil] :external_price_id An alias for the price. + # + # @option params [Float, nil] :fixed_price_quantity If the Price represents a fixed cost, this represents the quantity of units + # applied. + # + # @option params [String, nil] :invoice_grouping_key The property used to group this price on an invoice + # + # @option params [Orb::Models::PriceCreateParams::InvoicingCycleConfiguration, nil] :invoicing_cycle_configuration Within each billing cycle, specifies the cadence at which invoices are produced. + # If unspecified, a single invoice is produced per billing cycle. + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [Orb::Models::PriceCreateParams::PackageConfig] :package_config + # + # @option params [Orb::Models::PriceCreateParams::MatrixConfig] :matrix_config + # + # @option params [Orb::Models::PriceCreateParams::MatrixWithAllocationConfig] :matrix_with_allocation_config + # + # @option params [Orb::Models::PriceCreateParams::TieredConfig] :tiered_config + # + # @option params [Orb::Models::PriceCreateParams::TieredBpsConfig] :tiered_bps_config + # + # @option params [Orb::Models::PriceCreateParams::BpsConfig] :bps_config + # + # @option params [Orb::Models::PriceCreateParams::BulkBpsConfig] :bulk_bps_config + # + # @option params [Orb::Models::PriceCreateParams::BulkConfig] :bulk_config + # + # @option params [Hash{Symbol=>Object}] :threshold_total_amount_config + # + # @option params [Hash{Symbol=>Object}] :tiered_package_config + # + # @option params [Hash{Symbol=>Object}] :grouped_tiered_config + # + # @option params [Hash{Symbol=>Object}] :max_group_tiered_package_config + # + # @option params [Hash{Symbol=>Object}] :tiered_with_minimum_config + # + # @option params [Hash{Symbol=>Object}] :package_with_allocation_config + # + # @option params [Hash{Symbol=>Object}] :tiered_package_with_minimum_config + # + # @option params [Hash{Symbol=>Object}] :unit_with_percent_config + # + # @option params [Hash{Symbol=>Object}] :tiered_with_proration_config + # + # @option params [Hash{Symbol=>Object}] :unit_with_proration_config + # + # @option params [Hash{Symbol=>Object}] :grouped_allocation_config + # + # @option params [Hash{Symbol=>Object}] :grouped_with_prorated_minimum_config + # + # @option params [Hash{Symbol=>Object}] :grouped_with_metered_minimum_config + # + # @option params [Hash{Symbol=>Object}] :matrix_with_display_name_config + # + # @option params [Hash{Symbol=>Object}] :bulk_with_proration_config + # + # @option params [Hash{Symbol=>Object}] :grouped_tiered_package_config + # + # @option params [Hash{Symbol=>Object}] :scalable_matrix_with_unit_pricing_config + # + # @option params [Hash{Symbol=>Object}] :scalable_matrix_with_tiered_pricing_config + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # + def create(params) + parsed, options = Orb::Models::PriceCreateParams.dump_request(params) + @client.request( + method: :post, + path: "prices", + body: parsed, + model: Orb::Models::Price, + options: options + ) + end + + # This endpoint allows you to update the `metadata` property on a price. If you + # pass null for the metadata value, it will clear any existing metadata for that + # price. + # + # @param price_id [String] + # + # @param params [Orb::Models::PriceUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # + def update(price_id, params = {}) + parsed, options = Orb::Models::PriceUpdateParams.dump_request(params) + @client.request( + method: :put, + path: ["prices/%0s", price_id], + body: parsed, + model: Orb::Models::Price, + options: options + ) + end + + # This endpoint is used to list all add-on prices created using the + # [price creation endpoint](/api-reference/price/create-price). + # + # @param params [Orb::Models::PriceListParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(params = {}) + parsed, options = Orb::Models::PriceListParams.dump_request(params) + @client.request( + method: :get, + path: "prices", + query: parsed, + page: Orb::Page, + model: Orb::Models::Price, + options: options + ) + end + + # This endpoint is used to evaluate the output of a price for a given customer and + # time range. It enables filtering and grouping the output using + # [computed properties](/extensibility/advanced-metrics#computed-properties), + # supporting the following workflows: + # + # 1. Showing detailed usage and costs to the end customer. + # 2. Auditing subtotals on invoice line items. + # + # For these workflows, the expressiveness of computed properties in both the + # filters and grouping is critical. For example, if you'd like to show your + # customer their usage grouped by hour and another property, you can do so with + # the following `grouping_keys`: + # `["hour_floor_timestamp_millis(timestamp_millis)", "my_property"]`. If you'd + # like to examine a customer's usage for a specific property value, you can do so + # with the following `filter`: + # `my_property = 'foo' AND my_other_property = 'bar'`. + # + # By default, the start of the time range must be no more than 100 days ago and + # the length of the results must be no greater than 1000. Note that this is a POST + # endpoint rather than a GET endpoint because it employs a JSON body rather than + # query parameters. + # + # @param price_id [String] + # + # @param params [Orb::Models::PriceEvaluateParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :timeframe_end The exclusive upper bound for event timestamps + # + # @option params [Time] :timeframe_start The inclusive lower bound for event timestamps + # + # @option params [String, nil] :customer_id The ID of the customer to which this evaluation is scoped. + # + # @option params [String, nil] :external_customer_id The external customer ID of the customer to which this evaluation is scoped. + # + # @option params [String, nil] :filter A boolean + # [computed property](/extensibility/advanced-metrics#computed-properties) used to + # filter the underlying billable metric + # + # @option params [Array] :grouping_keys Properties (or + # [computed properties](/extensibility/advanced-metrics#computed-properties)) used + # to group the underlying billable metric + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::PriceEvaluateResponse] + # + def evaluate(price_id, params) + parsed, options = Orb::Models::PriceEvaluateParams.dump_request(params) + @client.request( + method: :post, + path: ["prices/%0s/evaluate", price_id], + body: parsed, + model: Orb::Models::PriceEvaluateResponse, + options: options + ) + end + + # This endpoint returns a price given an identifier. + # + # @param price_id [String] + # + # @param params [Orb::Models::PriceFetchParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # + def fetch(price_id, params = {}) + @client.request( + method: :get, + path: ["prices/%0s", price_id], + model: Orb::Models::Price, + options: params[:request_options] + ) + end + + # @param client [Orb::Client] + # + def initialize(client:) + @client = client + @external_price_id = Orb::Resources::Prices::ExternalPriceID.new(client: client) + end + end + end +end diff --git a/lib/orb/resources/prices/external_price_id.rb b/lib/orb/resources/prices/external_price_id.rb index e38c7be8..e9ca8309 100644 --- a/lib/orb/resources/prices/external_price_id.rb +++ b/lib/orb/resources/prices/external_price_id.rb @@ -1,19 +1,61 @@ +# frozen_string_literal: true + module Orb module Resources - module Prices - class ExternalPriceIDResource - attr_reader - def initialize(client:) - @client = client + class Prices + class ExternalPriceID + # This endpoint allows you to update the `metadata` property on a price. If you + # pass null for the metadata value, it will clear any existing metadata for that + # price. + # + # @param external_price_id [String] + # + # @param params [Orb::Models::Prices::ExternalPriceIDUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # + def update(external_price_id, params = {}) + parsed, options = Orb::Models::Prices::ExternalPriceIDUpdateParams.dump_request(params) + @client.request( + method: :put, + path: ["prices/external_price_id/%0s", external_price_id], + body: parsed, + model: Orb::Models::Price, + options: options + ) end - def fetch(external_price_id) - request = { + + # This endpoint returns a price given an external price id. See the + # [price creation API](/api-reference/price/create-price) for more information + # about external price aliases. + # + # @param external_price_id [String] + # + # @param params [Orb::Models::Prices::ExternalPriceIDFetchParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Price::UnitPrice, Orb::Models::Price::PackagePrice, Orb::Models::Price::MatrixPrice, Orb::Models::Price::TieredPrice, Orb::Models::Price::TieredBpsPrice, Orb::Models::Price::BpsPrice, Orb::Models::Price::BulkBpsPrice, Orb::Models::Price::BulkPrice, Orb::Models::Price::ThresholdTotalAmountPrice, Orb::Models::Price::TieredPackagePrice, Orb::Models::Price::GroupedTieredPrice, Orb::Models::Price::TieredWithMinimumPrice, Orb::Models::Price::TieredPackageWithMinimumPrice, Orb::Models::Price::PackageWithAllocationPrice, Orb::Models::Price::UnitWithPercentPrice, Orb::Models::Price::MatrixWithAllocationPrice, Orb::Models::Price::TieredWithProrationPrice, Orb::Models::Price::UnitWithProrationPrice, Orb::Models::Price::GroupedAllocationPrice, Orb::Models::Price::GroupedWithProratedMinimumPrice, Orb::Models::Price::GroupedWithMeteredMinimumPrice, Orb::Models::Price::MatrixWithDisplayNamePrice, Orb::Models::Price::BulkWithProrationPrice, Orb::Models::Price::GroupedTieredPackagePrice, Orb::Models::Price::MaxGroupTieredPackagePrice, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + # + def fetch(external_price_id, params = {}) + @client.request( method: :get, - path: "/prices/external_price_id/#{external_price_id}", - query: nil - } + path: ["prices/external_price_id/%0s", external_price_id], + model: Orb::Models::Price, + options: params[:request_options] + ) + end - @client.request(**request) + # @param client [Orb::Client] + # + def initialize(client:) + @client = client end end end diff --git a/lib/orb/resources/prices/prices.rb b/lib/orb/resources/prices/prices.rb deleted file mode 100644 index 3cb33d3c..00000000 --- a/lib/orb/resources/prices/prices.rb +++ /dev/null @@ -1,445 +0,0 @@ -require "orb/model" -require "orb/models/price" -require "orb/pagination" -require "orb/resources/prices/external_price_id" -module Orb - module Resources - class PricePage < Page - required :data, Orb::ArrayOf.new(Orb::Models::Price) - end - - class PricesResource - attr_reader :external_price_id - def initialize(client:) - @client = client - @external_price_id = - Orb::Resources::Prices::ExternalPriceIDResource.new(client: client) - end - def create( - cadence: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - item_id: Orb::NotGiven.instance, - model_type: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - unit_config: Orb::NotGiven.instance, - billable_metric_id: Orb::NotGiven.instance, - billed_in_advance: Orb::NotGiven.instance, - external_price_id: Orb::NotGiven.instance, - fixed_price_quantity: Orb::NotGiven.instance, - invoice_grouping_key: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/prices", - body: { - cadence: cadence, - currency: currency, - item_id: item_id, - model_type: model_type, - name: name, - unit_config: unit_config, - billable_metric_id: billable_metric_id, - billed_in_advance: billed_in_advance, - external_price_id: external_price_id, - fixed_price_quantity: fixed_price_quantity, - invoice_grouping_key: invoice_grouping_key - }, - query: nil - } - - @client.request(**request) - end - def create( - cadence: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - item_id: Orb::NotGiven.instance, - model_type: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - package_config: Orb::NotGiven.instance, - billable_metric_id: Orb::NotGiven.instance, - billed_in_advance: Orb::NotGiven.instance, - external_price_id: Orb::NotGiven.instance, - fixed_price_quantity: Orb::NotGiven.instance, - invoice_grouping_key: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/prices", - body: { - cadence: cadence, - currency: currency, - item_id: item_id, - model_type: model_type, - name: name, - package_config: package_config, - billable_metric_id: billable_metric_id, - billed_in_advance: billed_in_advance, - external_price_id: external_price_id, - fixed_price_quantity: fixed_price_quantity, - invoice_grouping_key: invoice_grouping_key - }, - query: nil - } - - @client.request(**request) - end - def create( - cadence: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - item_id: Orb::NotGiven.instance, - matrix_config: Orb::NotGiven.instance, - model_type: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - billable_metric_id: Orb::NotGiven.instance, - billed_in_advance: Orb::NotGiven.instance, - external_price_id: Orb::NotGiven.instance, - fixed_price_quantity: Orb::NotGiven.instance, - invoice_grouping_key: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/prices", - body: { - cadence: cadence, - currency: currency, - item_id: item_id, - matrix_config: matrix_config, - model_type: model_type, - name: name, - billable_metric_id: billable_metric_id, - billed_in_advance: billed_in_advance, - external_price_id: external_price_id, - fixed_price_quantity: fixed_price_quantity, - invoice_grouping_key: invoice_grouping_key - }, - query: nil - } - - @client.request(**request) - end - def create( - cadence: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - item_id: Orb::NotGiven.instance, - model_type: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - tiered_config: Orb::NotGiven.instance, - billable_metric_id: Orb::NotGiven.instance, - billed_in_advance: Orb::NotGiven.instance, - external_price_id: Orb::NotGiven.instance, - fixed_price_quantity: Orb::NotGiven.instance, - invoice_grouping_key: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/prices", - body: { - cadence: cadence, - currency: currency, - item_id: item_id, - model_type: model_type, - name: name, - tiered_config: tiered_config, - billable_metric_id: billable_metric_id, - billed_in_advance: billed_in_advance, - external_price_id: external_price_id, - fixed_price_quantity: fixed_price_quantity, - invoice_grouping_key: invoice_grouping_key - }, - query: nil - } - - @client.request(**request) - end - def create( - cadence: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - item_id: Orb::NotGiven.instance, - model_type: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - tiered_bps_config: Orb::NotGiven.instance, - billable_metric_id: Orb::NotGiven.instance, - billed_in_advance: Orb::NotGiven.instance, - external_price_id: Orb::NotGiven.instance, - fixed_price_quantity: Orb::NotGiven.instance, - invoice_grouping_key: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/prices", - body: { - cadence: cadence, - currency: currency, - item_id: item_id, - model_type: model_type, - name: name, - tiered_bps_config: tiered_bps_config, - billable_metric_id: billable_metric_id, - billed_in_advance: billed_in_advance, - external_price_id: external_price_id, - fixed_price_quantity: fixed_price_quantity, - invoice_grouping_key: invoice_grouping_key - }, - query: nil - } - - @client.request(**request) - end - def create( - bps_config: Orb::NotGiven.instance, - cadence: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - item_id: Orb::NotGiven.instance, - model_type: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - billable_metric_id: Orb::NotGiven.instance, - billed_in_advance: Orb::NotGiven.instance, - external_price_id: Orb::NotGiven.instance, - fixed_price_quantity: Orb::NotGiven.instance, - invoice_grouping_key: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/prices", - body: { - bps_config: bps_config, - cadence: cadence, - currency: currency, - item_id: item_id, - model_type: model_type, - name: name, - billable_metric_id: billable_metric_id, - billed_in_advance: billed_in_advance, - external_price_id: external_price_id, - fixed_price_quantity: fixed_price_quantity, - invoice_grouping_key: invoice_grouping_key - }, - query: nil - } - - @client.request(**request) - end - def create( - bulk_bps_config: Orb::NotGiven.instance, - cadence: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - item_id: Orb::NotGiven.instance, - model_type: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - billable_metric_id: Orb::NotGiven.instance, - billed_in_advance: Orb::NotGiven.instance, - external_price_id: Orb::NotGiven.instance, - fixed_price_quantity: Orb::NotGiven.instance, - invoice_grouping_key: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/prices", - body: { - bulk_bps_config: bulk_bps_config, - cadence: cadence, - currency: currency, - item_id: item_id, - model_type: model_type, - name: name, - billable_metric_id: billable_metric_id, - billed_in_advance: billed_in_advance, - external_price_id: external_price_id, - fixed_price_quantity: fixed_price_quantity, - invoice_grouping_key: invoice_grouping_key - }, - query: nil - } - - @client.request(**request) - end - def create( - bulk_config: Orb::NotGiven.instance, - cadence: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - item_id: Orb::NotGiven.instance, - model_type: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - billable_metric_id: Orb::NotGiven.instance, - billed_in_advance: Orb::NotGiven.instance, - external_price_id: Orb::NotGiven.instance, - fixed_price_quantity: Orb::NotGiven.instance, - invoice_grouping_key: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/prices", - body: { - bulk_config: bulk_config, - cadence: cadence, - currency: currency, - item_id: item_id, - model_type: model_type, - name: name, - billable_metric_id: billable_metric_id, - billed_in_advance: billed_in_advance, - external_price_id: external_price_id, - fixed_price_quantity: fixed_price_quantity, - invoice_grouping_key: invoice_grouping_key - }, - query: nil - } - - @client.request(**request) - end - def create( - cadence: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - item_id: Orb::NotGiven.instance, - model_type: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - threshold_total_amount_config: Orb::NotGiven.instance, - billable_metric_id: Orb::NotGiven.instance, - billed_in_advance: Orb::NotGiven.instance, - external_price_id: Orb::NotGiven.instance, - fixed_price_quantity: Orb::NotGiven.instance, - invoice_grouping_key: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/prices", - body: { - cadence: cadence, - currency: currency, - item_id: item_id, - model_type: model_type, - name: name, - threshold_total_amount_config: threshold_total_amount_config, - billable_metric_id: billable_metric_id, - billed_in_advance: billed_in_advance, - external_price_id: external_price_id, - fixed_price_quantity: fixed_price_quantity, - invoice_grouping_key: invoice_grouping_key - }, - query: nil - } - - @client.request(**request) - end - def create( - cadence: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - item_id: Orb::NotGiven.instance, - model_type: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - tiered_package_config: Orb::NotGiven.instance, - billable_metric_id: Orb::NotGiven.instance, - billed_in_advance: Orb::NotGiven.instance, - external_price_id: Orb::NotGiven.instance, - fixed_price_quantity: Orb::NotGiven.instance, - invoice_grouping_key: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/prices", - body: { - cadence: cadence, - currency: currency, - item_id: item_id, - model_type: model_type, - name: name, - tiered_package_config: tiered_package_config, - billable_metric_id: billable_metric_id, - billed_in_advance: billed_in_advance, - external_price_id: external_price_id, - fixed_price_quantity: fixed_price_quantity, - invoice_grouping_key: invoice_grouping_key - }, - query: nil - } - - @client.request(**request) - end - def create( - cadence: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - item_id: Orb::NotGiven.instance, - model_type: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - tiered_with_minimum_config: Orb::NotGiven.instance, - billable_metric_id: Orb::NotGiven.instance, - billed_in_advance: Orb::NotGiven.instance, - external_price_id: Orb::NotGiven.instance, - fixed_price_quantity: Orb::NotGiven.instance, - invoice_grouping_key: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/prices", - body: { - cadence: cadence, - currency: currency, - item_id: item_id, - model_type: model_type, - name: name, - tiered_with_minimum_config: tiered_with_minimum_config, - billable_metric_id: billable_metric_id, - billed_in_advance: billed_in_advance, - external_price_id: external_price_id, - fixed_price_quantity: fixed_price_quantity, - invoice_grouping_key: invoice_grouping_key - }, - query: nil - } - - @client.request(**request) - end - def create( - cadence: Orb::NotGiven.instance, - currency: Orb::NotGiven.instance, - item_id: Orb::NotGiven.instance, - model_type: Orb::NotGiven.instance, - name: Orb::NotGiven.instance, - package_with_allocation_config: Orb::NotGiven.instance, - billable_metric_id: Orb::NotGiven.instance, - billed_in_advance: Orb::NotGiven.instance, - external_price_id: Orb::NotGiven.instance, - fixed_price_quantity: Orb::NotGiven.instance, - invoice_grouping_key: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/prices", - body: { - cadence: cadence, - currency: currency, - item_id: item_id, - model_type: model_type, - name: name, - package_with_allocation_config: package_with_allocation_config, - billable_metric_id: billable_metric_id, - billed_in_advance: billed_in_advance, - external_price_id: external_price_id, - fixed_price_quantity: fixed_price_quantity, - invoice_grouping_key: invoice_grouping_key - }, - query: nil - } - - @client.request(**request) - end - def list(cursor: Orb::NotGiven.instance, limit: Orb::NotGiven.instance) - request = { - method: :get, - path: "/prices", - query: { - cursor: cursor, - limit: limit - } - } - - @client.request(page: PricePage, **request) - end - def fetch(price_id) - request = { method: :get, path: "/prices/#{price_id}", query: nil } - - @client.request(**request) - end - end - end -end diff --git a/lib/orb/resources/subscriptions.rb b/lib/orb/resources/subscriptions.rb index 1986068d..558a8623 100644 --- a/lib/orb/resources/subscriptions.rb +++ b/lib/orb/resources/subscriptions.rb @@ -1,338 +1,1453 @@ -require "orb/model" -require "orb/models/subscription" -require "orb/models/subscription_fetch_costs_response" -require "orb/models/subscription_fetch_schedule_response" -require "orb/pagination" +# frozen_string_literal: true + module Orb module Resources - class SubscriptionPage < Page - required :data, Orb::ArrayOf.new(Orb::Models::Subscription) - end - - class SubscriptionFetchScheduleResponsePage < Page - required :data, - Orb::ArrayOf.new(Orb::Models::SubscriptionFetchScheduleResponse) - end - - class SubscriptionsResource - attr_reader - def initialize(client:) - @client = client - end - def create( - align_billing_with_subscription_start_date: Orb::NotGiven.instance, - auto_collection: Orb::NotGiven.instance, - aws_region: Orb::NotGiven.instance, - coupon_redemption_code: Orb::NotGiven.instance, - credits_overage_rate: Orb::NotGiven.instance, - customer_id: Orb::NotGiven.instance, - default_invoice_memo: Orb::NotGiven.instance, - end_date: Orb::NotGiven.instance, - external_customer_id: Orb::NotGiven.instance, - external_marketplace: Orb::NotGiven.instance, - external_marketplace_reporting_id: Orb::NotGiven.instance, - external_plan_id: Orb::NotGiven.instance, - initial_phase_order: Orb::NotGiven.instance, - invoicing_threshold: Orb::NotGiven.instance, - metadata: Orb::NotGiven.instance, - net_terms: Orb::NotGiven.instance, - per_credit_overage_amount: Orb::NotGiven.instance, - plan_id: Orb::NotGiven.instance, - price_overrides: Orb::NotGiven.instance, - start_date: Orb::NotGiven.instance - ) - request = { + class Subscriptions + # A subscription represents the purchase of a plan by a customer. The customer is + # identified by either the `customer_id` or the `external_customer_id`, and + # exactly one of these fields must be provided. + # + # By default, subscriptions begin on the day that they're created and renew + # automatically for each billing cycle at the cadence that's configured in the + # plan definition. + # + # The default configuration for subscriptions in Orb is **In-advance billing** and + # **Beginning of month alignment** (see + # [Subscription](/core-concepts##subscription) for more details). + # + # In order to change the alignment behavior, Orb also supports billing + # subscriptions on the day of the month they are created. If + # `align_billing_with_subscription_start_date = true` is specified, subscriptions + # have billing cycles that are aligned with their `start_date`. For example, a + # subscription that begins on January 15th will have a billing cycle from January + # 15th to February 15th. Every subsequent billing cycle will continue to start and + # invoice on the 15th. + # + # If the "day" value is greater than the number of days in the month, the next + # billing cycle will start at the end of the month. For example, if the start_date + # is January 31st, the next billing cycle will start on February 28th. + # + # If a customer was created with a currency, Orb only allows subscribing the + # customer to a plan with a matching `invoicing_currency`. If the customer does + # not have a currency set, on subscription creation, we set the customer's + # currency to be the `invoicing_currency` of the plan. + # + # ## Customize your customer's subscriptions + # + # Prices and adjustments in a plan can be added, removed, or replaced for the + # subscription being created. This is useful when a customer has prices that + # differ from the default prices for a specific plan. + # + # + # This feature is only available for accounts that have migrated to Subscription Overrides Version 2. You can find your + # Subscription Overrides Version at the bottom of your [Plans page](https://app.withorb.com/plans) + # + # + # ### Adding Prices + # + # To add prices, provide a list of objects with the key `add_prices`. An object in + # the list must specify an existing add-on price with a `price_id` or + # `external_price_id` field, or create a new add-on price by including an object + # with the key `price`, identical to what would be used in the request body for + # the [create price endpoint](/api-reference/price/create-price). See the + # [Price resource](/product-catalog/price-configuration) for the specification of + # different price model configurations possible in this object. + # + # If the plan has phases, each object in the list must include a number with + # `plan_phase_order` key to indicate which phase the price should be added to. + # + # An object in the list can specify an optional `start_date` and optional + # `end_date`. This is equivalent to creating a price interval with the + # [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). + # If unspecified, the start or end date of the phase or subscription will be used. + # + # An object in the list can specify an optional `minimum_amount`, + # `maximum_amount`, or `discounts`. This will create adjustments which apply only + # to this price. + # + # Additionally, an object in the list can specify an optional `reference_id`. This + # ID can be used to reference this price when + # [adding an adjustment](#adding-adjustments) in the same API call. However the ID + # is _transient_ and cannot be used to refer to the price in future API calls. + # + # ### Removing Prices + # + # To remove prices, provide a list of objects with the key `remove_prices`. An + # object in the list must specify a plan price with either a `price_id` or + # `external_price_id` field. + # + # ### Replacing Prices + # + # To replace prices, provide a list of objects with the key `replace_prices`. An + # object in the list must specify a plan price to replace with the + # `replaces_price_id` key, and it must specify a price to replace it with by + # either referencing an existing add-on price with a `price_id` or + # `external_price_id` field, or by creating a new add-on price by including an + # object with the key `price`, identical to what would be used in the request body + # for the [create price endpoint](/api-reference/price/create-price). See the + # [Price resource](/product-catalog/price-configuration) for the specification of + # different price model configurations possible in this object. + # + # For fixed fees, an object in the list can supply a `fixed_price_quantity` + # instead of a `price`, `price_id`, or `external_price_id` field. This will update + # only the quantity for the price, similar to the + # [Update price quantity](/api-reference/subscription/update-price-quantity) + # endpoint. + # + # The replacement price will have the same phase, if applicable, and the same + # start and end dates as the price it replaces. + # + # An object in the list can specify an optional `minimum_amount`, + # `maximum_amount`, or `discounts`. This will create adjustments which apply only + # to this price. + # + # Additionally, an object in the list can specify an optional `reference_id`. This + # ID can be used to reference the replacement price when + # [adding an adjustment](#adding-adjustments) in the same API call. However the ID + # is _transient_ and cannot be used to refer to the price in future API calls. + # + # ### Adding adjustments + # + # To add adjustments, provide a list of objects with the key `add_adjustments`. An + # object in the list must include an object with the key `adjustment`, identical + # to the adjustment object in the + # [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). + # + # If the plan has phases, each object in the list must include a number with + # `plan_phase_order` key to indicate which phase the adjustment should be added + # to. + # + # An object in the list can specify an optional `start_date` and optional + # `end_date`. If unspecified, the start or end date of the phase or subscription + # will be used. + # + # ### Removing adjustments + # + # To remove adjustments, provide a list of objects with the key + # `remove_adjustments`. An object in the list must include a key, `adjustment_id`, + # with the ID of the adjustment to be removed. + # + # ### Replacing adjustments + # + # To replace adjustments, provide a list of objects with the key + # `replace_adjustments`. An object in the list must specify a plan adjustment to + # replace with the `replaces_adjustment_id` key, and it must specify an adjustment + # to replace it with by including an object with the key `adjustment`, identical + # to the adjustment object in the + # [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). + # + # The replacement adjustment will have the same phase, if applicable, and the same + # start and end dates as the adjustment it replaces. + # + # ## Price overrides (DEPRECATED) + # + # + # Price overrides are being phased out in favor adding/removing/replacing prices. (See + # [Customize your customer's subscriptions](/api-reference/subscription/create-subscription)) + # + # + # Price overrides are used to update some or all prices in a plan for the specific + # subscription being created. This is useful when a new customer has negotiated a + # rate that is unique to the customer. + # + # To override prices, provide a list of objects with the key `price_overrides`. + # The price object in the list of overrides is expected to contain the existing + # price id, the `model_type` and configuration. (See the + # [Price resource](/product-catalog/price-configuration) for the specification of + # different price model configurations.) The numerical values can be updated, but + # the billable metric, cadence, type, and name of a price can not be overridden. + # + # ### Maximums and Minimums + # + # Minimums and maximums, much like price overrides, can be useful when a new + # customer has negotiated a new or different minimum or maximum spend cap than the + # default for a given price. If one exists for a price and null is provided for + # the minimum/maximum override on creation, then there will be no minimum/maximum + # on the new subscription. If no value is provided, then the default price maximum + # or minimum is used. + # + # To add a minimum for a specific price, add `minimum_amount` to the specific + # price in the `price_overrides` object. + # + # To add a maximum for a specific price, add `maximum_amount` to the specific + # price in the `price_overrides` object. + # + # ### Minimum override example + # + # Price minimum override example: + # + # ```json + # { + # ... + # "id": "price_id", + # "model_type": "unit", + # "unit_config": { + # "unit_amount": "0.50" + # }, + # "minimum_amount": "100.00" + # ... + # } + # ``` + # + # Removing an existing minimum example + # + # ```json + # { + # ... + # "id": "price_id", + # "model_type": "unit", + # "unit_config": { + # "unit_amount": "0.50" + # }, + # "minimum_amount": null + # ... + # } + # ``` + # + # ### Discounts + # + # Discounts, like price overrides, can be useful when a new customer has + # negotiated a new or different discount than the default for a price. If a + # discount exists for a price and a null discount is provided on creation, then + # there will be no discount on the new subscription. + # + # To add a discount for a specific price, add `discount` to the price in the + # `price_overrides` object. Discount should be a dictionary of the format: + # + # ```ts + # { + # "discount_type": "amount" | "percentage" | "usage", + # "amount_discount": string, + # "percentage_discount": string, + # "usage_discount": string + # } + # ``` + # + # where either `amount_discount`, `percentage_discount`, or `usage_discount` is + # provided. + # + # Price discount example + # + # ```json + # { + # ... + # "id": "price_id", + # "model_type": "unit", + # "unit_config": { + # "unit_amount": "0.50" + # }, + # "discount": {"discount_type": "amount", "amount_discount": "175"}, + # } + # ``` + # + # Removing an existing discount example + # + # ```json + # { + # "customer_id": "customer_id", + # "plan_id": "plan_id", + # "discount": null, + # "price_overrides": [ ... ] + # ... + # } + # ``` + # + # ## Threshold Billing + # + # Orb supports invoicing for a subscription when a preconfigured usage threshold + # is hit. To enable threshold billing, pass in an `invoicing_threshold`, which is + # specified in the subscription's invoicing currency, when creating a + # subscription. E.g. pass in `10.00` to issue an invoice when usage amounts hit + # $10.00 for a subscription that invoices in USD. + # + # @param params [Orb::Models::SubscriptionCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Array, nil] :add_adjustments Additional adjustments to be added to the subscription. (Only available for + # accounts that have migrated off of legacy subscription overrides) + # + # @option params [Array, nil] :add_prices Additional prices to be added to the subscription. (Only available for accounts + # that have migrated off of legacy subscription overrides) + # + # @option params [Boolean] :align_billing_with_subscription_start_date + # + # @option params [Boolean, nil] :auto_collection Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. If not specified, this + # defaults to the behavior configured for this customer. + # + # @option params [String, nil] :aws_region + # + # @option params [Orb::Models::SubscriptionCreateParams::BillingCycleAnchorConfiguration, nil] :billing_cycle_anchor_configuration + # + # @option params [String, nil] :coupon_redemption_code Redemption code to be used for this subscription. If the coupon cannot be found + # by its redemption code, or cannot be redeemed, an error response will be + # returned and the subscription creation or plan change will not be scheduled. + # + # @option params [Float, nil] :credits_overage_rate + # + # @option params [String, nil] :customer_id + # + # @option params [String, nil] :default_invoice_memo Determines the default memo on this subscription's invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @option params [Time, nil] :end_date + # + # @option params [String, nil] :external_customer_id + # + # @option params [Symbol, Orb::Models::SubscriptionCreateParams::ExternalMarketplace, nil] :external_marketplace + # + # @option params [String, nil] :external_marketplace_reporting_id + # + # @option params [String, nil] :external_plan_id The external_plan_id of the plan that the given subscription should be switched + # to. Note that either this property or `plan_id` must be specified. + # + # @option params [String, nil] :filter An additional filter to apply to usage queries. This filter must be expressed as + # a boolean + # [computed property](/extensibility/advanced-metrics#computed-properties). If + # null, usage queries will not include any additional filter. + # + # @option params [Integer, nil] :initial_phase_order The phase of the plan to start with + # + # @option params [String, nil] :invoicing_threshold When this subscription's accrued usage reaches this threshold, an invoice will + # be issued for the subscription. If not specified, invoices will only be issued + # at the end of the billing period. + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [Integer, nil] :net_terms The net terms determines the difference between the invoice date and the issue + # date for the invoice. If you intend the invoice to be due on issue, set this + # to 0. If not provided, this defaults to the value specified in the plan. + # + # @option params [Float, nil] :per_credit_overage_amount + # + # @option params [String, nil] :plan_id The plan that the given subscription should be switched to. Note that either + # this property or `external_plan_id` must be specified. + # + # @option params [Integer, nil] :plan_version_number Specifies which version of the plan to subscribe to. If null, the default + # version will be used. + # + # @option params [Array, nil] :price_overrides Optionally provide a list of overrides for prices on the plan + # + # @option params [Array, nil] :remove_adjustments Plan adjustments to be removed from the subscription. (Only available for + # accounts that have migrated off of legacy subscription overrides) + # + # @option params [Array, nil] :remove_prices Plan prices to be removed from the subscription. (Only available for accounts + # that have migrated off of legacy subscription overrides) + # + # @option params [Array, nil] :replace_adjustments Plan adjustments to be replaced with additional adjustments on the subscription. + # (Only available for accounts that have migrated off of legacy subscription + # overrides) + # + # @option params [Array, nil] :replace_prices Plan prices to be replaced with additional prices on the subscription. (Only + # available for accounts that have migrated off of legacy subscription overrides) + # + # @option params [Time, nil] :start_date + # + # @option params [Integer, nil] :trial_duration_days The duration of the trial period in days. If not provided, this defaults to the + # value specified in the plan. If `0` is provided, the trial on the plan will be + # skipped. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::SubscriptionCreateResponse] + # + def create(params = {}) + parsed, options = Orb::Models::SubscriptionCreateParams.dump_request(params) + @client.request( method: :post, - path: "/subscriptions", - body: { - align_billing_with_subscription_start_date: - align_billing_with_subscription_start_date, - auto_collection: auto_collection, - aws_region: aws_region, - coupon_redemption_code: coupon_redemption_code, - credits_overage_rate: credits_overage_rate, - customer_id: customer_id, - default_invoice_memo: default_invoice_memo, - end_date: end_date, - external_customer_id: external_customer_id, - external_marketplace: external_marketplace, - external_marketplace_reporting_id: - external_marketplace_reporting_id, - external_plan_id: external_plan_id, - initial_phase_order: initial_phase_order, - invoicing_threshold: invoicing_threshold, - metadata: metadata, - net_terms: net_terms, - per_credit_overage_amount: per_credit_overage_amount, - plan_id: plan_id, - price_overrides: price_overrides, - start_date: start_date - }, - query: nil - } - - @client.request(model: Orb::Models::Subscription, **request) + path: "subscriptions", + body: parsed, + model: Orb::Models::SubscriptionCreateResponse, + options: options + ) end - def list( - created_at_gt: Orb::NotGiven.instance, - created_at_gte: Orb::NotGiven.instance, - created_at_lt: Orb::NotGiven.instance, - created_at_lte: Orb::NotGiven.instance, - cursor: Orb::NotGiven.instance, - customer_id: Orb::NotGiven.instance, - external_customer_id: Orb::NotGiven.instance, - limit: Orb::NotGiven.instance, - status: Orb::NotGiven.instance - ) - request = { - method: :get, - path: "/subscriptions", - query: { - "created_at[gt]": created_at_gt, - "created_at[gte]": created_at_gte, - "created_at[lt]": created_at_lt, - "created_at[lte]": created_at_lte, - cursor: cursor, - customer_id: customer_id, - external_customer_id: external_customer_id, - limit: limit, - status: status - } - } - @client.request(page: SubscriptionPage, **request) + # This endpoint can be used to update the `metadata`, `net terms`, + # `auto_collection`, `invoicing_threshold`, and `default_invoice_memo` properties + # on a subscription. + # + # @param subscription_id [String] + # + # @param params [Orb::Models::SubscriptionUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Boolean, nil] :auto_collection Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. This property defaults to + # the plan's behavior. + # + # @option params [String, nil] :default_invoice_memo Determines the default memo on this subscription's invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @option params [String, nil] :invoicing_threshold When this subscription's accrued usage reaches this threshold, an invoice will + # be issued for the subscription. If not specified, invoices will only be issued + # at the end of the billing period. + # + # @option params [Hash{Symbol=>String, nil}, nil] :metadata User-specified key/value pairs for the resource. Individual keys can be removed + # by setting the value to `null`, and the entire metadata mapping can be cleared + # by setting `metadata` to `null`. + # + # @option params [Integer, nil] :net_terms Determines the difference between the invoice issue date for subscription + # invoices as the date that they are due. A value of `0` here represents that the + # invoice is due on issue, whereas a value of `30` represents that the customer + # has a month to pay the invoice. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Subscription] + # + def update(subscription_id, params = {}) + parsed, options = Orb::Models::SubscriptionUpdateParams.dump_request(params) + @client.request( + method: :put, + path: ["subscriptions/%0s", subscription_id], + body: parsed, + model: Orb::Models::Subscription, + options: options + ) end - def cancel( - subscription_id, - cancel_option: Orb::NotGiven.instance, - cancellation_date: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/subscriptions/#{subscription_id}/cancel", - body: { - cancel_option: cancel_option, - cancellation_date: cancellation_date - }, - query: nil - } - @client.request(model: Orb::Models::Subscription, **request) - end - def fetch(subscription_id) - request = { + # This endpoint returns a list of all subscriptions for an account as a + # [paginated](/api-reference/pagination) list, ordered starting from the most + # recently created subscription. For a full discussion of the subscription + # resource, see [Subscription](/core-concepts##subscription). + # + # Subscriptions can be filtered for a specific customer by using either the + # customer_id or external_customer_id query parameters. To filter subscriptions + # for multiple customers, use the customer_id[] or external_customer_id[] query + # parameters. + # + # @param params [Orb::Models::SubscriptionListParams, Hash{Symbol=>Object}] . + # + # @option params [Time, nil] :created_at_gt + # + # @option params [Time, nil] :created_at_gte + # + # @option params [Time, nil] :created_at_lt + # + # @option params [Time, nil] :created_at_lte + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Array, nil] :customer_id + # + # @option params [String, nil] :external_customer_id + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Symbol, Orb::Models::SubscriptionListParams::Status, nil] :status + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def list(params = {}) + parsed, options = Orb::Models::SubscriptionListParams.dump_request(params) + @client.request( method: :get, - path: "/subscriptions/#{subscription_id}", - query: nil - } + path: "subscriptions", + query: parsed, + page: Orb::Page, + model: Orb::Models::Subscription, + options: options + ) + end - @client.request(model: Orb::Models::Subscription, **request) + # This endpoint can be used to cancel an existing subscription. It returns the + # serialized subscription object with an `end_date` parameter that signifies when + # the subscription will transition to an ended state. + # + # The body parameter `cancel_option` determines the cancellation behavior. Orb + # supports three cancellation options: + # + # - `end_of_subscription_term`: stops the subscription from auto-renewing. + # Subscriptions that have been cancelled with this option can still incur + # charges for the remainder of their term: + # + # - Issuing this cancellation request for a monthly subscription will keep the + # subscription active until the start of the subsequent month, and potentially + # issue an invoice for any usage charges incurred in the intervening period. + # - Issuing this cancellation request for a quarterly subscription will keep the + # subscription active until the end of the quarter and potentially issue an + # invoice for any usage charges incurred in the intervening period. + # - Issuing this cancellation request for a yearly subscription will keep the + # subscription active for the full year. For example, a yearly subscription + # starting on 2021-11-01 and cancelled on 2021-12-08 will remain active until + # 2022-11-01 and potentially issue charges in the intervening months for any + # recurring monthly usage charges in its plan. + # - **Note**: If a subscription's plan contains prices with difference cadences, + # the end of term date will be determined by the largest cadence value. For + # example, cancelling end of term for a subscription with a quarterly fixed + # fee with a monthly usage fee will result in the subscription ending at the + # end of the quarter. + # + # - `immediate`: ends the subscription immediately, setting the `end_date` to the + # current time: + # + # - Subscriptions that have been cancelled with this option will be invoiced + # immediately. This invoice will include any usage fees incurred in the + # billing period up to the cancellation, along with any prorated recurring + # fees for the billing period, if applicable. + # - **Note**: If the subscription has a recurring fee that was paid in-advance, + # the prorated amount for the remaining time period will be added to the + # [customer's balance](list-balance-transactions) upon immediate cancellation. + # However, if the customer is ineligible to use the customer balance, the + # subscription cannot be cancelled immediately. + # + # - `requested_date`: ends the subscription on a specified date, which requires a + # `cancellation_date` to be passed in. If no timezone is provided, the + # customer's timezone is used. For example, a subscription starting on January + # 1st with a monthly price can be set to be cancelled on the first of any month + # after January 1st (e.g. March 1st, April 1st, May 1st). A subscription with + # multiple prices with different cadences defines the "term" to be the highest + # cadence of the prices. + # + # Upcoming subscriptions are only eligible for immediate cancellation, which will + # set the `end_date` equal to the `start_date` upon cancellation. + # + # ## Backdated cancellations + # + # Orb allows you to cancel a subscription in the past as long as there are no paid + # invoices between the `requested_date` and the current time. If the cancellation + # is after the latest issued invoice, Orb will generate a balance refund for the + # current period. If the cancellation is before the most recently issued invoice, + # Orb will void the intervening invoice and generate a new one based on the new + # dates for the subscription. See the section on + # [cancellation behaviors](/product-catalog/creating-subscriptions#cancellation-behaviors). + # + # @param subscription_id [String] + # + # @param params [Orb::Models::SubscriptionCancelParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, Orb::Models::SubscriptionCancelParams::CancelOption] :cancel_option Determines the timing of subscription cancellation + # + # @option params [Time, nil] :cancellation_date The date that the cancellation should take effect. This parameter can only be + # passed if the `cancel_option` is `requested_date`. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::SubscriptionCancelResponse] + # + def cancel(subscription_id, params) + parsed, options = Orb::Models::SubscriptionCancelParams.dump_request(params) + @client.request( + method: :post, + path: ["subscriptions/%0s/cancel", subscription_id], + body: parsed, + model: Orb::Models::SubscriptionCancelResponse, + options: options + ) end - def fetch_costs( - subscription_id, - group_by: Orb::NotGiven.instance, - timeframe_end: Orb::NotGiven.instance, - timeframe_start: Orb::NotGiven.instance, - view_mode: Orb::NotGiven.instance - ) - request = { + + # This endpoint is used to fetch a [Subscription](/core-concepts##subscription) + # given an identifier. + # + # @param subscription_id [String] + # + # @param params [Orb::Models::SubscriptionFetchParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::Subscription] + # + def fetch(subscription_id, params = {}) + @client.request( method: :get, - path: "/subscriptions/#{subscription_id}/costs", - query: { - group_by: group_by, - timeframe_end: timeframe_end, - timeframe_start: timeframe_start, - view_mode: view_mode - } - } + path: ["subscriptions/%0s", subscription_id], + model: Orb::Models::Subscription, + options: params[:request_options] + ) + end + # This endpoint is used to fetch a day-by-day snapshot of a subscription's costs + # in Orb, calculated by applying pricing information to the underlying usage (see + # the [subscription usage endpoint](fetch-subscription-usage) to fetch usage per + # metric, in usage units rather than a currency). + # + # The semantics of this endpoint exactly mirror those of + # [fetching a customer's costs](fetch-customer-costs). Use this endpoint to limit + # your analysis of costs to a specific subscription for the customer (e.g. to + # de-aggregate costs when a customer's subscription has started and stopped on the + # same day). + # + # @param subscription_id [String] + # + # @param params [Orb::Models::SubscriptionFetchCostsParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :currency The currency or custom pricing unit to use. + # + # @option params [Time, nil] :timeframe_end Costs returned are exclusive of `timeframe_end`. + # + # @option params [Time, nil] :timeframe_start Costs returned are inclusive of `timeframe_start`. + # + # @option params [Symbol, Orb::Models::SubscriptionFetchCostsParams::ViewMode, nil] :view_mode Controls whether Orb returns cumulative costs since the start of the billing + # period, or incremental day-by-day costs. If your customer has minimums or + # discounts, it's strongly recommended that you use the default cumulative + # behavior. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::SubscriptionFetchCostsResponse] + # + def fetch_costs(subscription_id, params = {}) + parsed, options = Orb::Models::SubscriptionFetchCostsParams.dump_request(params) @client.request( + method: :get, + path: ["subscriptions/%0s/costs", subscription_id], + query: parsed, model: Orb::Models::SubscriptionFetchCostsResponse, - **request + options: options ) end - def fetch_schedule( - subscription_id, - cursor: Orb::NotGiven.instance, - limit: Orb::NotGiven.instance, - start_date_gt: Orb::NotGiven.instance, - start_date_gte: Orb::NotGiven.instance, - start_date_lt: Orb::NotGiven.instance, - start_date_lte: Orb::NotGiven.instance - ) - request = { - method: :get, - path: "/subscriptions/#{subscription_id}/schedule", - query: { - cursor: cursor, - limit: limit, - "start_date[gt]": start_date_gt, - "start_date[gte]": start_date_gte, - "start_date[lt]": start_date_lt, - "start_date[lte]": start_date_lte - } - } - @client.request(page: SubscriptionFetchScheduleResponsePage, **request) - end - def fetch_usage( - subscription_id, - billable_metric_id: Orb::NotGiven.instance, - cursor: Orb::NotGiven.instance, - first_dimension_key: Orb::NotGiven.instance, - first_dimension_value: Orb::NotGiven.instance, - granularity: Orb::NotGiven.instance, - group_by: Orb::NotGiven.instance, - limit: Orb::NotGiven.instance, - second_dimension_key: Orb::NotGiven.instance, - second_dimension_value: Orb::NotGiven.instance, - timeframe_end: Orb::NotGiven.instance, - timeframe_start: Orb::NotGiven.instance, - view_mode: Orb::NotGiven.instance - ) - request = { + # This endpoint returns a [paginated](/api-reference/pagination) list of all plans + # associated with a subscription along with their start and end dates. This list + # contains the subscription's initial plan along with past and future plan + # changes. + # + # @param subscription_id [String] + # + # @param params [Orb::Models::SubscriptionFetchScheduleParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned + # from the initial request. + # + # @option params [Integer] :limit The number of items to fetch. Defaults to 20. + # + # @option params [Time, nil] :start_date_gt + # + # @option params [Time, nil] :start_date_gte + # + # @option params [Time, nil] :start_date_lt + # + # @option params [Time, nil] :start_date_lte + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Page] + # + def fetch_schedule(subscription_id, params = {}) + parsed, options = Orb::Models::SubscriptionFetchScheduleParams.dump_request(params) + @client.request( method: :get, - path: "/subscriptions/#{subscription_id}/usage", - query: { - billable_metric_id: billable_metric_id, - cursor: cursor, - first_dimension_key: first_dimension_key, - first_dimension_value: first_dimension_value, - granularity: granularity, - group_by: group_by, - limit: limit, - second_dimension_key: second_dimension_key, - second_dimension_value: second_dimension_value, - timeframe_end: timeframe_end, - timeframe_start: timeframe_start, - view_mode: view_mode - } - } - - @client.request(**request) + path: ["subscriptions/%0s/schedule", subscription_id], + query: parsed, + page: Orb::Page, + model: Orb::Models::SubscriptionFetchScheduleResponse, + options: options + ) end - def price_intervals( - subscription_id, - add: Orb::NotGiven.instance, - edit: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/subscriptions/#{subscription_id}/price_intervals", - body: { - add: add, - edit: edit - }, - query: nil - } - @client.request(model: Orb::Models::Subscription, **request) + # This endpoint is used to fetch a subscription's usage in Orb. Especially when + # combined with optional query parameters, this endpoint is a powerful way to + # build visualizations on top of Orb's event data and metrics. + # + # With no query parameters specified, this endpoint returns usage for the + # subscription's _current billing period_ across each billable metric that + # participates in the subscription. Usage quantities returned are the result of + # evaluating the metric definition for the entirety of the customer's billing + # period. + # + # ### Default response shape + # + # Orb returns a `data` array with an object corresponding to each billable metric. + # Nested within this object is a `usage` array which has a `quantity` value and a + # corresponding `timeframe_start` and `timeframe_end`. The `quantity` value + # represents the calculated usage value for the billable metric over the specified + # timeframe (inclusive of the `timeframe_start` timestamp and exclusive of the + # `timeframe_end` timestamp). + # + # Orb will include _every_ window in the response starting from the beginning of + # the billing period, even when there were no events (and therefore no usage) in + # the window. This increases the size of the response but prevents the caller from + # filling in gaps and handling cumbersome time-based logic. + # + # The query parameters in this endpoint serve to override this behavior and + # provide some key functionality, as listed below. Note that this functionality + # can also be used _in conjunction_ with each other, e.g. to display grouped usage + # on a custom timeframe. + # + # ## Custom timeframe + # + # In order to view usage for a custom timeframe rather than the current billing + # period, specify a `timeframe_start` and `timeframe_end`. This will calculate + # quantities for usage incurred between timeframe_start (inclusive) and + # timeframe_end (exclusive), i.e. `[timeframe_start, timeframe_end)`. + # + # Note: + # + # - These timestamps must be specified in ISO 8601 format and UTC timezone, e.g. + # `2022-02-01T05:00:00Z`. + # - Both parameters must be specified if either is specified. + # + # ## Grouping by custom attributes + # + # In order to view a single metric grouped by a specific _attribute_ that each + # event is tagged with (e.g. `cluster`), you must additionally specify a + # `billable_metric_id` and a `group_by` key. The `group_by` key denotes the event + # property on which to group. + # + # When returning grouped usage, only usage for `billable_metric_id` is returned, + # and a separate object in the `data` array is returned for each value of the + # `group_by` key present in your events. The `quantity` value is the result of + # evaluating the billable metric for events filtered to a single value of the + # `group_by` key. + # + # Orb expects that events that match the billable metric will contain values in + # the `properties` dictionary that correspond to the `group_by` key specified. By + # default, Orb will not return a `null` group (i.e. events that match the metric + # but do not have the key set). Currently, it is only possible to view usage + # grouped by a single attribute at a time. + # + # When viewing grouped usage, Orb uses pagination to limit the response size to + # 1000 groups by default. If there are more groups for a given subscription, + # pagination metadata in the response can be used to fetch all of the data. + # + # The following example shows usage for an "API Requests" billable metric grouped + # by `region`. Note the extra `metric_group` dictionary in the response, which + # provides metadata about the group: + # + # ```json + # { + # "data": [ + # { + # "usage": [ + # { + # "quantity": 0.19291, + # "timeframe_start": "2021-10-01T07:00:00Z", + # "timeframe_end": "2021-10-02T07:00:00Z", + # }, + # ... + # ], + # "metric_group": { + # "property_key": "region", + # "property_value": "asia/pacific" + # }, + # "billable_metric": { + # "id": "Fe9pbpMk86xpwdGB", + # "name": "API Requests" + # }, + # "view_mode": "periodic" + # }, + # ... + # ] + # } + # ``` + # + # ## Windowed usage + # + # The `granularity` parameter can be used to _window_ the usage `quantity` value + # into periods. When not specified, usage is returned for the entirety of the time + # range. + # + # When `granularity = day` is specified with a timeframe longer than a day, Orb + # will return a `quantity` value for each full day between `timeframe_start` and + # `timeframe_end`. Note that the days are demarcated by the _customer's local + # midnight_. + # + # For example, with `timeframe_start = 2022-02-01T05:00:00Z`, + # `timeframe_end = 2022-02-04T01:00:00Z` and `granularity=day`, the following + # windows will be returned for a customer in the `America/Los_Angeles` timezone + # since local midnight is `08:00` UTC: + # + # - `[2022-02-01T05:00:00Z, 2022-02-01T08:00:00Z)` + # - `[2022-02-01T08:00:00, 2022-02-02T08:00:00Z)` + # - `[2022-02-02T08:00:00, 2022-02-03T08:00:00Z)` + # - `[2022-02-03T08:00:00, 2022-02-04T01:00:00Z)` + # + # ```json + # { + # "data": [ + # { + # "billable_metric": { + # "id": "Q8w89wjTtBdejXKsm", + # "name": "API Requests" + # }, + # "usage": [ + # { + # "quantity": 0, + # "timeframe_end": "2022-02-01T08:00:00+00:00", + # "timeframe_start": "2022-02-01T05:00:00+00:00" + # }, + # { + # + # "quantity": 0, + # "timeframe_end": "2022-02-02T08:00:00+00:00", + # "timeframe_start": "2022-02-01T08:00:00+00:00" + # }, + # { + # "quantity": 0, + # "timeframe_end": "2022-02-03T08:00:00+00:00", + # "timeframe_start": "2022-02-02T08:00:00+00:00" + # }, + # { + # "quantity": 0, + # "timeframe_end": "2022-02-04T01:00:00+00:00", + # "timeframe_start": "2022-02-03T08:00:00+00:00" + # } + # ], + # "view_mode": "periodic" + # }, + # ... + # ] + # } + # ``` + # + # ## Decomposable vs. non-decomposable metrics + # + # Billable metrics fall into one of two categories: decomposable and + # non-decomposable. A decomposable billable metric, such as a sum or a count, can + # be displayed and aggregated across arbitrary timescales. On the other hand, a + # non-decomposable metric is not meaningful when only a slice of the billing + # window is considered. + # + # As an example, if we have a billable metric that's defined to count unique + # users, displaying a graph of unique users for each day is not representative of + # the billable metric value over the month (days could have an overlapping set of + # 'unique' users). Instead, what's useful for any given day is the number of + # unique users in the billing period so far, which are the _cumulative_ unique + # users. + # + # Accordingly, this endpoint returns treats these two types of metrics differently + # when `group_by` is specified: + # + # - Decomposable metrics can be grouped by any event property. + # - Non-decomposable metrics can only be grouped by the corresponding price's + # invoice grouping key. If no invoice grouping key is present, the metric does + # not support `group_by`. + # + # ## Matrix prices + # + # When a billable metric is attached to a price that uses matrix pricing, it's + # important to view usage grouped by those matrix dimensions. In this case, use + # the query parameters `first_dimension_key`, `first_dimension_value` and + # `second_dimension_key`, `second_dimension_value` while filtering to a specific + # `billable_metric_id`. + # + # For example, if your compute metric has a separate unit price (i.e. a matrix + # pricing model) per `region` and `provider`, your request might provide the + # following parameters: + # + # - `first_dimension_key`: `region` + # - `first_dimension_value`: `us-east-1` + # - `second_dimension_key`: `provider` + # - `second_dimension_value`: `aws` + # + # @param subscription_id [String] + # + # @param params [Orb::Models::SubscriptionFetchUsageParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :billable_metric_id When specified in conjunction with `group_by`, this parameter filters usage to a + # single billable metric. Note that both `group_by` and `billable_metric_id` must + # be specified together. + # + # @option params [String, nil] :first_dimension_key + # + # @option params [String, nil] :first_dimension_value + # + # @option params [Symbol, Orb::Models::SubscriptionFetchUsageParams::Granularity, nil] :granularity This determines the windowing of usage reporting. + # + # @option params [String, nil] :group_by Groups per-price usage by the key provided. + # + # @option params [String, nil] :second_dimension_key + # + # @option params [String, nil] :second_dimension_value + # + # @option params [Time, nil] :timeframe_end Usage returned is exclusive of `timeframe_end`. + # + # @option params [Time, nil] :timeframe_start Usage returned is inclusive of `timeframe_start`. + # + # @option params [Symbol, Orb::Models::SubscriptionFetchUsageParams::ViewMode, nil] :view_mode Controls whether Orb returns cumulative usage since the start of the billing + # period, or incremental day-by-day usage. If your customer has minimums or + # discounts, it's strongly recommended that you use the default cumulative + # behavior. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage, Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage] + # + def fetch_usage(subscription_id, params = {}) + parsed, options = Orb::Models::SubscriptionFetchUsageParams.dump_request(params) + @client.request( + method: :get, + path: ["subscriptions/%0s/usage", subscription_id], + query: parsed, + model: Orb::Models::SubscriptionUsage, + options: options + ) end - def schedule_plan_change( - subscription_id, - change_option: Orb::NotGiven.instance, - align_billing_with_plan_change_date: Orb::NotGiven.instance, - billing_cycle_alignment: Orb::NotGiven.instance, - change_date: Orb::NotGiven.instance, - coupon_redemption_code: Orb::NotGiven.instance, - credits_overage_rate: Orb::NotGiven.instance, - external_plan_id: Orb::NotGiven.instance, - initial_phase_order: Orb::NotGiven.instance, - invoicing_threshold: Orb::NotGiven.instance, - per_credit_overage_amount: Orb::NotGiven.instance, - plan_id: Orb::NotGiven.instance, - price_overrides: Orb::NotGiven.instance - ) - request = { - method: :post, - path: "/subscriptions/#{subscription_id}/schedule_plan_change", - body: { - change_option: change_option, - align_billing_with_plan_change_date: - align_billing_with_plan_change_date, - billing_cycle_alignment: billing_cycle_alignment, - change_date: change_date, - coupon_redemption_code: coupon_redemption_code, - credits_overage_rate: credits_overage_rate, - external_plan_id: external_plan_id, - initial_phase_order: initial_phase_order, - invoicing_threshold: invoicing_threshold, - per_credit_overage_amount: per_credit_overage_amount, - plan_id: plan_id, - price_overrides: price_overrides - }, - query: nil - } - @client.request(model: Orb::Models::Subscription, **request) - end - def trigger_phase(subscription_id, effective_date: Orb::NotGiven.instance) - request = { + # This endpoint is used to add and edit subscription + # [price intervals](/api-reference/price-interval/add-or-edit-price-intervals). By + # making modifications to a subscription’s price intervals, you can + # [flexibly and atomically control the billing behavior of a subscription](/product-catalog/modifying-subscriptions). + # + # ## Adding price intervals + # + # Prices can be added as price intervals to a subscription by specifying them in + # the `add` array. A `price_id` or `external_price_id` from an add-on price or + # previously removed plan price can be specified to reuse an existing price + # definition (however, please note that prices from other plans cannot be added to + # the subscription). Additionally, a new price can be specified using the `price` + # field — this price will be created automatically. + # + # A `start_date` must be specified for the price interval. This is the date when + # the price will start billing on the subscription, so this will notably result in + # an immediate charge at this time for any billed in advance fixed fees. The + # `end_date` will default to null, resulting in a price interval that will bill on + # a continually recurring basis. Both of these dates can be set in the past or the + # future and Orb will generate or modify invoices to ensure the subscription’s + # invoicing behavior is correct. + # + # Additionally, a discount, minimum, or maximum can be specified on the price + # interval. This will only apply to this price interval, not any other price + # intervals on the subscription. + # + # ## Adjustment intervals + # + # An adjustment interval represents the time period that a particular adjustment + # (a discount, minimum, or maximum) applies to the prices on a subscription. + # Adjustment intervals can be added to a subscription by specifying them in the + # `add_adjustments` array, or modified via the `edit_adjustments` array. When + # creating an adjustment interval, you'll need to provide the definition of the + # new adjustment (the type of adjustment, and which prices it applies to), as well + # as the start and end dates for the adjustment interval. The start and end dates + # of an existing adjustment interval can be edited via the `edit_adjustments` + # field (just like price intervals). (To "change" the amount of a discount, + # minimum, or maximum, then, you'll need to end the existing interval, and create + # a new adjustment interval with the new amount and a start date that matches the + # end date of the previous interval.) + # + # ## Editing price intervals + # + # Price intervals can be adjusted by specifying edits to make in the `edit` array. + # A `price_interval_id` to edit must be specified — this can be retrieved from the + # `price_intervals` field on the subscription. + # + # A new `start_date` or `end_date` can be specified to change the range of the + # price interval, which will modify past or future invoices to ensure correctness. + # If either of these dates are unspecified, they will default to the existing date + # on the price interval. To remove a price interval entirely from a subscription, + # set the `end_date` to be equivalent to the `start_date`. + # + # ## Fixed fee quantity transitions + # + # The fixed fee quantity transitions for a fixed fee price interval can also be + # specified when adding or editing by passing an array for + # `fixed_fee_quantity_transitions`. A fixed fee quantity transition must have a + # `quantity` and an `effective_date`, which is the date after which the new + # quantity will be used for billing. If a fixed fee quantity transition is + # scheduled at a billing period boundary, the full quantity will be billed on an + # invoice with the other prices on the subscription. If the fixed fee quantity + # transition is scheduled mid-billing period, the difference between the existing + # quantity and quantity specified in the transition will be prorated for the rest + # of the billing period and billed immediately, which will generate a new invoice. + # + # Notably, the list of fixed fee quantity transitions passed will overwrite the + # existing fixed fee quantity transitions on the price interval, so the entire + # list of transitions must be specified to add additional transitions. The + # existing list of transitions can be retrieved using the + # `fixed_fee_quantity_transitions` property on a subscription’s serialized price + # intervals. + # + # @param subscription_id [String] + # + # @param params [Orb::Models::SubscriptionPriceIntervalsParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :add A list of price intervals to add to the subscription. + # + # @option params [Array] :add_adjustments A list of adjustments to add to the subscription. + # + # @option params [Array] :edit A list of price intervals to edit on the subscription. + # + # @option params [Array] :edit_adjustments A list of adjustments to edit on the subscription. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::SubscriptionPriceIntervalsResponse] + # + def price_intervals(subscription_id, params = {}) + parsed, options = Orb::Models::SubscriptionPriceIntervalsParams.dump_request(params) + @client.request( method: :post, - path: "/subscriptions/#{subscription_id}/trigger_phase", - body: { - effective_date: effective_date - }, - query: nil - } - - @client.request(model: Orb::Models::Subscription, **request) + path: ["subscriptions/%0s/price_intervals", subscription_id], + body: parsed, + model: Orb::Models::SubscriptionPriceIntervalsResponse, + options: options + ) end - def unschedule_cancellation(subscription_id) - request = { + + # This endpoint can be used to change an existing subscription's plan. It returns + # the serialized updated subscription object. + # + # The body parameter `change_option` determines when the plan change occurrs. Orb + # supports three options: + # + # - `end_of_subscription_term`: changes the plan at the end of the existing plan's + # term. + # - Issuing this plan change request for a monthly subscription will keep the + # existing plan active until the start of the subsequent month. Issuing this + # plan change request for a yearly subscription will keep the existing plan + # active for the full year. Charges incurred in the remaining period will be + # invoiced as normal. + # - Example: The plan is billed monthly on the 1st of the month, the request is + # made on January 15th, so the plan will be changed on February 1st, and + # invoice will be issued on February 1st for the last month of the original + # plan. + # - `immediate`: changes the plan immediately. + # - Subscriptions that have their plan changed with this option will move to the + # new plan immediately, and be invoiced immediately. + # - This invoice will include any usage fees incurred in the billing period up + # to the change, along with any prorated recurring fees for the billing + # period, if applicable. + # - Example: The plan is billed monthly on the 1st of the month, the request is + # made on January 15th, so the plan will be changed on January 15th, and an + # invoice will be issued for the partial month, from January 1 to January 15, + # on the original plan. + # - `requested_date`: changes the plan on the requested date (`change_date`). + # - If no timezone is provided, the customer's timezone is used. The + # `change_date` body parameter is required if this option is chosen. + # - Example: The plan is billed monthly on the 1st of the month, the request is + # made on January 15th, with a requested `change_date` of February 15th, so + # the plan will be changed on February 15th, and invoices will be issued on + # February 1st and February 15th. + # + # Note that one of `plan_id` or `external_plan_id` is required in the request body + # for this operation. + # + # ## Customize your customer's subscriptions + # + # Prices and adjustments in a plan can be added, removed, or replaced on the + # subscription when you schedule the plan change. This is useful when a customer + # has prices that differ from the default prices for a specific plan. + # + # + # This feature is only available for accounts that have migrated to Subscription Overrides Version 2. You can find your + # Subscription Overrides Version at the bottom of your [Plans page](https://app.withorb.com/plans) + # + # + # ### Adding Prices + # + # To add prices, provide a list of objects with the key `add_prices`. An object in + # the list must specify an existing add-on price with a `price_id` or + # `external_price_id` field, or create a new add-on price by including an object + # with the key `price`, identical to what would be used in the request body for + # the [create price endpoint](/api-reference/price/create-price). See the + # [Price resource](/product-catalog/price-configuration) for the specification of + # different price model configurations possible in this object. + # + # If the plan has phases, each object in the list must include a number with + # `plan_phase_order` key to indicate which phase the price should be added to. + # + # An object in the list can specify an optional `start_date` and optional + # `end_date`. This is equivalent to creating a price interval with the + # [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). + # If unspecified, the start or end date of the phase or subscription will be used. + # + # An object in the list can specify an optional `minimum_amount`, + # `maximum_amount`, or `discounts`. This will create adjustments which apply only + # to this price. + # + # Additionally, an object in the list can specify an optional `reference_id`. This + # ID can be used to reference this price when + # [adding an adjustment](#adding-adjustments) in the same API call. However the ID + # is _transient_ and cannot be used to refer to the price in future API calls. + # + # ### Removing Prices + # + # To remove prices, provide a list of objects with the key `remove_prices`. An + # object in the list must specify a plan price with either a `price_id` or + # `external_price_id` field. + # + # ### Replacing Prices + # + # To replace prices, provide a list of objects with the key `replace_prices`. An + # object in the list must specify a plan price to replace with the + # `replaces_price_id` key, and it must specify a price to replace it with by + # either referencing an existing add-on price with a `price_id` or + # `external_price_id` field, or by creating a new add-on price by including an + # object with the key `price`, identical to what would be used in the request body + # for the [create price endpoint](/api-reference/price/create-price). See the + # [Price resource](/product-catalog/price-configuration) for the specification of + # different price model configurations possible in this object. + # + # For fixed fees, an object in the list can supply a `fixed_price_quantity` + # instead of a `price`, `price_id`, or `external_price_id` field. This will update + # only the quantity for the price, similar to the + # [Update price quantity](/api-reference/subscription/update-price-quantity) + # endpoint. + # + # The replacement price will have the same phase, if applicable, and the same + # start and end dates as the price it replaces. + # + # An object in the list can specify an optional `minimum_amount`, + # `maximum_amount`, or `discounts`. This will create adjustments which apply only + # to this price. + # + # Additionally, an object in the list can specify an optional `reference_id`. This + # ID can be used to reference the replacement price when + # [adding an adjustment](#adding-adjustments) in the same API call. However the ID + # is _transient_ and cannot be used to refer to the price in future API calls. + # + # ### Adding adjustments + # + # To add adjustments, provide a list of objects with the key `add_adjustments`. An + # object in the list must include an object with the key `adjustment`, identical + # to the adjustment object in the + # [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). + # + # If the plan has phases, each object in the list must include a number with + # `plan_phase_order` key to indicate which phase the adjustment should be added + # to. + # + # An object in the list can specify an optional `start_date` and optional + # `end_date`. If unspecified, the start or end date of the phase or subscription + # will be used. + # + # ### Removing adjustments + # + # To remove adjustments, provide a list of objects with the key + # `remove_adjustments`. An object in the list must include a key, `adjustment_id`, + # with the ID of the adjustment to be removed. + # + # ### Replacing adjustments + # + # To replace adjustments, provide a list of objects with the key + # `replace_adjustments`. An object in the list must specify a plan adjustment to + # replace with the `replaces_adjustment_id` key, and it must specify an adjustment + # to replace it with by including an object with the key `adjustment`, identical + # to the adjustment object in the + # [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). + # + # The replacement adjustment will have the same phase, if applicable, and the same + # start and end dates as the adjustment it replaces. + # + # ## Price overrides (DEPRECATED) + # + # + # Price overrides are being phased out in favor adding/removing/replacing prices. (See + # [Customize your customer's subscriptions](/api-reference/subscription/schedule-plan-change)) + # + # + # Price overrides are used to update some or all prices in a plan for the specific + # subscription being created. This is useful when a new customer has negotiated a + # rate that is unique to the customer. + # + # To override prices, provide a list of objects with the key `price_overrides`. + # The price object in the list of overrides is expected to contain the existing + # price id, the `model_type` and configuration. (See the + # [Price resource](/product-catalog/price-configuration) for the specification of + # different price model configurations.) The numerical values can be updated, but + # the billable metric, cadence, type, and name of a price can not be overridden. + # + # ### Maximums, and minimums + # + # Price overrides are used to update some or all prices in the target plan. + # Minimums and maximums, much like price overrides, can be useful when a new + # customer has negotiated a new or different minimum or maximum spend cap than the + # default for the plan. The request format for maximums and minimums is the same + # as those in [subscription creation](create-subscription). + # + # ## Scheduling multiple plan changes + # + # When scheduling multiple plan changes with the same date, the latest plan change + # on that day takes effect. + # + # ## Prorations for in-advance fees + # + # By default, Orb calculates the prorated difference in any fixed fees when making + # a plan change, adjusting the customer balance as needed. For details on this + # behavior, see + # [Modifying subscriptions](/product-catalog/modifying-subscriptions#prorations-for-in-advance-fees). + # + # @param subscription_id [String] + # + # @param params [Orb::Models::SubscriptionSchedulePlanChangeParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ChangeOption] :change_option + # + # @option params [Array, nil] :add_adjustments Additional adjustments to be added to the subscription. (Only available for + # accounts that have migrated off of legacy subscription overrides) + # + # @option params [Array, nil] :add_prices Additional prices to be added to the subscription. (Only available for accounts + # that have migrated off of legacy subscription overrides) + # + # @option params [Boolean, nil] :align_billing_with_plan_change_date [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be + # aligned with the plan change's effective date. + # + # @option params [Boolean, nil] :auto_collection Determines whether issued invoices for this subscription will automatically be + # charged with the saved payment method on the due date. If not specified, this + # defaults to the behavior configured for this customer. + # + # @option params [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAlignment, nil] :billing_cycle_alignment Reset billing periods to be aligned with the plan change's effective date or + # start of the month. Defaults to `unchanged` which keeps subscription's existing + # billing cycle alignment. + # + # @option params [Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAnchorConfiguration, nil] :billing_cycle_anchor_configuration + # + # @option params [Time, nil] :change_date The date that the plan change should take effect. This parameter can only be + # passed if the `change_option` is `requested_date`. If a date with no time is + # passed, the plan change will happen at midnight in the customer's timezone. + # + # @option params [String, nil] :coupon_redemption_code Redemption code to be used for this subscription. If the coupon cannot be found + # by its redemption code, or cannot be redeemed, an error response will be + # returned and the subscription creation or plan change will not be scheduled. + # + # @option params [Float, nil] :credits_overage_rate + # + # @option params [String, nil] :default_invoice_memo Determines the default memo on this subscription's invoices. Note that if this + # is not provided, it is determined by the plan configuration. + # + # @option params [String, nil] :external_plan_id The external_plan_id of the plan that the given subscription should be switched + # to. Note that either this property or `plan_id` must be specified. + # + # @option params [String, nil] :filter An additional filter to apply to usage queries. This filter must be expressed as + # a boolean + # [computed property](/extensibility/advanced-metrics#computed-properties). If + # null, usage queries will not include any additional filter. + # + # @option params [Integer, nil] :initial_phase_order The phase of the plan to start with + # + # @option params [String, nil] :invoicing_threshold When this subscription's accrued usage reaches this threshold, an invoice will + # be issued for the subscription. If not specified, invoices will only be issued + # at the end of the billing period. + # + # @option params [Integer, nil] :net_terms The net terms determines the difference between the invoice date and the issue + # date for the invoice. If you intend the invoice to be due on issue, set this + # to 0. If not provided, this defaults to the value specified in the plan. + # + # @option params [Float, nil] :per_credit_overage_amount + # + # @option params [String, nil] :plan_id The plan that the given subscription should be switched to. Note that either + # this property or `external_plan_id` must be specified. + # + # @option params [Integer, nil] :plan_version_number Specifies which version of the plan to change to. If null, the default version + # will be used. + # + # @option params [Array, nil] :price_overrides Optionally provide a list of overrides for prices on the plan + # + # @option params [Array, nil] :remove_adjustments Plan adjustments to be removed from the subscription. (Only available for + # accounts that have migrated off of legacy subscription overrides) + # + # @option params [Array, nil] :remove_prices Plan prices to be removed from the subscription. (Only available for accounts + # that have migrated off of legacy subscription overrides) + # + # @option params [Array, nil] :replace_adjustments Plan adjustments to be replaced with additional adjustments on the subscription. + # (Only available for accounts that have migrated off of legacy subscription + # overrides) + # + # @option params [Array, nil] :replace_prices Plan prices to be replaced with additional prices on the subscription. (Only + # available for accounts that have migrated off of legacy subscription overrides) + # + # @option params [Integer, nil] :trial_duration_days The duration of the trial period in days. If not provided, this defaults to the + # value specified in the plan. If `0` is provided, the trial on the plan will be + # skipped. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::SubscriptionSchedulePlanChangeResponse] + # + def schedule_plan_change(subscription_id, params) + parsed, options = Orb::Models::SubscriptionSchedulePlanChangeParams.dump_request(params) + @client.request( method: :post, - path: "/subscriptions/#{subscription_id}/unschedule_cancellation", - query: nil - } + path: ["subscriptions/%0s/schedule_plan_change", subscription_id], + body: parsed, + model: Orb::Models::SubscriptionSchedulePlanChangeResponse, + options: options + ) + end - @client.request(model: Orb::Models::Subscription, **request) + # Manually trigger a phase, effective the given date (or the current time, if not + # specified). + # + # @param subscription_id [String] + # + # @param params [Orb::Models::SubscriptionTriggerPhaseParams, Hash{Symbol=>Object}] . + # + # @option params [Date, nil] :effective_date The date on which the phase change should take effect. If not provided, defaults + # to today in the customer's timezone. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::SubscriptionTriggerPhaseResponse] + # + def trigger_phase(subscription_id, params = {}) + parsed, options = Orb::Models::SubscriptionTriggerPhaseParams.dump_request(params) + @client.request( + method: :post, + path: ["subscriptions/%0s/trigger_phase", subscription_id], + body: parsed, + model: Orb::Models::SubscriptionTriggerPhaseResponse, + options: options + ) end - def unschedule_fixed_fee_quantity_updates( - subscription_id, - price_id: Orb::NotGiven.instance - ) - request = { + + # This endpoint can be used to unschedule any pending cancellations for a + # subscription. + # + # To be eligible, the subscription must currently be active and have a future + # cancellation. This operation will turn on auto-renew, ensuring that the + # subscription does not end at the currently scheduled cancellation time. + # + # @param subscription_id [String] + # + # @param params [Orb::Models::SubscriptionUnscheduleCancellationParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::SubscriptionUnscheduleCancellationResponse] + # + def unschedule_cancellation(subscription_id, params = {}) + @client.request( method: :post, - path: - "/subscriptions/#{subscription_id}/unschedule_fixed_fee_quantity_updates", - body: { - price_id: price_id - }, - query: nil - } + path: ["subscriptions/%0s/unschedule_cancellation", subscription_id], + model: Orb::Models::SubscriptionUnscheduleCancellationResponse, + options: params[:request_options] + ) + end - @client.request(model: Orb::Models::Subscription, **request) + # This endpoint can be used to clear scheduled updates to the quantity for a fixed + # fee. + # + # If there are no updates scheduled, a request validation error will be returned + # with a 400 status code. + # + # @param subscription_id [String] + # + # @param params [Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesParams, Hash{Symbol=>Object}] . + # + # @option params [String] :price_id Price for which the updates should be cleared. Must be a fixed fee. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse] + # + def unschedule_fixed_fee_quantity_updates(subscription_id, params) + parsed, options = Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesParams.dump_request(params) + @client.request( + method: :post, + path: ["subscriptions/%0s/unschedule_fixed_fee_quantity_updates", subscription_id], + body: parsed, + model: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, + options: options + ) end - def unschedule_pending_plan_changes(subscription_id) - request = { + + # This endpoint can be used to unschedule any pending plan changes on an existing + # subscription. + # + # @param subscription_id [String] + # + # @param params [Orb::Models::SubscriptionUnschedulePendingPlanChangesParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse] + # + def unschedule_pending_plan_changes(subscription_id, params = {}) + @client.request( method: :post, - path: - "/subscriptions/#{subscription_id}/unschedule_pending_plan_changes", - query: nil - } + path: ["subscriptions/%0s/unschedule_pending_plan_changes", subscription_id], + model: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse, + options: params[:request_options] + ) + end - @client.request(model: Orb::Models::Subscription, **request) + # This endpoint can be used to update the quantity for a fixed fee. + # + # To be eligible, the subscription must currently be active and the price + # specified must be a fixed fee (not usage-based). This operation will immediately + # update the quantity for the fee, or if a `effective_date` is passed in, will + # update the quantity on the requested date at midnight in the customer's + # timezone. + # + # In order to change the fixed fee quantity as of the next draft invoice for this + # subscription, pass `change_option=upcoming_invoice` without an `effective_date` + # specified. + # + # If the fee is an in-advance fixed fee, it will also issue an immediate invoice + # for the difference for the remainder of the billing period. + # + # @param subscription_id [String] + # + # @param params [Orb::Models::SubscriptionUpdateFixedFeeQuantityParams, Hash{Symbol=>Object}] . + # + # @option params [String] :price_id Price for which the quantity should be updated. Must be a fixed fee. + # + # @option params [Float] :quantity + # + # @option params [Symbol, Orb::Models::SubscriptionUpdateFixedFeeQuantityParams::ChangeOption] :change_option Determines when the change takes effect. Note that if `effective_date` is + # specified, this defaults to `effective_date`. Otherwise, this defaults to + # `immediate` unless it's explicitly set to `upcoming_invoice. + # + # @option params [Date, nil] :effective_date The date that the quantity change should take effect, localized to the + # customer's timezone. Ifthis parameter is not passed in, the quantity change is + # effective according to `change_option`. + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse] + # + def update_fixed_fee_quantity(subscription_id, params) + parsed, options = Orb::Models::SubscriptionUpdateFixedFeeQuantityParams.dump_request(params) + @client.request( + method: :post, + path: ["subscriptions/%0s/update_fixed_fee_quantity", subscription_id], + body: parsed, + model: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse, + options: options + ) end - def update_fixed_fee_quantity( - subscription_id, - price_id: Orb::NotGiven.instance, - quantity: Orb::NotGiven.instance, - change_option: Orb::NotGiven.instance, - effective_date: Orb::NotGiven.instance - ) - request = { + + # This endpoint is used to update the trial end date for a subscription. The new + # trial end date must be within the time range of the current plan (i.e. the new + # trial end date must be on or after the subscription's start date on the current + # plan, and on or before the subscription end date). + # + # In order to retroactively remove a trial completely, the end date can be set to + # the transition date of the subscription to this plan (or, if this is the first + # plan for this subscription, the subscription's start date). In order to end a + # trial immediately, the keyword `immediate` can be provided as the trial end + # date. + # + # By default, Orb will shift only the trial end date (and price intervals that + # start or end on the previous trial end date), and leave all other future price + # intervals untouched. If the `shift` parameter is set to `true`, Orb will shift + # all subsequent price and adjustment intervals by the same amount as the trial + # end date shift (so, e.g., if a plan change is scheduled or an add-on price was + # added, that change will be pushed back by the same amount of time the trial is + # extended). + # + # @param subscription_id [String] + # + # @param params [Orb::Models::SubscriptionUpdateTrialParams, Hash{Symbol=>Object}] . + # + # @option params [Time, Symbol, Orb::Models::SubscriptionUpdateTrialParams::TrialEndDate::UnionMember1] :trial_end_date The new date that the trial should end, or the literal string `immediate` to end + # the trial immediately. + # + # @option params [Boolean] :shift If true, shifts subsequent price and adjustment intervals (preserving their + # durations, but adjusting their absolute dates). + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::SubscriptionUpdateTrialResponse] + # + def update_trial(subscription_id, params) + parsed, options = Orb::Models::SubscriptionUpdateTrialParams.dump_request(params) + @client.request( method: :post, - path: "/subscriptions/#{subscription_id}/update_fixed_fee_quantity", - body: { - price_id: price_id, - quantity: quantity, - change_option: change_option, - effective_date: effective_date - }, - query: nil - } + path: ["subscriptions/%0s/update_trial", subscription_id], + body: parsed, + model: Orb::Models::SubscriptionUpdateTrialResponse, + options: options + ) + end - @client.request(model: Orb::Models::Subscription, **request) + # @param client [Orb::Client] + # + def initialize(client:) + @client = client end end end diff --git a/lib/orb/resources/top_level.rb b/lib/orb/resources/top_level.rb index 52090071..16431906 100644 --- a/lib/orb/resources/top_level.rb +++ b/lib/orb/resources/top_level.rb @@ -1,15 +1,34 @@ -require "orb/models/top_level_ping_response" +# frozen_string_literal: true + module Orb module Resources - class TopLevelResource - attr_reader - def initialize(client:) - @client = client + class TopLevel + # This endpoint allows you to test your connection to the Orb API and check the + # validity of your API key, passed in the Authorization header. This is + # particularly useful for checking that your environment is set up properly, and + # is a great choice for connectors and integrations. + # + # This API does not have any side-effects or return any Orb resources. + # + # @param params [Orb::Models::TopLevelPingParams, Hash{Symbol=>Object}] . + # + # @option params [Orb::RequestOptions, Hash{Symbol=>Object}] :request_options + # + # @return [Orb::Models::TopLevelPingResponse] + # + def ping(params = {}) + @client.request( + method: :get, + path: "ping", + model: Orb::Models::TopLevelPingResponse, + options: params[:request_options] + ) end - def ping - request = { method: :get, path: "/ping", query: nil } - @client.request(model: Orb::Models::TopLevelPingResponse, **request) + # @param client [Orb::Client] + # + def initialize(client:) + @client = client end end end diff --git a/lib/orb/util.rb b/lib/orb/util.rb index 017cd756..daaf0f5c 100644 --- a/lib/orb/util.rb +++ b/lib/orb/util.rb @@ -1,16 +1,460 @@ -# typed: true +# frozen_string_literal: true + module Orb - class Util - # recursively merge one hash with another. - # If the values at a given key are not both hashes, just take the new value. - def self.deep_merge(left, right) - left.merge(right) do |_k, old_val, new_val| - if old_val.is_a?(Hash) && new_val.is_a?(Hash) - deep_merge(old_val, new_val) + # rubocop:disable Metrics/ModuleLength + + # @private + # + module Util + # @private + # + # @param input [Object] + # + # @return [Boolean, Object] + # + def self.primitive?(input) + case input + in true | false | Integer | Float | Symbol | String + true + else + false + end + end + + # @private + # + # @param input [Object] + # + # @return [Boolean, Object] + # + def self.coerce_boolean(input) + case input.is_a?(String) ? input.downcase : input + in Numeric + !input.zero? + in "true" + true + in "false" + false + else + input + end + end + + # @private + # + # @param input [Object] + # + # @raise [ArgumentError] + # @return [Boolean, nil] + # + def self.coerce_boolean!(input) + case (coerced = coerce_boolean(input)) + in true | false | nil + coerced + else + raise ArgumentError.new("Unable to coerce #{input.inspect} into boolean value") + end + end + + # @private + # + # @param input [Object] + # + # @return [Integer, Object] + # + def self.coerce_integer(input) + case input + in true + 1 + in false + 0 + else + Integer(input, exception: false) || input + end + end + + # @private + # + # @param input [Object] + # + # @return [Float, Object] + # + def self.coerce_float(input) + case input + in true + 1.0 + in false + 0.0 + else + Float(input, exception: false) || input + end + end + + # @private + # + # @param input [Object] + # + # @return [Hash{Object=>Object}, Object] + # + def self.coerce_hash(input) + case input + in NilClass | Array | Set | Enumerator + input + else + input.respond_to?(:to_h) ? input.to_h : input + end + end + + # @private + # + # @param exceptions [Array] + # @param sentinel [Object, nil] + # @param blk [Proc, nil] + # + # @return [Object, nil] + # + def self.suppress(*exceptions, sentinel: nil, &blk) + blk.call + rescue *exceptions + sentinel + end + + # Use this to indicate that a value should be explicitly removed from a data + # structure when using `Orb::Util.deep_merge`. + # + # e.g. merging `{a: 1}` and `{a: OMIT}` should produce `{}`, where merging + # `{a: 1}` and `{}` would produce `{a: 1}`. + OMIT = Object.new.freeze + + # @private + # + # Recursively merge one hash with another. If the values at a given key are not + # both hashes, just take the new value. + # + # @param values [Array] + # + # @param sentinel [Object, nil] the value to return if no values are provided. + # + # @param concat [Boolean] whether to merge sequences by concatenation. + # + # @return [Object] + # + def self.deep_merge(*values, sentinel: nil, concat: false) + case values + in [value, *values] + values.reduce(value) do |acc, val| + deep_merge_lr(acc, val, concat: concat) + end + else + sentinel + end + end + + # @private + # + # @param lhs [Object] + # @param rhs [Object] + # @param concat [Boolean] + # + # @return [Object] + # + private_class_method def self.deep_merge_lr(lhs, rhs, concat: false) + rhs_cleaned = + case rhs + in Hash + rhs.reject { |_, value| value == OMIT } else - new_val + rhs end + + case [lhs, rhs_cleaned, concat] + in [Hash, Hash, _] + lhs + .reject { |key, _| rhs[key] == OMIT } + .merge(rhs_cleaned) do |_, old_val, new_val| + deep_merge_lr(old_val, new_val, concat: concat) + end + in [Array, Array, true] + lhs.concat(rhs_cleaned) + else + rhs_cleaned + end + end + + # @private + # + # @param data [Hash{Symbol=>Object}, Array, Object] + # @param pick [Symbol, Integer, Array, nil] + # @param sentinel [Object, nil] + # @param blk [Proc, nil] + # + # @return [Object, nil] + # + def self.dig(data, pick, sentinel = nil, &blk) + case [data, pick, blk] + in [_, nil, nil] + data + in [Hash, Symbol, _] | [Array, Integer, _] + blk.nil? ? data.fetch(pick, sentinel) : data.fetch(pick, &blk) + in [Hash | Array, Array, _] + pick.reduce(data) do |acc, key| + case acc + in Hash if acc.key?(key) + acc.fetch(key) + in Array if key.is_a?(Integer) && key < acc.length + acc[key] + else + return blk.nil? ? sentinel : blk.call + end + end + in _ + blk.nil? ? sentinel : blk.call + end + end + + # @private + # + # @param uri [URI::Generic] + # + # @return [String] + # + def self.uri_origin(uri) + "#{uri.scheme}://#{uri.host}#{uri.port == uri.default_port ? '' : ":#{uri.port}"}" + end + + # @private + # + # @param path [String, Array] + # + # @return [String] + # + def self.interpolate_path(path) + case path + in String + path + in [] + "" + in [String, *interpolations] + encoded = interpolations.map { |v| ERB::Util.url_encode(v) } + path.first % encoded + end + end + + # @private + # + # @param url [URI::Generic, String] + # + # @return [Hash{Symbol=>String, Integer, nil}] + # + def self.parse_uri(url) + parsed = URI::Generic.component.zip(URI.split(url)).to_h + {**parsed, query: decode_query(parsed.fetch(:query))} + end + + # @private + # + # @param parsed [Hash{Symbol=>String, Integer, nil}] . + # + # @option parsed [String, nil] :scheme + # + # @option parsed [String, nil] :host + # + # @option parsed [Integer, nil] :port + # + # @option parsed [String, nil] :path + # + # @option parsed [Hash{String=>Array}] :query + # + # @return [URI::Generic] + # + def self.unparse_uri(parsed) + URI::Generic.build(**parsed, query: encode_query(parsed.fetch(:query))) + end + + # @private + # + # @param lhs [Hash{Symbol=>String, Integer, nil}] . + # + # @option lhs [String, nil] :scheme + # + # @option lhs [String, nil] :host + # + # @option lhs [Integer, nil] :port + # + # @option lhs [String, nil] :path + # + # @option lhs [Hash{String=>Array}] :query + # + # @param rhs [Hash{Symbol=>String, Integer, nil}] . + # + # @option rhs [String, nil] :scheme + # + # @option rhs [String, nil] :host + # + # @option rhs [Integer, nil] :port + # + # @option rhs [String, nil] :path + # + # @option rhs [Hash{String=>Array}] :query + # + # @option rhs [Hash{String=>Array}] :extra_query + # + # @return [URI::Generic] + # + def self.join_parsed_uri(lhs, rhs) + base_path, base_query = lhs.fetch_values(:path, :query) + slashed = base_path.end_with?("/") ? base_path : "#{base_path}/" + + parsed_path, parsed_query = parse_uri(rhs.fetch(:path)).fetch_values(:path, :query) + override = URI::Generic.build(**rhs.slice(:scheme, :host, :port), path: parsed_path) + + joined = URI.join(URI::Generic.build(lhs.except(:path, :query)), slashed, override) + query = deep_merge( + joined.path == base_path ? base_query : {}, + parsed_query, + *rhs.values_at(:query, :extra_query).compact, + concat: true + ) + + joined.query = encode_query(query) + joined + end + + # @private + # + # @param query [String, nil] + # + # @return [Hash{String=>Array}] + # + def self.decode_query(query) + CGI.parse(query.to_s) + end + + # @private + # + # @param query [Hash{String=>Array, String, nil}] + # + # @return [String, nil] + # + def self.encode_query(query) + query.empty? ? nil : URI.encode_www_form(query) + end + + # @private + # + # @param headers [ArrayString, Integer, nil}>] + # + # @return [Hash{String=>String}] + # + def self.normalized_headers(*headers) + {}.merge(*headers.compact).to_h do |key, val| + [key.downcase, val&.to_s&.strip] + end + end + + # @private + # + # @param headers [Hash{String=>String}] + # @param body [Object] + # + # @return [Object] + # + def self.encode_content(headers, body) + content_type = headers["content-type"] + case [content_type, body] + in ["application/json", Hash | Array] + [headers, JSON.fast_generate(body)] + in [%r{^multipart/form-data}, Hash | IO | StringIO] + boundary = SecureRandom.urlsafe_base64(60) + strio = StringIO.new.tap do |io| + case body + in Hash + body.each do |key, val| + case val + in Array if val.all? { primitive?(_1) } + val.each do |v| + encode_multipart_formdata(io, boundary: boundary, key: key, val: v) + end + else + encode_multipart_formdata(io, boundary: boundary, key: key, val: val) + end + end + else + encode_multipart_formdata(io, boundary: boundary, key: nil, val: body) + end + io << "--#{boundary}--\r\n" + io.rewind + end + headers = { + **headers, + "content-type" => "#{content_type}; boundary=#{boundary}", + "transfer-encoding" => "chunked" + } + [headers, strio] + else + [headers, body] + end + end + + # @private + # + # @param response [Net::HTTPResponse] + # @param suppress_error [Boolean] + # + # @raise [JSON::ParserError] + # @return [Object] + # + def self.decode_content(response, suppress_error: false) + case response.content_type + in "application/json" + begin + JSON.parse(response.body, symbolize_names: true) + rescue JSON::ParserError => e + raise e unless suppress_error + response.body + end + else + # TODO: parsing other response types + response.body + end + end + + # @private + # + # @param io [StringIO] + # @param boundary [String] + # @param key [Symbol, String] + # @param val [Object] + # + private_class_method def self.encode_multipart_formdata(io, boundary:, key:, val:) + io << "--#{boundary}\r\n" + io << "Content-Disposition: form-data" + unless key.nil? + name = ERB::Util.url_encode(key.to_s) + io << "; name=\"#{name}\"" + end + if val.is_a?(IO) + filename = ERB::Util.url_encode(File.basename(val.to_path)) + io << "; filename=\"#{filename}\"" + end + io << "\r\n" + case val + in IO | StringIO + io << "Content-Type: application/octet-stream\r\n\r\n" + IO.copy_stream(val, io) + in String + io << "Content-Type: application/octet-stream\r\n\r\n" + io << val.to_s + in true | false | Integer | Float | Symbol + io << "Content-Type: text/plain\r\n\r\n" + io << val.to_s + else + io << "Content-Type: application/json\r\n\r\n" + io << JSON.fast_generate(val) end + io << "\r\n" end end + + # rubocop:enable Metrics/ModuleLength end diff --git a/lib/orb/version.rb b/lib/orb/version.rb new file mode 100644 index 00000000..2ee7a1d4 --- /dev/null +++ b/lib/orb/version.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +module Orb + VERSION = "0.0.1-alpha.0" +end diff --git a/manifest.yaml b/manifest.yaml new file mode 100644 index 00000000..f4a60a7a --- /dev/null +++ b/manifest.yaml @@ -0,0 +1,12 @@ +dependencies: + - cgi + - date + - erb + - etc + - json + - net/http + - securerandom + - set + - stringio + - time + - uri diff --git a/orb.gemspec b/orb.gemspec new file mode 100644 index 00000000..c53793e9 --- /dev/null +++ b/orb.gemspec @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require_relative "lib/orb/version" + +Gem::Specification.new do |s| + s.name = "orb" + s.version = Orb::VERSION + s.summary = "Ruby library to access the Orb API" + s.authors = ["Orb"] + s.email = "team@withorb.com" + s.files = Dir["lib/**/*.rb"] + s.extra_rdoc_files = ["README.md"] + s.required_ruby_version = ">= 3.0.0" + s.add_dependency "connection_pool" + s.homepage = "https://gemdocs.org/gems/orb/latest" + s.metadata["homepage_uri"] = s.homepage + s.metadata["source_code_uri"] = "https://github.com/orbcorp/orb-ruby" + s.metadata["rubygems_mfa_required"] = "true" +end diff --git a/rbi/base_client.rbi b/rbi/base_client.rbi deleted file mode 100644 index d12152bc..00000000 --- a/rbi/base_client.rbi +++ /dev/null @@ -1,6 +0,0 @@ -# typed: true - -class BaseClient - sig { params(requester: T.nilable(String)).void } - def initialize(requester:); end -end diff --git a/rbi/lib/orb/base_client.rbi b/rbi/lib/orb/base_client.rbi new file mode 100644 index 00000000..62ffa02d --- /dev/null +++ b/rbi/lib/orb/base_client.rbi @@ -0,0 +1,146 @@ +# typed: strong + +module Orb + class BaseClient + abstract! + + RequestShape = T.type_alias do + { + method: Symbol, + path: T.any(String, T::Array[String]), + query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]), + headers: T.nilable(T::Hash[String, T.nilable(String)]), + body: T.nilable(T.anything), + unwrap: T.nilable(Symbol), + page: T.nilable(T::Class[Orb::BaseModel]), + model: T.nilable(Orb::Converter::Input), + options: T.nilable( + T.any( + Orb::RequestOptions, + Orb::RequestOptions::Shape, + T::Hash[Symbol, T.anything] + ) + ) + } + end + + NormalizedRequestShape = T.type_alias do + { + method: Symbol, + url: URI::Generic, + headers: T::Hash[String, String], + body: T.anything, + max_retries: Integer, + timeout: Float + } + end + + MAX_REDIRECTS = 20 + + sig { params(req: Orb::BaseClient::RequestShape).void } + def self.validate!(req); end + + # @private + # + sig { returns(T.anything) } + attr_accessor :requester + + sig do + params( + base_url: String, + timeout: Float, + max_retries: Integer, + initial_retry_delay: Float, + max_retry_delay: Float, + headers: T::Hash[String, T.nilable(String)], + idempotency_header: T.nilable(String) + ).void + end + def initialize( + base_url:, + timeout: 0.0, + max_retries: 0, + initial_retry_delay: 0.0, + max_retry_delay: 0.0, + headers: {}, + idempotency_header: nil + ); end + + sig { overridable.returns(T::Hash[String, String]) } + private def auth_headers; end + + sig { returns(String) } + private def generate_idempotency_key; end + + sig do + params( + req: Orb::BaseClient::RequestShape, + opts: Orb::RequestOptions::Shape + ).returns(Orb::BaseClient::NormalizedRequestShape) + end + private def build_request(req, opts); end + + sig { params(status: Integer, headers: T::Hash[String, String]).returns(T::Boolean) } + private def should_retry?(status, headers:); end + + sig { params(headers: T::Hash[String, String], retry_count: Integer).returns(Float) } + private def retry_delay(headers, retry_count:); end + + sig do + params( + request: Orb::BaseClient::NormalizedRequestShape, + status: Integer, + location_header: String + ).returns(Orb::BaseClient::NormalizedRequestShape) + end + private def follow_redirect(request, status:, location_header:); end + + sig do + params( + request: Orb::BaseClient::NormalizedRequestShape, + redirect_count: Integer, + retry_count: Integer, + send_retry_header: T::Boolean + ).returns(Net::HTTPResponse) + end + private def send_request(request, redirect_count:, retry_count:, send_retry_header:); end + + sig { params(req: Orb::BaseClient::RequestShape, response: NilClass).returns(T.anything) } + private def parse_response(req, response); end + + sig do + params( + method: Symbol, + path: T.any(String, T::Array[String]), + query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]), + headers: T.nilable(T::Hash[String, T.nilable(String)]), + body: T.nilable(T.anything), + unwrap: T.nilable(Symbol), + page: T.nilable(T::Class[Orb::BaseModel]), + model: T.nilable(Orb::Converter::Input), + options: T.nilable( + T.any( + Orb::RequestOptions, + Orb::RequestOptions::Shape, + T::Hash[Symbol, T.anything] + ) + ) + ).returns(T.anything) + end + def request( + method, + path, + query: {}, + headers: {}, + body: nil, + unwrap: nil, + page: nil, + model: Orb::Unknown, + options: {} + ) + end + + sig { returns(String) } + def inspect; end + end +end diff --git a/rbi/lib/orb/base_model.rbi b/rbi/lib/orb/base_model.rbi new file mode 100644 index 00000000..7882c1de --- /dev/null +++ b/rbi/lib/orb/base_model.rbi @@ -0,0 +1,436 @@ +# typed: strong + +module Orb + module Converter + abstract! + + Input = T.type_alias { T.any(Orb::Converter, T::Class[T.anything]) } + + sig { overridable.params(value: T.anything).returns(T.anything) } + def coerce(value); end + + sig { overridable.params(value: T.anything).returns(T.anything) } + def dump(value); end + + sig do + overridable.params(value: T.anything).returns( + T.any( + [T::Boolean, T.anything, NilClass], + [T::Boolean, T::Boolean, Integer] + ) + ) + end + def try_strict_coerce(value); end + + sig do + params( + spec: T.any( + { + const: T.nilable(T.any(NilClass, T::Boolean, Integer, Float, Symbol)), + enum: T.nilable(T.proc.returns(Orb::Converter::Input)), + union: T.nilable(T.proc.returns(Orb::Converter::Input)) + }, + T.proc.returns(Orb::Converter::Input), + Orb::Converter::Input + ) + ).returns(T.proc.returns(T.anything).void) + end + def self.type_info(spec); end + + sig { params(target: Orb::Converter::Input, value: T.anything).returns(T.anything) } + def self.coerce(target, value); end + + sig { params(target: Orb::Converter::Input, value: T.anything).returns(T.anything) } + def self.dump(target, value); end + + sig { params(target: Orb::Converter::Input, value: T.anything).returns(T.anything) } + def self.try_strict_coerce(target, value); end + end + + class Unknown + abstract! + + extend Orb::Converter + + sig { params(other: T.anything).returns(T::Boolean) } + def self.===(other); end + + sig { params(other: T.anything).returns(T::Boolean) } + def self.==(other); end + + sig { override.params(value: T.anything).returns(T.anything) } + def self.coerce(value); end + + sig { override.params(value: T.anything).returns(T.anything) } + def self.dump(value); end + + sig do + override.params(value: T.anything).returns( + T.any( + [T::Boolean, T.anything, NilClass], + [T::Boolean, T::Boolean, Integer] + ) + ) + end + def self.try_strict_coerce(value); end + end + + class BooleanModel + abstract! + + extend Orb::Converter + + sig { params(other: T.anything).returns(T::Boolean) } + def self.===(other); end + + sig { params(other: T.anything).returns(T::Boolean) } + def self.==(other); end + + sig { override.params(value: T.any(T::Boolean, T.anything)).returns(T.any(T::Boolean, T.anything)) } + def self.coerce(value); end + + sig { override.params(value: T.any(T::Boolean, T.anything)).returns(T.any(T::Boolean, T.anything)) } + def self.dump(value); end + + sig do + override.params(value: T.anything).returns( + T.any( + [T::Boolean, T.anything, NilClass], + [T::Boolean, T::Boolean, Integer] + ) + ) + end + def self.try_strict_coerce(value); end + end + + class Enum + abstract! + + extend Orb::Converter + + sig { overridable.returns(T::Array[T.any(NilClass, T::Boolean, Integer, Float, Symbol)]) } + def self.values; end + + sig { void } + private_class_method def self.finalize!; end + + sig { params(other: T.anything).returns(T::Boolean) } + def self.===(other); end + + sig { params(other: T.anything).returns(T::Boolean) } + def self.==(other); end + + sig { override.params(value: T.any(String, Symbol, T.anything)).returns(T.any(Symbol, T.anything)) } + def self.coerce(value); end + + sig { override.params(value: T.any(Symbol, T.anything)).returns(T.any(Symbol, T.anything)) } + def self.dump(value); end + + sig do + override.params(value: T.anything).returns( + T.any( + [T::Boolean, T.anything, NilClass], + [T::Boolean, T::Boolean, Integer] + ) + ) + end + def self.try_strict_coerce(value); end + end + + class Union + abstract! + + extend Orb::Extern + extend Orb::Converter + + sig { returns(T::Array[[T.nilable(Symbol), Proc]]) } + private_class_method def self.known_variants; end + + sig { overridable.returns(T::Array[[T.nilable(Symbol), T.anything]]) } + private_class_method def self.variants; end + + sig { params(property: Symbol).void } + private_class_method def self.discriminator(property); end + + sig do + params( + key: T.any( + Symbol, + T::Hash[Symbol, T.anything], + T.proc.returns(Orb::Converter::Input), + Orb::Converter::Input + ), + spec: T.any(T::Hash[Symbol, T.anything], T.proc.returns(Orb::Converter::Input), Orb::Converter::Input) + ).void + end + private_class_method def self.variant(key, spec = nil); end + + sig { params(value: T.anything).returns(T.nilable(Orb::Converter::Input)) } + private_class_method def self.resolve_variant(value); end + + sig { params(other: T.anything).returns(T::Boolean) } + def self.===(other); end + + sig { params(other: T.anything).returns(T::Boolean) } + def self.==(other); end + + sig { override.params(value: T.anything).returns(T.anything) } + def self.coerce(value); end + + sig { override.params(value: T.anything).returns(T.anything) } + def self.dump(value); end + + sig do + override.params(value: T.anything).returns( + T.any( + [T::Boolean, T.anything, NilClass], + [T::Boolean, T::Boolean, Integer] + ) + ) + end + def self.try_strict_coerce(value); end + end + + class ArrayOf + abstract! + + include Orb::Converter + + sig { params(other: T.anything).returns(T::Boolean) } + def ===(other); end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other); end + + sig do + override.params( + value: T.any( + T::Enumerable[T.anything], + T.anything + ) + ).returns(T.any(T::Array[T.anything], T.anything)) + end + def coerce(value); end + + sig do + override.params( + value: T.any( + T::Enumerable[T.anything], + T.anything + ) + ).returns(T.any(T::Array[T.anything], T.anything)) + end + def dump(value); end + + sig do + override.params(value: T.anything).returns( + T.any( + [T::Boolean, T.anything, NilClass], + [T::Boolean, T::Boolean, Integer] + ) + ) + end + def try_strict_coerce(value); end + + sig { returns(Orb::Converter::Input) } + protected def item_type; end + + sig do + params( + type_info: T.any( + T::Hash[Symbol, T.anything], + T.proc.returns(Orb::Converter::Input), + Orb::Converter::Input + ), + spec: T::Hash[Symbol, T.anything] + ).void + end + def initialize(type_info, spec = {}); end + end + + class HashOf + abstract! + + include Orb::Converter + + sig { params(other: T.anything).returns(T::Boolean) } + def ===(other); end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other); end + + sig do + override.params( + value: T.any( + T::Hash[T.anything, T.anything], + T.anything + ) + ).returns(T.any(T::Hash[Symbol, T.anything], T.anything)) + end + def coerce(value); end + + sig do + override.params( + value: T.any( + T::Hash[T.anything, T.anything], + T.anything + ) + ).returns(T.any(T::Hash[Symbol, T.anything], T.anything)) + end + def dump(value); end + + sig do + override.params(value: T.anything).returns( + T.any( + [T::Boolean, T.anything, NilClass], + [T::Boolean, T::Boolean, Integer] + ) + ) + end + def try_strict_coerce(value); end + + sig { returns(Orb::Converter::Input) } + protected def item_type; end + + sig do + params( + type_info: T.any( + T::Hash[Symbol, T.anything], + T.proc.returns(Orb::Converter::Input), + Orb::Converter::Input + ), + spec: T::Hash[Symbol, T.anything] + ).void + end + def initialize(type_info, spec = {}); end + end + + class BaseModel + abstract! + + extend Orb::Extern + extend Orb::Converter + + KnownFieldShape = T.type_alias { {mode: T.nilable(Symbol), required: T::Boolean} } + + sig do + returns( + T::Hash[Symbol, + T.all(Orb::BaseModel::KnownFieldShape, {type_fn: T.proc.returns(Orb::Converter::Input)})] + ) + end + def self.known_fields; end + + sig { returns(T::Hash[Symbol, T.all(Orb::BaseModel::KnownFieldShape, {type: Orb::Converter::Input})]) } + def self.fields; end + + sig { returns(T::Hash[Symbol, T.proc.returns(T::Class[T.anything])]) } + def self.defaults; end + + sig do + params( + name_sym: Symbol, + required: T::Boolean, + type_info: T.any( + { + const: T.nilable(T.any(NilClass, T::Boolean, Integer, Float, Symbol)), + enum: T.nilable(T.proc.returns(Orb::Converter::Input)), + union: T.nilable(T.proc.returns(Orb::Converter::Input)), + api_name: Symbol, + nil?: T::Boolean + }, + T.proc.returns(Orb::Converter::Input), + Orb::Converter::Input + ), + spec: T::Hash[Symbol, T.anything] + ).void + end + private_class_method def self.add_field(name_sym, required:, type_info:, spec:); end + + sig do + params( + name_sym: Symbol, + type_info: T.any( + T::Hash[Symbol, T.anything], + T.proc.returns(Orb::Converter::Input), + Orb::Converter::Input + ), + spec: T::Hash[Symbol, T.anything] + ).void + end + def self.required(name_sym, type_info, spec = {}); end + + sig do + params( + name_sym: Symbol, + type_info: T.any( + T::Hash[Symbol, T.anything], + T.proc.returns(Orb::Converter::Input), + Orb::Converter::Input + ), + spec: T::Hash[Symbol, T.anything] + ).void + end + def self.optional(name_sym, type_info, spec = {}); end + + sig { params(blk: T.proc.void).void } + private_class_method def self.request_only(&blk); end + + sig { params(blk: T.proc.void).void } + private_class_method def self.response_only(&blk); end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other); end + + sig do + override.params( + value: T.any( + Orb::BaseModel, + T::Hash[T.anything, T.anything], + T.anything + ) + ).returns(T.any(T.attached_class, T.anything)) + end + def self.coerce(value); end + + sig do + override.params( + value: T.any( + T.attached_class, + T.anything + ) + ).returns(T.any(T::Hash[T.anything, T.anything], T.anything)) + end + def self.dump(value); end + + sig do + override.params(value: T.anything).returns( + T.any( + [T::Boolean, T.anything, NilClass], + [T::Boolean, T::Boolean, Integer] + ) + ) + end + def self.try_strict_coerce(value); end + + sig { params(key: Symbol).returns(T.nilable(T.anything)) } + def [](key); end + + sig { returns(T::Hash[Symbol, T.anything]) } + def to_h; end + + alias_method :to_hash, :to_h + + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.anything]) } + def deconstruct_keys(keys); end + + sig { params(data: T.any(T::Hash[Symbol, T.anything], T.self_type)).void } + def initialize(data = {}); end + + sig { returns(String) } + def to_s; end + + sig { returns(String) } + def inspect; end + end +end diff --git a/rbi/lib/orb/base_page.rbi b/rbi/lib/orb/base_page.rbi new file mode 100644 index 00000000..bbe69937 --- /dev/null +++ b/rbi/lib/orb/base_page.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Orb + module BasePage + abstract! + + Elem = type_member(:out) + + sig { overridable.returns(T::Boolean) } + def next_page?; end + + sig { overridable.returns(T.self_type) } + def next_page; end + + sig { overridable.params(blk: T.proc.params(arg0: Elem).void).void } + def auto_paging_each(&blk); end + + sig { returns(T::Enumerable[Elem]) } + def to_enum; end + + alias_method :enum_for, :to_enum + + sig do + params( + client: Orb::BaseClient, + req: Orb::BaseClient::RequestShape, + headers: T::Hash[String, String], + unwrapped: T.anything + ).void + end + def initialize(client:, req:, headers:, unwrapped:); end + end +end diff --git a/rbi/lib/orb/client.rbi b/rbi/lib/orb/client.rbi new file mode 100644 index 00000000..d21ddaa6 --- /dev/null +++ b/rbi/lib/orb/client.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module Orb + class Client < Orb::BaseClient + DEFAULT_MAX_RETRIES = 2 + + DEFAULT_TIMEOUT_IN_SECONDS = T.let(60.0, Float) + + DEFAULT_INITIAL_RETRY_DELAY = T.let(0.5, Float) + + DEFAULT_MAX_RETRY_DELAY = T.let(8.0, Float) + + sig { returns(String) } + attr_reader :api_key + + sig { returns(Orb::Resources::TopLevel) } + attr_reader :top_level + + sig { returns(Orb::Resources::Coupons) } + attr_reader :coupons + + sig { returns(Orb::Resources::CreditNotes) } + attr_reader :credit_notes + + sig { returns(Orb::Resources::Customers) } + attr_reader :customers + + sig { returns(Orb::Resources::Events) } + attr_reader :events + + sig { returns(Orb::Resources::InvoiceLineItems) } + attr_reader :invoice_line_items + + sig { returns(Orb::Resources::Invoices) } + attr_reader :invoices + + sig { returns(Orb::Resources::Items) } + attr_reader :items + + sig { returns(Orb::Resources::Metrics) } + attr_reader :metrics + + sig { returns(Orb::Resources::Plans) } + attr_reader :plans + + sig { returns(Orb::Resources::Prices) } + attr_reader :prices + + sig { returns(Orb::Resources::Subscriptions) } + attr_reader :subscriptions + + sig { returns(Orb::Resources::Alerts) } + attr_reader :alerts + + sig { returns(Orb::Resources::DimensionalPriceGroups) } + attr_reader :dimensional_price_groups + + sig { returns(T::Hash[String, String]) } + private def auth_headers; end + + sig do + params( + base_url: T.nilable(String), + api_key: T.nilable(String), + max_retries: Integer, + timeout: Float, + initial_retry_delay: Float, + max_retry_delay: Float, + idempotency_header: String + ).void + end + def initialize( + base_url: nil, + api_key: ENV["ORB_API_KEY"], + max_retries: DEFAULT_MAX_RETRIES, + timeout: DEFAULT_TIMEOUT_IN_SECONDS, + initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY, + max_retry_delay: DEFAULT_MAX_RETRY_DELAY, + idempotency_header: "Idempotency-Key" + ); end + end +end diff --git a/rbi/lib/orb/errors.rbi b/rbi/lib/orb/errors.rbi new file mode 100644 index 00000000..a5005674 --- /dev/null +++ b/rbi/lib/orb/errors.rbi @@ -0,0 +1,202 @@ +# typed: strong + +module Orb + class Error < StandardError + sig { returns(T.nilable(StandardError)) } + attr_reader :cause + end + + class ConversionError < Orb::Error + end + + class APIError < Orb::Error + sig { returns(URI::Generic) } + attr_reader :url + + sig { returns(T.nilable(Integer)) } + attr_reader :status + + sig { returns(T.nilable(T.anything)) } + attr_reader :body + + sig do + params( + url: URI::Generic, + status: T.nilable(Integer), + body: T.nilable(Object), + request: NilClass, + response: NilClass, + message: T.nilable(String) + ).void + end + def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil); end + end + + class APIConnectionError < Orb::APIError + sig { void } + attr_reader :status + + sig { void } + attr_reader :body + + sig do + params( + url: URI::Generic, + status: NilClass, + body: NilClass, + request: NilClass, + response: NilClass, + message: T.nilable(String) + ).void + end + def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: "Connection error.") + end + end + + class APITimeoutError < Orb::APIConnectionError + sig do + params( + url: URI::Generic, + status: NilClass, + body: NilClass, + request: NilClass, + response: NilClass, + message: T.nilable(String) + ).void + end + def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: "Request timed out.") + end + end + + class APIStatusError < Orb::APIError + sig do + params( + url: URI::Generic, + status: Integer, + body: T.nilable(Object), + request: NilClass, + response: NilClass + ).returns(T.attached_class) + end + def self.for(url:, status:, body:, request:, response:); end + + sig { returns(Integer) } + attr_reader :status + + sig do + params( + url: URI::Generic, + status: Integer, + body: T.nilable(Object), + request: NilClass, + response: NilClass, + message: T.nilable(String) + ).void + end + def initialize(url:, status:, body:, request:, response:, message: nil); end + end + + class BadRequestError < Orb::APIStatusError + HTTP_STATUS = 400 + end + + class AuthenticationError < Orb::APIStatusError + HTTP_STATUS = 401 + end + + class PermissionDeniedError < Orb::APIStatusError + HTTP_STATUS = 403 + end + + class NotFoundError < Orb::APIStatusError + HTTP_STATUS = 404 + end + + class ConflictError < Orb::APIStatusError + HTTP_STATUS = 409 + end + + class UnprocessableEntityError < Orb::APIStatusError + HTTP_STATUS = 422 + end + + class RateLimitError < Orb::APIStatusError + HTTP_STATUS = 429 + end + + class InternalServerError < Orb::APIStatusError + HTTP_STATUS = T.let((500..), T::Range[Integer]) + end + + class ConstraintViolation < Orb::APIStatusError + HTTP_STATUS = 400 + + TYPE = "https://docs.withorb.com/reference/error-responses#400-constraint-violation" + end + + class DuplicateResourceCreation < Orb::APIStatusError + HTTP_STATUS = 400 + + TYPE = "https://docs.withorb.com/reference/error-responses#400-duplicate-resource-creation" + end + + class FeatureNotAvailable < Orb::APIStatusError + HTTP_STATUS = 400 + + TYPE = "https://docs.withorb.com/reference/error-responses#404-feature-not-available" + end + + class RequestValidationError < Orb::APIStatusError + HTTP_STATUS = 400 + + TYPE = "https://docs.withorb.com/reference/error-responses#400-request-validation-errors" + end + + class OrbAuthenticationError < Orb::APIStatusError + HTTP_STATUS = 401 + + TYPE = "https://docs.withorb.com/reference/error-responses#401-authentication-error" + end + + class ResourceNotFound < Orb::APIStatusError + HTTP_STATUS = 404 + + TYPE = "https://docs.withorb.com/reference/error-responses#404-resource-not-found" + end + + class URLNotFound < Orb::APIStatusError + HTTP_STATUS = 404 + + TYPE = "https://docs.withorb.com/reference/error-responses#404-url-not-found" + end + + class ResourceConflict < Orb::APIStatusError + HTTP_STATUS = 409 + + TYPE = "https://docs.withorb.com/reference/error-responses#409-resource-conflict" + end + + class RequestTooLarge < Orb::APIStatusError + HTTP_STATUS = 413 + + TYPE = "https://docs.withorb.com/reference/error-responses#413-request-too-large" + end + + class ResourceTooLarge < Orb::APIStatusError + HTTP_STATUS = 413 + + TYPE = "https://docs.withorb.com/reference/error-responses#413-resource-too-large" + end + + class TooManyRequests < Orb::APIStatusError + HTTP_STATUS = 429 + + TYPE = "https://docs.withorb.com/reference/error-responses#429-too-many-requests" + end + + class OrbInternalServerError < Orb::APIStatusError + HTTP_STATUS = 500 + + TYPE = "https://docs.withorb.com/reference/error-responses#500-internal-server-error" + end +end diff --git a/rbi/lib/orb/extern.rbi b/rbi/lib/orb/extern.rbi new file mode 100644 index 00000000..b2d140da --- /dev/null +++ b/rbi/lib/orb/extern.rbi @@ -0,0 +1,10 @@ +# typed: strong + +module Orb + module Extern + abstract! + + sig { params(blk: T.proc.void).void } + def sorbet!(&blk); end + end +end diff --git a/rbi/lib/orb/models/alert.rbi b/rbi/lib/orb/models/alert.rbi new file mode 100644 index 00000000..d89ecb60 --- /dev/null +++ b/rbi/lib/orb/models/alert.rbi @@ -0,0 +1,187 @@ +# typed: strong + +module Orb + module Models + class Alert < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + created_at: Time, + currency: T.nilable(String), + customer: T.nilable(Orb::Models::Alert::Customer), + enabled: T::Boolean, + metric: T.nilable(Orb::Models::Alert::Metric), + plan: T.nilable(Orb::Models::Alert::Plan), + subscription: T.nilable(Orb::Models::Alert::Subscription), + thresholds: T.nilable(T::Array[Orb::Models::Alert::Threshold]), + type: Symbol + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Alert::Customer)) } + attr_accessor :customer + + sig { returns(T::Boolean) } + attr_accessor :enabled + + sig { returns(T.nilable(Orb::Models::Alert::Metric)) } + attr_accessor :metric + + sig { returns(T.nilable(Orb::Models::Alert::Plan)) } + attr_accessor :plan + + sig { returns(T.nilable(Orb::Models::Alert::Subscription)) } + attr_accessor :subscription + + sig { returns(T.nilable(T::Array[Orb::Models::Alert::Threshold])) } + attr_accessor :thresholds + + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + id: String, + created_at: Time, + currency: T.nilable(String), + customer: T.nilable(Orb::Models::Alert::Customer), + enabled: T::Boolean, + metric: T.nilable(Orb::Models::Alert::Metric), + plan: T.nilable(Orb::Models::Alert::Plan), + subscription: T.nilable(Orb::Models::Alert::Subscription), + thresholds: T.nilable(T::Array[Orb::Models::Alert::Threshold]), + type: Symbol + ).void + end + def initialize( + id:, + created_at:, + currency:, + customer:, + enabled:, + metric:, + plan:, + subscription:, + thresholds:, + type: + ) + end + + sig { returns(Orb::Models::Alert::Shape) } + def to_h; end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig { returns(Orb::Models::Alert::Customer::Shape) } + def to_h; end + end + + class Metric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Alert::Metric::Shape) } + def to_h; end + end + + class Plan < Orb::BaseModel + Shape = T.type_alias do + { + id: T.nilable(String), + external_plan_id: T.nilable(String), + name: T.nilable(String), + plan_version: String + } + end + + sig { returns(T.nilable(String)) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_plan_id + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(String) } + attr_accessor :plan_version + + sig do + params( + id: T.nilable(String), + external_plan_id: T.nilable(String), + name: T.nilable(String), + plan_version: String + ).void + end + def initialize(id:, external_plan_id:, name:, plan_version:); end + + sig { returns(Orb::Models::Alert::Plan::Shape) } + def to_h; end + end + + class Subscription < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Alert::Subscription::Shape) } + def to_h; end + end + + class Threshold < Orb::BaseModel + Shape = T.type_alias { {value: Float} } + + sig { returns(Float) } + attr_accessor :value + + sig { params(value: Float).void } + def initialize(value:); end + + sig { returns(Orb::Models::Alert::Threshold::Shape) } + def to_h; end + end + + class Type < Orb::Enum + abstract! + + USAGE_EXCEEDED = :usage_exceeded + COST_EXCEEDED = :cost_exceeded + CREDIT_BALANCE_DEPLETED = :credit_balance_depleted + CREDIT_BALANCE_DROPPED = :credit_balance_dropped + CREDIT_BALANCE_RECOVERED = :credit_balance_recovered + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end +end diff --git a/rbi/lib/orb/models/alert_create_for_customer_params.rbi b/rbi/lib/orb/models/alert_create_for_customer_params.rbi new file mode 100644 index 00000000..0d31172b --- /dev/null +++ b/rbi/lib/orb/models/alert_create_for_customer_params.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Orb + module Models + class AlertCreateForCustomerParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + currency: String, + type: Symbol, + thresholds: T.nilable(T::Array[Orb::Models::AlertCreateForCustomerParams::Threshold]) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(String) } + attr_accessor :currency + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(T.nilable(T::Array[Orb::Models::AlertCreateForCustomerParams::Threshold])) } + attr_accessor :thresholds + + sig do + params( + currency: String, + type: Symbol, + thresholds: T.nilable(T::Array[Orb::Models::AlertCreateForCustomerParams::Threshold]), + request_options: Orb::RequestOpts + ).void + end + def initialize(currency:, type:, thresholds: nil, request_options: {}); end + + sig { returns(Orb::Models::AlertCreateForCustomerParams::Shape) } + def to_h; end + + class Type < Orb::Enum + abstract! + + USAGE_EXCEEDED = :usage_exceeded + COST_EXCEEDED = :cost_exceeded + CREDIT_BALANCE_DEPLETED = :credit_balance_depleted + CREDIT_BALANCE_DROPPED = :credit_balance_dropped + CREDIT_BALANCE_RECOVERED = :credit_balance_recovered + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class Threshold < Orb::BaseModel + Shape = T.type_alias { {value: Float} } + + sig { returns(Float) } + attr_accessor :value + + sig { params(value: Float).void } + def initialize(value:); end + + sig { returns(Orb::Models::AlertCreateForCustomerParams::Threshold::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/alert_create_for_external_customer_params.rbi b/rbi/lib/orb/models/alert_create_for_external_customer_params.rbi new file mode 100644 index 00000000..dd4ee7f6 --- /dev/null +++ b/rbi/lib/orb/models/alert_create_for_external_customer_params.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Orb + module Models + class AlertCreateForExternalCustomerParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + currency: String, + type: Symbol, + thresholds: T.nilable(T::Array[Orb::Models::AlertCreateForExternalCustomerParams::Threshold]) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(String) } + attr_accessor :currency + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(T.nilable(T::Array[Orb::Models::AlertCreateForExternalCustomerParams::Threshold])) } + attr_accessor :thresholds + + sig do + params( + currency: String, + type: Symbol, + thresholds: T.nilable(T::Array[Orb::Models::AlertCreateForExternalCustomerParams::Threshold]), + request_options: Orb::RequestOpts + ).void + end + def initialize(currency:, type:, thresholds: nil, request_options: {}); end + + sig { returns(Orb::Models::AlertCreateForExternalCustomerParams::Shape) } + def to_h; end + + class Type < Orb::Enum + abstract! + + USAGE_EXCEEDED = :usage_exceeded + COST_EXCEEDED = :cost_exceeded + CREDIT_BALANCE_DEPLETED = :credit_balance_depleted + CREDIT_BALANCE_DROPPED = :credit_balance_dropped + CREDIT_BALANCE_RECOVERED = :credit_balance_recovered + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class Threshold < Orb::BaseModel + Shape = T.type_alias { {value: Float} } + + sig { returns(Float) } + attr_accessor :value + + sig { params(value: Float).void } + def initialize(value:); end + + sig { returns(Orb::Models::AlertCreateForExternalCustomerParams::Threshold::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/alert_create_for_subscription_params.rbi b/rbi/lib/orb/models/alert_create_for_subscription_params.rbi new file mode 100644 index 00000000..00f51f88 --- /dev/null +++ b/rbi/lib/orb/models/alert_create_for_subscription_params.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Orb + module Models + class AlertCreateForSubscriptionParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + thresholds: T::Array[Orb::Models::AlertCreateForSubscriptionParams::Threshold], + type: Symbol, + metric_id: T.nilable(String) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T::Array[Orb::Models::AlertCreateForSubscriptionParams::Threshold]) } + attr_accessor :thresholds + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_accessor :metric_id + + sig do + params( + thresholds: T::Array[Orb::Models::AlertCreateForSubscriptionParams::Threshold], + type: Symbol, + metric_id: T.nilable(String), + request_options: Orb::RequestOpts + ).void + end + def initialize(thresholds:, type:, metric_id: nil, request_options: {}); end + + sig { returns(Orb::Models::AlertCreateForSubscriptionParams::Shape) } + def to_h; end + + class Threshold < Orb::BaseModel + Shape = T.type_alias { {value: Float} } + + sig { returns(Float) } + attr_accessor :value + + sig { params(value: Float).void } + def initialize(value:); end + + sig { returns(Orb::Models::AlertCreateForSubscriptionParams::Threshold::Shape) } + def to_h; end + end + + class Type < Orb::Enum + abstract! + + USAGE_EXCEEDED = :usage_exceeded + COST_EXCEEDED = :cost_exceeded + CREDIT_BALANCE_DEPLETED = :credit_balance_depleted + CREDIT_BALANCE_DROPPED = :credit_balance_dropped + CREDIT_BALANCE_RECOVERED = :credit_balance_recovered + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end +end diff --git a/rbi/lib/orb/models/alert_disable_params.rbi b/rbi/lib/orb/models/alert_disable_params.rbi new file mode 100644 index 00000000..ab9dd203 --- /dev/null +++ b/rbi/lib/orb/models/alert_disable_params.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Orb + module Models + class AlertDisableParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({subscription_id: T.nilable(String)}, Orb::RequestParameters::Shape) } + + sig { returns(T.nilable(String)) } + attr_accessor :subscription_id + + sig { params(subscription_id: T.nilable(String), request_options: Orb::RequestOpts).void } + def initialize(subscription_id: nil, request_options: {}); end + + sig { returns(Orb::Models::AlertDisableParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/alert_enable_params.rbi b/rbi/lib/orb/models/alert_enable_params.rbi new file mode 100644 index 00000000..5bc30bbf --- /dev/null +++ b/rbi/lib/orb/models/alert_enable_params.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Orb + module Models + class AlertEnableParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({subscription_id: T.nilable(String)}, Orb::RequestParameters::Shape) } + + sig { returns(T.nilable(String)) } + attr_accessor :subscription_id + + sig { params(subscription_id: T.nilable(String), request_options: Orb::RequestOpts).void } + def initialize(subscription_id: nil, request_options: {}); end + + sig { returns(Orb::Models::AlertEnableParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/alert_list_params.rbi b/rbi/lib/orb/models/alert_list_params.rbi new file mode 100644 index 00000000..dae12bf8 --- /dev/null +++ b/rbi/lib/orb/models/alert_list_params.rbi @@ -0,0 +1,87 @@ +# typed: strong + +module Orb + module Models + class AlertListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + cursor: T.nilable(String), + customer_id: T.nilable(String), + external_customer_id: T.nilable(String), + limit: Integer, + subscription_id: T.nilable(String) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_gt + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_gte + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_lt + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_lte + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(String)) } + attr_accessor :customer_id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { returns(T.nilable(String)) } + attr_accessor :subscription_id + + sig do + params( + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + cursor: T.nilable(String), + customer_id: T.nilable(String), + external_customer_id: T.nilable(String), + limit: Integer, + subscription_id: T.nilable(String), + request_options: Orb::RequestOpts + ).void + end + def initialize( + created_at_gt: nil, + created_at_gte: nil, + created_at_lt: nil, + created_at_lte: nil, + cursor: nil, + customer_id: nil, + external_customer_id: nil, + limit: nil, + subscription_id: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::AlertListParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/alert_retrieve_params.rbi b/rbi/lib/orb/models/alert_retrieve_params.rbi new file mode 100644 index 00000000..debc2871 --- /dev/null +++ b/rbi/lib/orb/models/alert_retrieve_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class AlertRetrieveParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::AlertRetrieveParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/alert_update_params.rbi b/rbi/lib/orb/models/alert_update_params.rbi new file mode 100644 index 00000000..001d0b64 --- /dev/null +++ b/rbi/lib/orb/models/alert_update_params.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module Orb + module Models + class AlertUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + {thresholds: T::Array[Orb::Models::AlertUpdateParams::Threshold]}, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T::Array[Orb::Models::AlertUpdateParams::Threshold]) } + attr_accessor :thresholds + + sig do + params( + thresholds: T::Array[Orb::Models::AlertUpdateParams::Threshold], + request_options: Orb::RequestOpts + ).void + end + def initialize(thresholds:, request_options: {}); end + + sig { returns(Orb::Models::AlertUpdateParams::Shape) } + def to_h; end + + class Threshold < Orb::BaseModel + Shape = T.type_alias { {value: Float} } + + sig { returns(Float) } + attr_accessor :value + + sig { params(value: Float).void } + def initialize(value:); end + + sig { returns(Orb::Models::AlertUpdateParams::Threshold::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/amount_discount.rbi b/rbi/lib/orb/models/amount_discount.rbi new file mode 100644 index 00000000..db8d806a --- /dev/null +++ b/rbi/lib/orb/models/amount_discount.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Orb + module Models + class AmountDiscount < Orb::BaseModel + Shape = T.type_alias do + { + amount_discount: String, + applies_to_price_ids: T::Array[String], + discount_type: Symbol, + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + discount_type: Symbol, + reason: T.nilable(String) + ).void + end + def initialize(amount_discount:, applies_to_price_ids:, discount_type:, reason: nil); end + + sig { returns(Orb::Models::AmountDiscount::Shape) } + def to_h; end + + class DiscountType < Orb::Enum + abstract! + + AMOUNT = :amount + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end +end diff --git a/rbi/lib/orb/models/billable_metric.rbi b/rbi/lib/orb/models/billable_metric.rbi new file mode 100644 index 00000000..51b29a9a --- /dev/null +++ b/rbi/lib/orb/models/billable_metric.rbi @@ -0,0 +1,62 @@ +# typed: strong + +module Orb + module Models + class BillableMetric < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + description: T.nilable(String), + item: Orb::Models::Item, + metadata: T::Hash[Symbol, String], + name: String, + status: Symbol + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Orb::Models::Item) } + attr_accessor :item + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(String) } + attr_accessor :name + + sig { returns(Symbol) } + attr_accessor :status + + sig do + params( + id: String, + description: T.nilable(String), + item: Orb::Models::Item, + metadata: T::Hash[Symbol, String], + name: String, + status: Symbol + ).void + end + def initialize(id:, description:, item:, metadata:, name:, status:); end + + sig { returns(Orb::Models::BillableMetric::Shape) } + def to_h; end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + DRAFT = :draft + ARCHIVED = :archived + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end +end diff --git a/rbi/lib/orb/models/billing_cycle_relative_date.rbi b/rbi/lib/orb/models/billing_cycle_relative_date.rbi new file mode 100644 index 00000000..ef7cc325 --- /dev/null +++ b/rbi/lib/orb/models/billing_cycle_relative_date.rbi @@ -0,0 +1,15 @@ +# typed: strong + +module Orb + module Models + class BillingCycleRelativeDate < Orb::Enum + abstract! + + START_OF_TERM = :start_of_term + END_OF_TERM = :end_of_term + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end +end diff --git a/rbi/lib/orb/models/coupon.rbi b/rbi/lib/orb/models/coupon.rbi new file mode 100644 index 00000000..4de52d15 --- /dev/null +++ b/rbi/lib/orb/models/coupon.rbi @@ -0,0 +1,76 @@ +# typed: strong + +module Orb + module Models + class Coupon < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + archived_at: T.nilable(Time), + discount: Orb::Models::Coupon::Discount::Variants, + duration_in_months: T.nilable(Integer), + max_redemptions: T.nilable(Integer), + redemption_code: String, + times_redeemed: Integer + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :archived_at + + sig { returns(Orb::Models::Coupon::Discount::Variants) } + attr_accessor :discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :duration_in_months + + sig { returns(T.nilable(Integer)) } + attr_accessor :max_redemptions + + sig { returns(String) } + attr_accessor :redemption_code + + sig { returns(Integer) } + attr_accessor :times_redeemed + + sig do + params( + id: String, + archived_at: T.nilable(Time), + discount: Orb::Models::Coupon::Discount::Variants, + duration_in_months: T.nilable(Integer), + max_redemptions: T.nilable(Integer), + redemption_code: String, + times_redeemed: Integer + ).void + end + def initialize( + id:, + archived_at:, + discount:, + duration_in_months:, + max_redemptions:, + redemption_code:, + times_redeemed: + ) + end + + sig { returns(Orb::Models::Coupon::Shape) } + def to_h; end + + class Discount < Orb::Union + abstract! + + Variants = T.type_alias { T.any(Orb::Models::PercentageDiscount, Orb::Models::AmountDiscount) } + + sig do + override.returns([[Symbol, Orb::Models::PercentageDiscount], [Symbol, Orb::Models::AmountDiscount]]) + end + private_class_method def self.variants; end + end + end + end +end diff --git a/rbi/lib/orb/models/coupon_archive_params.rbi b/rbi/lib/orb/models/coupon_archive_params.rbi new file mode 100644 index 00000000..2a178678 --- /dev/null +++ b/rbi/lib/orb/models/coupon_archive_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class CouponArchiveParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::CouponArchiveParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/coupon_create_params.rbi b/rbi/lib/orb/models/coupon_create_params.rbi new file mode 100644 index 00000000..2f2838c0 --- /dev/null +++ b/rbi/lib/orb/models/coupon_create_params.rbi @@ -0,0 +1,108 @@ +# typed: strong + +module Orb + module Models + class CouponCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + discount: Orb::Models::CouponCreateParams::Discount::Variants, + redemption_code: String, + duration_in_months: T.nilable(Integer), + max_redemptions: T.nilable(Integer) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(Orb::Models::CouponCreateParams::Discount::Variants) } + attr_accessor :discount + + sig { returns(String) } + attr_accessor :redemption_code + + sig { returns(T.nilable(Integer)) } + attr_accessor :duration_in_months + + sig { returns(T.nilable(Integer)) } + attr_accessor :max_redemptions + + sig do + params( + discount: Orb::Models::CouponCreateParams::Discount::Variants, + redemption_code: String, + duration_in_months: T.nilable(Integer), + max_redemptions: T.nilable(Integer), + request_options: Orb::RequestOpts + ).void + end + def initialize( + discount:, + redemption_code:, + duration_in_months: nil, + max_redemptions: nil, + request_options: {} + ) + end + + sig { returns(Orb::Models::CouponCreateParams::Shape) } + def to_h; end + + class Discount < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::CouponCreateParams::Discount::NewCouponPercentageDiscount, + Orb::Models::CouponCreateParams::Discount::NewCouponAmountDiscount + ) + end + + class NewCouponPercentageDiscount < Orb::BaseModel + Shape = T.type_alias { {discount_type: Symbol, percentage_discount: Float} } + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { params(percentage_discount: Float, discount_type: Symbol).void } + def initialize(percentage_discount:, discount_type: :percentage); end + + sig { returns(Orb::Models::CouponCreateParams::Discount::NewCouponPercentageDiscount::Shape) } + def to_h; end + end + + class NewCouponAmountDiscount < Orb::BaseModel + Shape = T.type_alias { {amount_discount: String, discount_type: Symbol} } + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { params(amount_discount: String, discount_type: Symbol).void } + def initialize(amount_discount:, discount_type: :amount); end + + sig { returns(Orb::Models::CouponCreateParams::Discount::NewCouponAmountDiscount::Shape) } + def to_h; end + end + + sig do + override.returns( + [ + [Symbol, Orb::Models::CouponCreateParams::Discount::NewCouponPercentageDiscount], + [Symbol, Orb::Models::CouponCreateParams::Discount::NewCouponAmountDiscount] + ] + ) + end + private_class_method def self.variants; end + end + end + end +end diff --git a/rbi/lib/orb/models/coupon_fetch_params.rbi b/rbi/lib/orb/models/coupon_fetch_params.rbi new file mode 100644 index 00000000..aef20f4c --- /dev/null +++ b/rbi/lib/orb/models/coupon_fetch_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class CouponFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::CouponFetchParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/coupon_list_params.rbi b/rbi/lib/orb/models/coupon_list_params.rbi new file mode 100644 index 00000000..67dca1a5 --- /dev/null +++ b/rbi/lib/orb/models/coupon_list_params.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Orb + module Models + class CouponListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + cursor: T.nilable(String), + limit: Integer, + redemption_code: T.nilable(String), + show_archived: T.nilable(T::Boolean) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { returns(T.nilable(String)) } + attr_accessor :redemption_code + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :show_archived + + sig do + params( + cursor: T.nilable(String), + limit: Integer, + redemption_code: T.nilable(String), + show_archived: T.nilable(T::Boolean), + request_options: Orb::RequestOpts + ).void + end + def initialize(cursor: nil, limit: nil, redemption_code: nil, show_archived: nil, request_options: {}) + end + + sig { returns(Orb::Models::CouponListParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/coupons/subscription_list_params.rbi b/rbi/lib/orb/models/coupons/subscription_list_params.rbi new file mode 100644 index 00000000..8642a6a1 --- /dev/null +++ b/rbi/lib/orb/models/coupons/subscription_list_params.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Orb + module Models + module Coupons + class SubscriptionListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all({cursor: T.nilable(String), limit: Integer}, Orb::RequestParameters::Shape) + end + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { params(cursor: T.nilable(String), limit: Integer, request_options: Orb::RequestOpts).void } + def initialize(cursor: nil, limit: nil, request_options: {}); end + + sig { returns(Orb::Models::Coupons::SubscriptionListParams::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/credit_note.rbi b/rbi/lib/orb/models/credit_note.rbi new file mode 100644 index 00000000..5fa671cd --- /dev/null +++ b/rbi/lib/orb/models/credit_note.rbi @@ -0,0 +1,451 @@ +# typed: strong + +module Orb + module Models + class CreditNote < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + created_at: Time, + credit_note_number: String, + credit_note_pdf: T.nilable(String), + customer: Orb::Models::CreditNote::Customer, + invoice_id: String, + line_items: T::Array[Orb::Models::CreditNote::LineItem], + maximum_amount_adjustment: T.nilable(Orb::Models::CreditNote::MaximumAmountAdjustment), + memo: T.nilable(String), + minimum_amount_refunded: T.nilable(String), + reason: T.nilable(Symbol), + subtotal: String, + total: String, + type: Symbol, + voided_at: T.nilable(Time), + discounts: T::Array[Orb::Models::CreditNote::Discount] + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(String) } + attr_accessor :credit_note_number + + sig { returns(T.nilable(String)) } + attr_accessor :credit_note_pdf + + sig { returns(Orb::Models::CreditNote::Customer) } + attr_accessor :customer + + sig { returns(String) } + attr_accessor :invoice_id + + sig { returns(T::Array[Orb::Models::CreditNote::LineItem]) } + attr_accessor :line_items + + sig { returns(T.nilable(Orb::Models::CreditNote::MaximumAmountAdjustment)) } + attr_accessor :maximum_amount_adjustment + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount_refunded + + sig { returns(T.nilable(Symbol)) } + attr_accessor :reason + + sig { returns(String) } + attr_accessor :subtotal + + sig { returns(String) } + attr_accessor :total + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(T.nilable(Time)) } + attr_accessor :voided_at + + sig { returns(T.nilable(T::Array[Orb::Models::CreditNote::Discount])) } + attr_reader :discounts + + sig { params(discounts: T::Array[Orb::Models::CreditNote::Discount]).void } + attr_writer :discounts + + sig do + params( + id: String, + created_at: Time, + credit_note_number: String, + credit_note_pdf: T.nilable(String), + customer: Orb::Models::CreditNote::Customer, + invoice_id: String, + line_items: T::Array[Orb::Models::CreditNote::LineItem], + maximum_amount_adjustment: T.nilable(Orb::Models::CreditNote::MaximumAmountAdjustment), + memo: T.nilable(String), + minimum_amount_refunded: T.nilable(String), + reason: T.nilable(Symbol), + subtotal: String, + total: String, + type: Symbol, + voided_at: T.nilable(Time), + discounts: T::Array[Orb::Models::CreditNote::Discount] + ).void + end + def initialize( + id:, + created_at:, + credit_note_number:, + credit_note_pdf:, + customer:, + invoice_id:, + line_items:, + maximum_amount_adjustment:, + memo:, + minimum_amount_refunded:, + reason:, + subtotal:, + total:, + type:, + voided_at:, + discounts: nil + ); end + + sig { returns(Orb::Models::CreditNote::Shape) } + def to_h; end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig { returns(Orb::Models::CreditNote::Customer::Shape) } + def to_h; end + end + + class LineItem < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: String, + name: String, + quantity: T.nilable(Float), + subtotal: String, + tax_amounts: T::Array[Orb::Models::CreditNote::LineItem::TaxAmount], + discounts: T::Array[Orb::Models::CreditNote::LineItem::Discount] + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Float)) } + attr_accessor :quantity + + sig { returns(String) } + attr_accessor :subtotal + + sig { returns(T::Array[Orb::Models::CreditNote::LineItem::TaxAmount]) } + attr_accessor :tax_amounts + + sig { returns(T.nilable(T::Array[Orb::Models::CreditNote::LineItem::Discount])) } + attr_reader :discounts + + sig { params(discounts: T::Array[Orb::Models::CreditNote::LineItem::Discount]).void } + attr_writer :discounts + + sig do + params( + id: String, + amount: String, + name: String, + quantity: T.nilable(Float), + subtotal: String, + tax_amounts: T::Array[Orb::Models::CreditNote::LineItem::TaxAmount], + discounts: T::Array[Orb::Models::CreditNote::LineItem::Discount] + ).void + end + def initialize(id:, amount:, name:, quantity:, subtotal:, tax_amounts:, discounts: nil); end + + sig { returns(Orb::Models::CreditNote::LineItem::Shape) } + def to_h; end + + class TaxAmount < Orb::BaseModel + Shape = T.type_alias do + {amount: String, tax_rate_description: String, tax_rate_percentage: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :tax_rate_description + + sig { returns(T.nilable(String)) } + attr_accessor :tax_rate_percentage + + sig do + params(amount: String, tax_rate_description: String, tax_rate_percentage: T.nilable(String)).void + end + def initialize(amount:, tax_rate_description:, tax_rate_percentage:); end + + sig { returns(Orb::Models::CreditNote::LineItem::TaxAmount::Shape) } + def to_h; end + end + + class Discount < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount_applied: String, + applies_to_price_ids: T::Array[String], + discount_type: Symbol, + percentage_discount: Float, + amount_discount: T.nilable(String), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :amount_applied + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(String)) } + attr_accessor :amount_discount + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + amount_applied: String, + applies_to_price_ids: T::Array[String], + discount_type: Symbol, + percentage_discount: Float, + amount_discount: T.nilable(String), + reason: T.nilable(String) + ).void + end + def initialize( + id:, + amount_applied:, + applies_to_price_ids:, + discount_type:, + percentage_discount:, + amount_discount: nil, + reason: nil + ); end + + sig { returns(Orb::Models::CreditNote::LineItem::Discount::Shape) } + def to_h; end + + class DiscountType < Orb::Enum + abstract! + + PERCENTAGE = :percentage + AMOUNT = :amount + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class MaximumAmountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + amount_applied: String, + discount_type: Symbol, + percentage_discount: Float, + applies_to_prices: T.nilable(T::Array[Orb::Models::CreditNote::MaximumAmountAdjustment::AppliesToPrice]), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :amount_applied + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(T::Array[Orb::Models::CreditNote::MaximumAmountAdjustment::AppliesToPrice])) } + attr_accessor :applies_to_prices + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + amount_applied: String, + discount_type: Symbol, + percentage_discount: Float, + applies_to_prices: T.nilable(T::Array[Orb::Models::CreditNote::MaximumAmountAdjustment::AppliesToPrice]), + reason: T.nilable(String) + ).void + end + def initialize( + amount_applied:, + discount_type:, + percentage_discount:, + applies_to_prices: nil, + reason: nil + ) + end + + sig { returns(Orb::Models::CreditNote::MaximumAmountAdjustment::Shape) } + def to_h; end + + class DiscountType < Orb::Enum + abstract! + + PERCENTAGE = :percentage + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class AppliesToPrice < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::CreditNote::MaximumAmountAdjustment::AppliesToPrice::Shape) } + def to_h; end + end + end + + class Reason < Orb::Enum + abstract! + + DUPLICATE = T.let(:Duplicate, T.nilable(Symbol)) + FRAUDULENT = T.let(:Fraudulent, T.nilable(Symbol)) + ORDER_CHANGE = T.let(:"Order change", T.nilable(Symbol)) + PRODUCT_UNSATISFACTORY = T.let(:"Product unsatisfactory", T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class Type < Orb::Enum + abstract! + + REFUND = :refund + ADJUSTMENT = :adjustment + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class Discount < Orb::BaseModel + Shape = T.type_alias do + { + amount_applied: String, + discount_type: Symbol, + percentage_discount: Float, + applies_to_prices: T.nilable(T::Array[Orb::Models::CreditNote::Discount::AppliesToPrice]), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :amount_applied + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(T::Array[Orb::Models::CreditNote::Discount::AppliesToPrice])) } + attr_accessor :applies_to_prices + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + amount_applied: String, + discount_type: Symbol, + percentage_discount: Float, + applies_to_prices: T.nilable(T::Array[Orb::Models::CreditNote::Discount::AppliesToPrice]), + reason: T.nilable(String) + ).void + end + def initialize( + amount_applied:, + discount_type:, + percentage_discount:, + applies_to_prices: nil, + reason: nil + ) + end + + sig { returns(Orb::Models::CreditNote::Discount::Shape) } + def to_h; end + + class DiscountType < Orb::Enum + abstract! + + PERCENTAGE = :percentage + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class AppliesToPrice < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::CreditNote::Discount::AppliesToPrice::Shape) } + def to_h; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/credit_note_create_params.rbi b/rbi/lib/orb/models/credit_note_create_params.rbi new file mode 100644 index 00000000..df4f7c40 --- /dev/null +++ b/rbi/lib/orb/models/credit_note_create_params.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Orb + module Models + class CreditNoteCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + line_items: T::Array[Orb::Models::CreditNoteCreateParams::LineItem], + memo: T.nilable(String), + reason: T.nilable(Symbol) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T::Array[Orb::Models::CreditNoteCreateParams::LineItem]) } + attr_accessor :line_items + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(T.nilable(Symbol)) } + attr_accessor :reason + + sig do + params( + line_items: T::Array[Orb::Models::CreditNoteCreateParams::LineItem], + memo: T.nilable(String), + reason: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).void + end + def initialize(line_items:, memo: nil, reason: nil, request_options: {}); end + + sig { returns(Orb::Models::CreditNoteCreateParams::Shape) } + def to_h; end + + class LineItem < Orb::BaseModel + Shape = T.type_alias { {amount: String, invoice_line_item_id: String} } + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :invoice_line_item_id + + sig { params(amount: String, invoice_line_item_id: String).void } + def initialize(amount:, invoice_line_item_id:); end + + sig { returns(Orb::Models::CreditNoteCreateParams::LineItem::Shape) } + def to_h; end + end + + class Reason < Orb::Enum + abstract! + + DUPLICATE = T.let(:duplicate, T.nilable(Symbol)) + FRAUDULENT = T.let(:fraudulent, T.nilable(Symbol)) + ORDER_CHANGE = T.let(:order_change, T.nilable(Symbol)) + PRODUCT_UNSATISFACTORY = T.let(:product_unsatisfactory, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end +end diff --git a/rbi/lib/orb/models/credit_note_fetch_params.rbi b/rbi/lib/orb/models/credit_note_fetch_params.rbi new file mode 100644 index 00000000..02c3b731 --- /dev/null +++ b/rbi/lib/orb/models/credit_note_fetch_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class CreditNoteFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::CreditNoteFetchParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/credit_note_list_params.rbi b/rbi/lib/orb/models/credit_note_list_params.rbi new file mode 100644 index 00000000..16847da5 --- /dev/null +++ b/rbi/lib/orb/models/credit_note_list_params.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Orb + module Models + class CreditNoteListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all({cursor: T.nilable(String), limit: Integer}, Orb::RequestParameters::Shape) + end + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { params(cursor: T.nilable(String), limit: Integer, request_options: Orb::RequestOpts).void } + def initialize(cursor: nil, limit: nil, request_options: {}); end + + sig { returns(Orb::Models::CreditNoteListParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/customer.rbi b/rbi/lib/orb/models/customer.rbi new file mode 100644 index 00000000..3d5118be --- /dev/null +++ b/rbi/lib/orb/models/customer.rbi @@ -0,0 +1,502 @@ +# typed: strong + +module Orb + module Models + class Customer < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + additional_emails: T::Array[String], + auto_collection: T::Boolean, + balance: String, + billing_address: T.nilable(Orb::Models::Customer::BillingAddress), + created_at: Time, + currency: T.nilable(String), + email: String, + email_delivery: T::Boolean, + exempt_from_automated_tax: T.nilable(T::Boolean), + external_customer_id: T.nilable(String), + metadata: T::Hash[Symbol, String], + name: String, + payment_provider: T.nilable(Symbol), + payment_provider_id: T.nilable(String), + portal_url: T.nilable(String), + shipping_address: T.nilable(Orb::Models::Customer::ShippingAddress), + tax_id: T.nilable(Orb::Models::Customer::TaxID), + timezone: String, + accounting_sync_configuration: T.nilable(Orb::Models::Customer::AccountingSyncConfiguration), + reporting_configuration: T.nilable(Orb::Models::Customer::ReportingConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T::Array[String]) } + attr_accessor :additional_emails + + sig { returns(T::Boolean) } + attr_accessor :auto_collection + + sig { returns(String) } + attr_accessor :balance + + sig { returns(T.nilable(Orb::Models::Customer::BillingAddress)) } + attr_accessor :billing_address + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :email + + sig { returns(T::Boolean) } + attr_accessor :email_delivery + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :exempt_from_automated_tax + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Symbol)) } + attr_accessor :payment_provider + + sig { returns(T.nilable(String)) } + attr_accessor :payment_provider_id + + sig { returns(T.nilable(String)) } + attr_accessor :portal_url + + sig { returns(T.nilable(Orb::Models::Customer::ShippingAddress)) } + attr_accessor :shipping_address + + sig { returns(T.nilable(Orb::Models::Customer::TaxID)) } + attr_accessor :tax_id + + sig { returns(String) } + attr_accessor :timezone + + sig { returns(T.nilable(Orb::Models::Customer::AccountingSyncConfiguration)) } + attr_accessor :accounting_sync_configuration + + sig { returns(T.nilable(Orb::Models::Customer::ReportingConfiguration)) } + attr_accessor :reporting_configuration + + sig do + params( + id: String, + additional_emails: T::Array[String], + auto_collection: T::Boolean, + balance: String, + billing_address: T.nilable(Orb::Models::Customer::BillingAddress), + created_at: Time, + currency: T.nilable(String), + email: String, + email_delivery: T::Boolean, + exempt_from_automated_tax: T.nilable(T::Boolean), + external_customer_id: T.nilable(String), + metadata: T::Hash[Symbol, String], + name: String, + payment_provider: T.nilable(Symbol), + payment_provider_id: T.nilable(String), + portal_url: T.nilable(String), + shipping_address: T.nilable(Orb::Models::Customer::ShippingAddress), + tax_id: T.nilable(Orb::Models::Customer::TaxID), + timezone: String, + accounting_sync_configuration: T.nilable(Orb::Models::Customer::AccountingSyncConfiguration), + reporting_configuration: T.nilable(Orb::Models::Customer::ReportingConfiguration) + ).void + end + def initialize( + id:, + additional_emails:, + auto_collection:, + balance:, + billing_address:, + created_at:, + currency:, + email:, + email_delivery:, + exempt_from_automated_tax:, + external_customer_id:, + metadata:, + name:, + payment_provider:, + payment_provider_id:, + portal_url:, + shipping_address:, + tax_id:, + timezone:, + accounting_sync_configuration: nil, + reporting_configuration: nil + ); end + + sig { returns(Orb::Models::Customer::Shape) } + def to_h; end + + class BillingAddress < Orb::BaseModel + Shape = T.type_alias do + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + sig { returns(T.nilable(String)) } + attr_accessor :country + + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + sig { returns(T.nilable(String)) } + attr_accessor :state + + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).void + end + def initialize(city:, country:, line1:, line2:, postal_code:, state:); end + + sig { returns(Orb::Models::Customer::BillingAddress::Shape) } + def to_h; end + end + + class PaymentProvider < Orb::Enum + abstract! + + QUICKBOOKS = T.let(:quickbooks, T.nilable(Symbol)) + BILL_COM = T.let(:"bill.com", T.nilable(Symbol)) + STRIPE_CHARGE = T.let(:stripe_charge, T.nilable(Symbol)) + STRIPE_INVOICE = T.let(:stripe_invoice, T.nilable(Symbol)) + NETSUITE = T.let(:netsuite, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class ShippingAddress < Orb::BaseModel + Shape = T.type_alias do + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + sig { returns(T.nilable(String)) } + attr_accessor :country + + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + sig { returns(T.nilable(String)) } + attr_accessor :state + + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).void + end + def initialize(city:, country:, line1:, line2:, postal_code:, state:); end + + sig { returns(Orb::Models::Customer::ShippingAddress::Shape) } + def to_h; end + end + + class TaxID < Orb::BaseModel + Shape = T.type_alias { {country: Symbol, type: Symbol, value: String} } + + sig { returns(Symbol) } + attr_accessor :country + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(String) } + attr_accessor :value + + sig { params(country: Symbol, type: Symbol, value: String).void } + def initialize(country:, type:, value:); end + + sig { returns(Orb::Models::Customer::TaxID::Shape) } + def to_h; end + + class Country < Orb::Enum + abstract! + + AD = :AD + AE = :AE + AR = :AR + AT = :AT + AU = :AU + BE = :BE + BG = :BG + BH = :BH + BO = :BO + BR = :BR + CA = :CA + CH = :CH + CL = :CL + CN = :CN + CO = :CO + CR = :CR + CY = :CY + CZ = :CZ + DE = :DE + DK = :DK + EE = :EE + DO = :DO + EC = :EC + EG = :EG + ES = :ES + EU = :EU + FI = :FI + FR = :FR + GB = :GB + GE = :GE + GR = :GR + HK = :HK + HR = :HR + HU = :HU + ID = :ID + IE = :IE + IL = :IL + IN = :IN + IS = :IS + IT = :IT + JP = :JP + KE = :KE + KR = :KR + KZ = :KZ + LI = :LI + LT = :LT + LU = :LU + LV = :LV + MT = :MT + MX = :MX + MY = :MY + NG = :NG + NL = :NL + NO = :NO + NZ = :NZ + OM = :OM + PE = :PE + PH = :PH + PL = :PL + PT = :PT + RO = :RO + RS = :RS + RU = :RU + SA = :SA + SE = :SE + SG = :SG + SI = :SI + SK = :SK + SV = :SV + TH = :TH + TR = :TR + TW = :TW + UA = :UA + US = :US + UY = :UY + VE = :VE + VN = :VN + ZA = :ZA + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class Type < Orb::Enum + abstract! + + AD_NRT = :ad_nrt + AE_TRN = :ae_trn + AR_CUIT = :ar_cuit + EU_VAT = :eu_vat + AU_ABN = :au_abn + AU_ARN = :au_arn + BG_UIC = :bg_uic + BH_VAT = :bh_vat + BO_TIN = :bo_tin + BR_CNPJ = :br_cnpj + BR_CPF = :br_cpf + CA_BN = :ca_bn + CA_GST_HST = :ca_gst_hst + CA_PST_BC = :ca_pst_bc + CA_PST_MB = :ca_pst_mb + CA_PST_SK = :ca_pst_sk + CA_QST = :ca_qst + CH_VAT = :ch_vat + CL_TIN = :cl_tin + CN_TIN = :cn_tin + CO_NIT = :co_nit + CR_TIN = :cr_tin + DO_RCN = :do_rcn + EC_RUC = :ec_ruc + EG_TIN = :eg_tin + ES_CIF = :es_cif + EU_OSS_VAT = :eu_oss_vat + GB_VAT = :gb_vat + GE_VAT = :ge_vat + HK_BR = :hk_br + HU_TIN = :hu_tin + ID_NPWP = :id_npwp + IL_VAT = :il_vat + IN_GST = :in_gst + IS_VAT = :is_vat + JP_CN = :jp_cn + JP_RN = :jp_rn + JP_TRN = :jp_trn + KE_PIN = :ke_pin + KR_BRN = :kr_brn + KZ_BIN = :kz_bin + LI_UID = :li_uid + MX_RFC = :mx_rfc + MY_FRP = :my_frp + MY_ITN = :my_itn + MY_SST = :my_sst + NG_TIN = :ng_tin + NO_VAT = :no_vat + NO_VOEC = :no_voec + NZ_GST = :nz_gst + OM_VAT = :om_vat + PE_RUC = :pe_ruc + PH_TIN = :ph_tin + RO_TIN = :ro_tin + RS_PIB = :rs_pib + RU_INN = :ru_inn + RU_KPP = :ru_kpp + SA_VAT = :sa_vat + SG_GST = :sg_gst + SG_UEN = :sg_uen + SI_TIN = :si_tin + SV_NIT = :sv_nit + TH_VAT = :th_vat + TR_TIN = :tr_tin + TW_VAT = :tw_vat + UA_VAT = :ua_vat + US_EIN = :us_ein + UY_RUC = :uy_ruc + VE_RIF = :ve_rif + VN_TIN = :vn_tin + ZA_VAT = :za_vat + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class AccountingSyncConfiguration < Orb::BaseModel + Shape = T.type_alias do + { + accounting_providers: T::Array[Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider], + excluded: T::Boolean + } + end + + sig { returns(T::Array[Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider]) } + attr_accessor :accounting_providers + + sig { returns(T::Boolean) } + attr_accessor :excluded + + sig do + params( + accounting_providers: T::Array[Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider], + excluded: T::Boolean + ).void + end + def initialize(accounting_providers:, excluded:); end + + sig { returns(Orb::Models::Customer::AccountingSyncConfiguration::Shape) } + def to_h; end + + class AccountingProvider < Orb::BaseModel + Shape = T.type_alias { {external_provider_id: T.nilable(String), provider_type: Symbol} } + + sig { returns(T.nilable(String)) } + attr_accessor :external_provider_id + + sig { returns(Symbol) } + attr_accessor :provider_type + + sig { params(external_provider_id: T.nilable(String), provider_type: Symbol).void } + def initialize(external_provider_id:, provider_type:); end + + sig { returns(Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider::Shape) } + def to_h; end + + class ProviderType < Orb::Enum + abstract! + + QUICKBOOKS = :quickbooks + NETSUITE = :netsuite + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class ReportingConfiguration < Orb::BaseModel + Shape = T.type_alias { {exempt: T::Boolean} } + + sig { returns(T::Boolean) } + attr_accessor :exempt + + sig { params(exempt: T::Boolean).void } + def initialize(exempt:); end + + sig { returns(Orb::Models::Customer::ReportingConfiguration::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/customer_create_params.rbi b/rbi/lib/orb/models/customer_create_params.rbi new file mode 100644 index 00000000..4a941ad2 --- /dev/null +++ b/rbi/lib/orb/models/customer_create_params.rbi @@ -0,0 +1,541 @@ +# typed: strong + +module Orb + module Models + class CustomerCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + email: String, + name: String, + accounting_sync_configuration: T.nilable(Orb::Models::CustomerCreateParams::AccountingSyncConfiguration), + additional_emails: T.nilable(T::Array[String]), + auto_collection: T.nilable(T::Boolean), + billing_address: T.nilable(Orb::Models::CustomerCreateParams::BillingAddress), + currency: T.nilable(String), + email_delivery: T.nilable(T::Boolean), + external_customer_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + payment_provider: T.nilable(Symbol), + payment_provider_id: T.nilable(String), + reporting_configuration: T.nilable(Orb::Models::CustomerCreateParams::ReportingConfiguration), + shipping_address: T.nilable(Orb::Models::CustomerCreateParams::ShippingAddress), + tax_configuration: T.nilable(Orb::Models::CustomerCreateParams::TaxConfiguration::Variants), + tax_id: T.nilable(Orb::Models::CustomerCreateParams::TaxID), + timezone: T.nilable(String) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(String) } + attr_accessor :email + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Orb::Models::CustomerCreateParams::AccountingSyncConfiguration)) } + attr_accessor :accounting_sync_configuration + + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :additional_emails + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig { returns(T.nilable(Orb::Models::CustomerCreateParams::BillingAddress)) } + attr_accessor :billing_address + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :email_delivery + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(Symbol)) } + attr_accessor :payment_provider + + sig { returns(T.nilable(String)) } + attr_accessor :payment_provider_id + + sig { returns(T.nilable(Orb::Models::CustomerCreateParams::ReportingConfiguration)) } + attr_accessor :reporting_configuration + + sig { returns(T.nilable(Orb::Models::CustomerCreateParams::ShippingAddress)) } + attr_accessor :shipping_address + + sig { returns(T.nilable(Orb::Models::CustomerCreateParams::TaxConfiguration::Variants)) } + attr_accessor :tax_configuration + + sig { returns(T.nilable(Orb::Models::CustomerCreateParams::TaxID)) } + attr_accessor :tax_id + + sig { returns(T.nilable(String)) } + attr_accessor :timezone + + sig do + params( + email: String, + name: String, + accounting_sync_configuration: T.nilable(Orb::Models::CustomerCreateParams::AccountingSyncConfiguration), + additional_emails: T.nilable(T::Array[String]), + auto_collection: T.nilable(T::Boolean), + billing_address: T.nilable(Orb::Models::CustomerCreateParams::BillingAddress), + currency: T.nilable(String), + email_delivery: T.nilable(T::Boolean), + external_customer_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + payment_provider: T.nilable(Symbol), + payment_provider_id: T.nilable(String), + reporting_configuration: T.nilable(Orb::Models::CustomerCreateParams::ReportingConfiguration), + shipping_address: T.nilable(Orb::Models::CustomerCreateParams::ShippingAddress), + tax_configuration: T.nilable(Orb::Models::CustomerCreateParams::TaxConfiguration::Variants), + tax_id: T.nilable(Orb::Models::CustomerCreateParams::TaxID), + timezone: T.nilable(String), + request_options: Orb::RequestOpts + ).void + end + def initialize( + email:, + name:, + accounting_sync_configuration: nil, + additional_emails: nil, + auto_collection: nil, + billing_address: nil, + currency: nil, + email_delivery: nil, + external_customer_id: nil, + metadata: nil, + payment_provider: nil, + payment_provider_id: nil, + reporting_configuration: nil, + shipping_address: nil, + tax_configuration: nil, + tax_id: nil, + timezone: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::CustomerCreateParams::Shape) } + def to_h; end + + class AccountingSyncConfiguration < Orb::BaseModel + Shape = T.type_alias do + { + accounting_providers: T.nilable(T::Array[Orb::Models::CustomerCreateParams::AccountingSyncConfiguration::AccountingProvider]), excluded: T.nilable(T::Boolean) + } + end + + sig do + returns(T.nilable(T::Array[Orb::Models::CustomerCreateParams::AccountingSyncConfiguration::AccountingProvider])) + end + attr_accessor :accounting_providers + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :excluded + + sig do + params( + accounting_providers: T.nilable(T::Array[Orb::Models::CustomerCreateParams::AccountingSyncConfiguration::AccountingProvider]), + excluded: T.nilable(T::Boolean) + ).void + end + def initialize(accounting_providers: nil, excluded: nil); end + + sig { returns(Orb::Models::CustomerCreateParams::AccountingSyncConfiguration::Shape) } + def to_h; end + + class AccountingProvider < Orb::BaseModel + Shape = T.type_alias { {external_provider_id: String, provider_type: String} } + + sig { returns(String) } + attr_accessor :external_provider_id + + sig { returns(String) } + attr_accessor :provider_type + + sig { params(external_provider_id: String, provider_type: String).void } + def initialize(external_provider_id:, provider_type:); end + + sig do + returns(Orb::Models::CustomerCreateParams::AccountingSyncConfiguration::AccountingProvider::Shape) + end + def to_h; end + end + end + + class BillingAddress < Orb::BaseModel + Shape = T.type_alias do + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + sig { returns(T.nilable(String)) } + attr_accessor :country + + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + sig { returns(T.nilable(String)) } + attr_accessor :state + + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).void + end + def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil); end + + sig { returns(Orb::Models::CustomerCreateParams::BillingAddress::Shape) } + def to_h; end + end + + class PaymentProvider < Orb::Enum + abstract! + + QUICKBOOKS = T.let(:quickbooks, T.nilable(Symbol)) + BILL_COM = T.let(:"bill.com", T.nilable(Symbol)) + STRIPE_CHARGE = T.let(:stripe_charge, T.nilable(Symbol)) + STRIPE_INVOICE = T.let(:stripe_invoice, T.nilable(Symbol)) + NETSUITE = T.let(:netsuite, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class ReportingConfiguration < Orb::BaseModel + Shape = T.type_alias { {exempt: T::Boolean} } + + sig { returns(T::Boolean) } + attr_accessor :exempt + + sig { params(exempt: T::Boolean).void } + def initialize(exempt:); end + + sig { returns(Orb::Models::CustomerCreateParams::ReportingConfiguration::Shape) } + def to_h; end + end + + class ShippingAddress < Orb::BaseModel + Shape = T.type_alias do + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + sig { returns(T.nilable(String)) } + attr_accessor :country + + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + sig { returns(T.nilable(String)) } + attr_accessor :state + + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).void + end + def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil); end + + sig { returns(Orb::Models::CustomerCreateParams::ShippingAddress::Shape) } + def to_h; end + end + + class TaxConfiguration < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::CustomerCreateParams::TaxConfiguration::NewAvalaraTaxConfiguration, + Orb::Models::CustomerCreateParams::TaxConfiguration::NewTaxJarConfiguration + ) + end + + class NewAvalaraTaxConfiguration < Orb::BaseModel + Shape = T.type_alias do + {tax_exempt: T::Boolean, tax_provider: Symbol, tax_exemption_code: T.nilable(String)} + end + + sig { returns(T::Boolean) } + attr_accessor :tax_exempt + + sig { returns(Symbol) } + attr_accessor :tax_provider + + sig { returns(T.nilable(String)) } + attr_accessor :tax_exemption_code + + sig do + params(tax_exempt: T::Boolean, tax_exemption_code: T.nilable(String), tax_provider: Symbol).void + end + def initialize(tax_exempt:, tax_exemption_code: nil, tax_provider: :avalara); end + + sig do + returns(Orb::Models::CustomerCreateParams::TaxConfiguration::NewAvalaraTaxConfiguration::Shape) + end + def to_h; end + end + + class NewTaxJarConfiguration < Orb::BaseModel + Shape = T.type_alias { {tax_exempt: T::Boolean, tax_provider: Symbol} } + + sig { returns(T::Boolean) } + attr_accessor :tax_exempt + + sig { returns(Symbol) } + attr_accessor :tax_provider + + sig { params(tax_exempt: T::Boolean, tax_provider: Symbol).void } + def initialize(tax_exempt:, tax_provider: :taxjar); end + + sig { returns(Orb::Models::CustomerCreateParams::TaxConfiguration::NewTaxJarConfiguration::Shape) } + def to_h; end + end + + sig do + override.returns( + [ + [Symbol, Orb::Models::CustomerCreateParams::TaxConfiguration::NewAvalaraTaxConfiguration], + [Symbol, Orb::Models::CustomerCreateParams::TaxConfiguration::NewTaxJarConfiguration] + ] + ) + end + private_class_method def self.variants; end + end + + class TaxID < Orb::BaseModel + Shape = T.type_alias { {country: Symbol, type: Symbol, value: String} } + + sig { returns(Symbol) } + attr_accessor :country + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(String) } + attr_accessor :value + + sig { params(country: Symbol, type: Symbol, value: String).void } + def initialize(country:, type:, value:); end + + sig { returns(Orb::Models::CustomerCreateParams::TaxID::Shape) } + def to_h; end + + class Country < Orb::Enum + abstract! + + AD = :AD + AE = :AE + AR = :AR + AT = :AT + AU = :AU + BE = :BE + BG = :BG + BH = :BH + BO = :BO + BR = :BR + CA = :CA + CH = :CH + CL = :CL + CN = :CN + CO = :CO + CR = :CR + CY = :CY + CZ = :CZ + DE = :DE + DK = :DK + EE = :EE + DO = :DO + EC = :EC + EG = :EG + ES = :ES + EU = :EU + FI = :FI + FR = :FR + GB = :GB + GE = :GE + GR = :GR + HK = :HK + HR = :HR + HU = :HU + ID = :ID + IE = :IE + IL = :IL + IN = :IN + IS = :IS + IT = :IT + JP = :JP + KE = :KE + KR = :KR + KZ = :KZ + LI = :LI + LT = :LT + LU = :LU + LV = :LV + MT = :MT + MX = :MX + MY = :MY + NG = :NG + NL = :NL + NO = :NO + NZ = :NZ + OM = :OM + PE = :PE + PH = :PH + PL = :PL + PT = :PT + RO = :RO + RS = :RS + RU = :RU + SA = :SA + SE = :SE + SG = :SG + SI = :SI + SK = :SK + SV = :SV + TH = :TH + TR = :TR + TW = :TW + UA = :UA + US = :US + UY = :UY + VE = :VE + VN = :VN + ZA = :ZA + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class Type < Orb::Enum + abstract! + + AD_NRT = :ad_nrt + AE_TRN = :ae_trn + AR_CUIT = :ar_cuit + EU_VAT = :eu_vat + AU_ABN = :au_abn + AU_ARN = :au_arn + BG_UIC = :bg_uic + BH_VAT = :bh_vat + BO_TIN = :bo_tin + BR_CNPJ = :br_cnpj + BR_CPF = :br_cpf + CA_BN = :ca_bn + CA_GST_HST = :ca_gst_hst + CA_PST_BC = :ca_pst_bc + CA_PST_MB = :ca_pst_mb + CA_PST_SK = :ca_pst_sk + CA_QST = :ca_qst + CH_VAT = :ch_vat + CL_TIN = :cl_tin + CN_TIN = :cn_tin + CO_NIT = :co_nit + CR_TIN = :cr_tin + DO_RCN = :do_rcn + EC_RUC = :ec_ruc + EG_TIN = :eg_tin + ES_CIF = :es_cif + EU_OSS_VAT = :eu_oss_vat + GB_VAT = :gb_vat + GE_VAT = :ge_vat + HK_BR = :hk_br + HU_TIN = :hu_tin + ID_NPWP = :id_npwp + IL_VAT = :il_vat + IN_GST = :in_gst + IS_VAT = :is_vat + JP_CN = :jp_cn + JP_RN = :jp_rn + JP_TRN = :jp_trn + KE_PIN = :ke_pin + KR_BRN = :kr_brn + KZ_BIN = :kz_bin + LI_UID = :li_uid + MX_RFC = :mx_rfc + MY_FRP = :my_frp + MY_ITN = :my_itn + MY_SST = :my_sst + NG_TIN = :ng_tin + NO_VAT = :no_vat + NO_VOEC = :no_voec + NZ_GST = :nz_gst + OM_VAT = :om_vat + PE_RUC = :pe_ruc + PH_TIN = :ph_tin + RO_TIN = :ro_tin + RS_PIB = :rs_pib + RU_INN = :ru_inn + RU_KPP = :ru_kpp + SA_VAT = :sa_vat + SG_GST = :sg_gst + SG_UEN = :sg_uen + SI_TIN = :si_tin + SV_NIT = :sv_nit + TH_VAT = :th_vat + TR_TIN = :tr_tin + TW_VAT = :tw_vat + UA_VAT = :ua_vat + US_EIN = :us_ein + UY_RUC = :uy_ruc + VE_RIF = :ve_rif + VN_TIN = :vn_tin + ZA_VAT = :za_vat + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customer_delete_params.rbi b/rbi/lib/orb/models/customer_delete_params.rbi new file mode 100644 index 00000000..cfb26d14 --- /dev/null +++ b/rbi/lib/orb/models/customer_delete_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class CustomerDeleteParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::CustomerDeleteParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/customer_fetch_by_external_id_params.rbi b/rbi/lib/orb/models/customer_fetch_by_external_id_params.rbi new file mode 100644 index 00000000..be82fb7e --- /dev/null +++ b/rbi/lib/orb/models/customer_fetch_by_external_id_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class CustomerFetchByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::CustomerFetchByExternalIDParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/customer_fetch_params.rbi b/rbi/lib/orb/models/customer_fetch_params.rbi new file mode 100644 index 00000000..65f566a2 --- /dev/null +++ b/rbi/lib/orb/models/customer_fetch_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class CustomerFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::CustomerFetchParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/customer_list_params.rbi b/rbi/lib/orb/models/customer_list_params.rbi new file mode 100644 index 00000000..3208a7d2 --- /dev/null +++ b/rbi/lib/orb/models/customer_list_params.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Orb + module Models + class CustomerListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + cursor: T.nilable(String), + limit: Integer + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_gt + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_gte + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_lt + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_lte + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig do + params( + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + cursor: T.nilable(String), + limit: Integer, + request_options: Orb::RequestOpts + ).void + end + def initialize( + created_at_gt: nil, + created_at_gte: nil, + created_at_lt: nil, + created_at_lte: nil, + cursor: nil, + limit: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::CustomerListParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbi b/rbi/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbi new file mode 100644 index 00000000..31aba563 --- /dev/null +++ b/rbi/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIDParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rbi b/rbi/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rbi new file mode 100644 index 00000000..a92d7b66 --- /dev/null +++ b/rbi/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class CustomerSyncPaymentMethodsFromGatewayParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::CustomerSyncPaymentMethodsFromGatewayParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/customer_update_by_external_id_params.rbi b/rbi/lib/orb/models/customer_update_by_external_id_params.rbi new file mode 100644 index 00000000..57f8a215 --- /dev/null +++ b/rbi/lib/orb/models/customer_update_by_external_id_params.rbi @@ -0,0 +1,546 @@ +# typed: strong + +module Orb + module Models + class CustomerUpdateByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + accounting_sync_configuration: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration), + additional_emails: T.nilable(T::Array[String]), + auto_collection: T.nilable(T::Boolean), + billing_address: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::BillingAddress), + currency: T.nilable(String), + email: T.nilable(String), + email_delivery: T.nilable(T::Boolean), + external_customer_id: T.nilable(String), + metadata: T.nilable( + T::Hash[Symbol, + T.nilable(String)] + ), + name: T.nilable(String), + payment_provider: T.nilable(Symbol), + payment_provider_id: T.nilable(String), + reporting_configuration: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::ReportingConfiguration), + shipping_address: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::ShippingAddress), + tax_configuration: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Variants), + tax_id: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::TaxID) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration)) } + attr_accessor :accounting_sync_configuration + + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :additional_emails + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig { returns(T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::BillingAddress)) } + attr_accessor :billing_address + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :email + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :email_delivery + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(T.nilable(Symbol)) } + attr_accessor :payment_provider + + sig { returns(T.nilable(String)) } + attr_accessor :payment_provider_id + + sig { returns(T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::ReportingConfiguration)) } + attr_accessor :reporting_configuration + + sig { returns(T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::ShippingAddress)) } + attr_accessor :shipping_address + + sig { returns(T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Variants)) } + attr_accessor :tax_configuration + + sig { returns(T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::TaxID)) } + attr_accessor :tax_id + + sig do + params( + accounting_sync_configuration: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration), + additional_emails: T.nilable(T::Array[String]), + auto_collection: T.nilable(T::Boolean), + billing_address: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::BillingAddress), + currency: T.nilable(String), + email: T.nilable(String), + email_delivery: T.nilable(T::Boolean), + external_customer_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + name: T.nilable(String), + payment_provider: T.nilable(Symbol), + payment_provider_id: T.nilable(String), + reporting_configuration: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::ReportingConfiguration), + shipping_address: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::ShippingAddress), + tax_configuration: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Variants), + tax_id: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::TaxID), + request_options: Orb::RequestOpts + ).void + end + def initialize( + accounting_sync_configuration: nil, + additional_emails: nil, + auto_collection: nil, + billing_address: nil, + currency: nil, + email: nil, + email_delivery: nil, + external_customer_id: nil, + metadata: nil, + name: nil, + payment_provider: nil, + payment_provider_id: nil, + reporting_configuration: nil, + shipping_address: nil, + tax_configuration: nil, + tax_id: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::CustomerUpdateByExternalIDParams::Shape) } + def to_h; end + + class AccountingSyncConfiguration < Orb::BaseModel + Shape = T.type_alias do + { + accounting_providers: T.nilable(T::Array[Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration::AccountingProvider]), excluded: T.nilable(T::Boolean) + } + end + + sig do + returns(T.nilable(T::Array[Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration::AccountingProvider])) + end + attr_accessor :accounting_providers + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :excluded + + sig do + params( + accounting_providers: T.nilable(T::Array[Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration::AccountingProvider]), + excluded: T.nilable(T::Boolean) + ).void + end + def initialize(accounting_providers: nil, excluded: nil); end + + sig { returns(Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration::Shape) } + def to_h; end + + class AccountingProvider < Orb::BaseModel + Shape = T.type_alias { {external_provider_id: String, provider_type: String} } + + sig { returns(String) } + attr_accessor :external_provider_id + + sig { returns(String) } + attr_accessor :provider_type + + sig { params(external_provider_id: String, provider_type: String).void } + def initialize(external_provider_id:, provider_type:); end + + sig do + returns(Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration::AccountingProvider::Shape) + end + def to_h; end + end + end + + class BillingAddress < Orb::BaseModel + Shape = T.type_alias do + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + sig { returns(T.nilable(String)) } + attr_accessor :country + + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + sig { returns(T.nilable(String)) } + attr_accessor :state + + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).void + end + def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil); end + + sig { returns(Orb::Models::CustomerUpdateByExternalIDParams::BillingAddress::Shape) } + def to_h; end + end + + class PaymentProvider < Orb::Enum + abstract! + + QUICKBOOKS = T.let(:quickbooks, T.nilable(Symbol)) + BILL_COM = T.let(:"bill.com", T.nilable(Symbol)) + STRIPE_CHARGE = T.let(:stripe_charge, T.nilable(Symbol)) + STRIPE_INVOICE = T.let(:stripe_invoice, T.nilable(Symbol)) + NETSUITE = T.let(:netsuite, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class ReportingConfiguration < Orb::BaseModel + Shape = T.type_alias { {exempt: T::Boolean} } + + sig { returns(T::Boolean) } + attr_accessor :exempt + + sig { params(exempt: T::Boolean).void } + def initialize(exempt:); end + + sig { returns(Orb::Models::CustomerUpdateByExternalIDParams::ReportingConfiguration::Shape) } + def to_h; end + end + + class ShippingAddress < Orb::BaseModel + Shape = T.type_alias do + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + sig { returns(T.nilable(String)) } + attr_accessor :country + + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + sig { returns(T.nilable(String)) } + attr_accessor :state + + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).void + end + def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil); end + + sig { returns(Orb::Models::CustomerUpdateByExternalIDParams::ShippingAddress::Shape) } + def to_h; end + end + + class TaxConfiguration < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewAvalaraTaxConfiguration, + Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewTaxJarConfiguration + ) + end + + class NewAvalaraTaxConfiguration < Orb::BaseModel + Shape = T.type_alias do + {tax_exempt: T::Boolean, tax_provider: Symbol, tax_exemption_code: T.nilable(String)} + end + + sig { returns(T::Boolean) } + attr_accessor :tax_exempt + + sig { returns(Symbol) } + attr_accessor :tax_provider + + sig { returns(T.nilable(String)) } + attr_accessor :tax_exemption_code + + sig do + params(tax_exempt: T::Boolean, tax_exemption_code: T.nilable(String), tax_provider: Symbol).void + end + def initialize(tax_exempt:, tax_exemption_code: nil, tax_provider: :avalara); end + + sig do + returns(Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewAvalaraTaxConfiguration::Shape) + end + def to_h; end + end + + class NewTaxJarConfiguration < Orb::BaseModel + Shape = T.type_alias { {tax_exempt: T::Boolean, tax_provider: Symbol} } + + sig { returns(T::Boolean) } + attr_accessor :tax_exempt + + sig { returns(Symbol) } + attr_accessor :tax_provider + + sig { params(tax_exempt: T::Boolean, tax_provider: Symbol).void } + def initialize(tax_exempt:, tax_provider: :taxjar); end + + sig do + returns(Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewTaxJarConfiguration::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewAvalaraTaxConfiguration + ], + [ + Symbol, + Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewTaxJarConfiguration + ] + ] + ) + end + private_class_method def self.variants; end + end + + class TaxID < Orb::BaseModel + Shape = T.type_alias { {country: Symbol, type: Symbol, value: String} } + + sig { returns(Symbol) } + attr_accessor :country + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(String) } + attr_accessor :value + + sig { params(country: Symbol, type: Symbol, value: String).void } + def initialize(country:, type:, value:); end + + sig { returns(Orb::Models::CustomerUpdateByExternalIDParams::TaxID::Shape) } + def to_h; end + + class Country < Orb::Enum + abstract! + + AD = :AD + AE = :AE + AR = :AR + AT = :AT + AU = :AU + BE = :BE + BG = :BG + BH = :BH + BO = :BO + BR = :BR + CA = :CA + CH = :CH + CL = :CL + CN = :CN + CO = :CO + CR = :CR + CY = :CY + CZ = :CZ + DE = :DE + DK = :DK + EE = :EE + DO = :DO + EC = :EC + EG = :EG + ES = :ES + EU = :EU + FI = :FI + FR = :FR + GB = :GB + GE = :GE + GR = :GR + HK = :HK + HR = :HR + HU = :HU + ID = :ID + IE = :IE + IL = :IL + IN = :IN + IS = :IS + IT = :IT + JP = :JP + KE = :KE + KR = :KR + KZ = :KZ + LI = :LI + LT = :LT + LU = :LU + LV = :LV + MT = :MT + MX = :MX + MY = :MY + NG = :NG + NL = :NL + NO = :NO + NZ = :NZ + OM = :OM + PE = :PE + PH = :PH + PL = :PL + PT = :PT + RO = :RO + RS = :RS + RU = :RU + SA = :SA + SE = :SE + SG = :SG + SI = :SI + SK = :SK + SV = :SV + TH = :TH + TR = :TR + TW = :TW + UA = :UA + US = :US + UY = :UY + VE = :VE + VN = :VN + ZA = :ZA + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class Type < Orb::Enum + abstract! + + AD_NRT = :ad_nrt + AE_TRN = :ae_trn + AR_CUIT = :ar_cuit + EU_VAT = :eu_vat + AU_ABN = :au_abn + AU_ARN = :au_arn + BG_UIC = :bg_uic + BH_VAT = :bh_vat + BO_TIN = :bo_tin + BR_CNPJ = :br_cnpj + BR_CPF = :br_cpf + CA_BN = :ca_bn + CA_GST_HST = :ca_gst_hst + CA_PST_BC = :ca_pst_bc + CA_PST_MB = :ca_pst_mb + CA_PST_SK = :ca_pst_sk + CA_QST = :ca_qst + CH_VAT = :ch_vat + CL_TIN = :cl_tin + CN_TIN = :cn_tin + CO_NIT = :co_nit + CR_TIN = :cr_tin + DO_RCN = :do_rcn + EC_RUC = :ec_ruc + EG_TIN = :eg_tin + ES_CIF = :es_cif + EU_OSS_VAT = :eu_oss_vat + GB_VAT = :gb_vat + GE_VAT = :ge_vat + HK_BR = :hk_br + HU_TIN = :hu_tin + ID_NPWP = :id_npwp + IL_VAT = :il_vat + IN_GST = :in_gst + IS_VAT = :is_vat + JP_CN = :jp_cn + JP_RN = :jp_rn + JP_TRN = :jp_trn + KE_PIN = :ke_pin + KR_BRN = :kr_brn + KZ_BIN = :kz_bin + LI_UID = :li_uid + MX_RFC = :mx_rfc + MY_FRP = :my_frp + MY_ITN = :my_itn + MY_SST = :my_sst + NG_TIN = :ng_tin + NO_VAT = :no_vat + NO_VOEC = :no_voec + NZ_GST = :nz_gst + OM_VAT = :om_vat + PE_RUC = :pe_ruc + PH_TIN = :ph_tin + RO_TIN = :ro_tin + RS_PIB = :rs_pib + RU_INN = :ru_inn + RU_KPP = :ru_kpp + SA_VAT = :sa_vat + SG_GST = :sg_gst + SG_UEN = :sg_uen + SI_TIN = :si_tin + SV_NIT = :sv_nit + TH_VAT = :th_vat + TR_TIN = :tr_tin + TW_VAT = :tw_vat + UA_VAT = :ua_vat + US_EIN = :us_ein + UY_RUC = :uy_ruc + VE_RIF = :ve_rif + VN_TIN = :vn_tin + ZA_VAT = :za_vat + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customer_update_params.rbi b/rbi/lib/orb/models/customer_update_params.rbi new file mode 100644 index 00000000..7abe8618 --- /dev/null +++ b/rbi/lib/orb/models/customer_update_params.rbi @@ -0,0 +1,535 @@ +# typed: strong + +module Orb + module Models + class CustomerUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + accounting_sync_configuration: T.nilable(Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration), + additional_emails: T.nilable(T::Array[String]), + auto_collection: T.nilable(T::Boolean), + billing_address: T.nilable(Orb::Models::CustomerUpdateParams::BillingAddress), + currency: T.nilable(String), + email: T.nilable(String), + email_delivery: T.nilable(T::Boolean), + external_customer_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + name: T.nilable(String), + payment_provider: T.nilable(Symbol), + payment_provider_id: T.nilable(String), + reporting_configuration: T.nilable(Orb::Models::CustomerUpdateParams::ReportingConfiguration), + shipping_address: T.nilable(Orb::Models::CustomerUpdateParams::ShippingAddress), + tax_configuration: T.nilable(Orb::Models::CustomerUpdateParams::TaxConfiguration::Variants), + tax_id: T.nilable(Orb::Models::CustomerUpdateParams::TaxID) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration)) } + attr_accessor :accounting_sync_configuration + + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :additional_emails + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig { returns(T.nilable(Orb::Models::CustomerUpdateParams::BillingAddress)) } + attr_accessor :billing_address + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :email + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :email_delivery + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(T.nilable(Symbol)) } + attr_accessor :payment_provider + + sig { returns(T.nilable(String)) } + attr_accessor :payment_provider_id + + sig { returns(T.nilable(Orb::Models::CustomerUpdateParams::ReportingConfiguration)) } + attr_accessor :reporting_configuration + + sig { returns(T.nilable(Orb::Models::CustomerUpdateParams::ShippingAddress)) } + attr_accessor :shipping_address + + sig { returns(T.nilable(Orb::Models::CustomerUpdateParams::TaxConfiguration::Variants)) } + attr_accessor :tax_configuration + + sig { returns(T.nilable(Orb::Models::CustomerUpdateParams::TaxID)) } + attr_accessor :tax_id + + sig do + params( + accounting_sync_configuration: T.nilable(Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration), + additional_emails: T.nilable(T::Array[String]), + auto_collection: T.nilable(T::Boolean), + billing_address: T.nilable(Orb::Models::CustomerUpdateParams::BillingAddress), + currency: T.nilable(String), + email: T.nilable(String), + email_delivery: T.nilable(T::Boolean), + external_customer_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + name: T.nilable(String), + payment_provider: T.nilable(Symbol), + payment_provider_id: T.nilable(String), + reporting_configuration: T.nilable(Orb::Models::CustomerUpdateParams::ReportingConfiguration), + shipping_address: T.nilable(Orb::Models::CustomerUpdateParams::ShippingAddress), + tax_configuration: T.nilable(Orb::Models::CustomerUpdateParams::TaxConfiguration::Variants), + tax_id: T.nilable(Orb::Models::CustomerUpdateParams::TaxID), + request_options: Orb::RequestOpts + ).void + end + def initialize( + accounting_sync_configuration: nil, + additional_emails: nil, + auto_collection: nil, + billing_address: nil, + currency: nil, + email: nil, + email_delivery: nil, + external_customer_id: nil, + metadata: nil, + name: nil, + payment_provider: nil, + payment_provider_id: nil, + reporting_configuration: nil, + shipping_address: nil, + tax_configuration: nil, + tax_id: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::CustomerUpdateParams::Shape) } + def to_h; end + + class AccountingSyncConfiguration < Orb::BaseModel + Shape = T.type_alias do + { + accounting_providers: T.nilable(T::Array[Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration::AccountingProvider]), excluded: T.nilable(T::Boolean) + } + end + + sig do + returns(T.nilable(T::Array[Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration::AccountingProvider])) + end + attr_accessor :accounting_providers + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :excluded + + sig do + params( + accounting_providers: T.nilable(T::Array[Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration::AccountingProvider]), + excluded: T.nilable(T::Boolean) + ).void + end + def initialize(accounting_providers: nil, excluded: nil); end + + sig { returns(Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration::Shape) } + def to_h; end + + class AccountingProvider < Orb::BaseModel + Shape = T.type_alias { {external_provider_id: String, provider_type: String} } + + sig { returns(String) } + attr_accessor :external_provider_id + + sig { returns(String) } + attr_accessor :provider_type + + sig { params(external_provider_id: String, provider_type: String).void } + def initialize(external_provider_id:, provider_type:); end + + sig do + returns(Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration::AccountingProvider::Shape) + end + def to_h; end + end + end + + class BillingAddress < Orb::BaseModel + Shape = T.type_alias do + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + sig { returns(T.nilable(String)) } + attr_accessor :country + + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + sig { returns(T.nilable(String)) } + attr_accessor :state + + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).void + end + def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil); end + + sig { returns(Orb::Models::CustomerUpdateParams::BillingAddress::Shape) } + def to_h; end + end + + class PaymentProvider < Orb::Enum + abstract! + + QUICKBOOKS = T.let(:quickbooks, T.nilable(Symbol)) + BILL_COM = T.let(:"bill.com", T.nilable(Symbol)) + STRIPE_CHARGE = T.let(:stripe_charge, T.nilable(Symbol)) + STRIPE_INVOICE = T.let(:stripe_invoice, T.nilable(Symbol)) + NETSUITE = T.let(:netsuite, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class ReportingConfiguration < Orb::BaseModel + Shape = T.type_alias { {exempt: T::Boolean} } + + sig { returns(T::Boolean) } + attr_accessor :exempt + + sig { params(exempt: T::Boolean).void } + def initialize(exempt:); end + + sig { returns(Orb::Models::CustomerUpdateParams::ReportingConfiguration::Shape) } + def to_h; end + end + + class ShippingAddress < Orb::BaseModel + Shape = T.type_alias do + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + sig { returns(T.nilable(String)) } + attr_accessor :country + + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + sig { returns(T.nilable(String)) } + attr_accessor :state + + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).void + end + def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil); end + + sig { returns(Orb::Models::CustomerUpdateParams::ShippingAddress::Shape) } + def to_h; end + end + + class TaxConfiguration < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::CustomerUpdateParams::TaxConfiguration::NewAvalaraTaxConfiguration, + Orb::Models::CustomerUpdateParams::TaxConfiguration::NewTaxJarConfiguration + ) + end + + class NewAvalaraTaxConfiguration < Orb::BaseModel + Shape = T.type_alias do + {tax_exempt: T::Boolean, tax_provider: Symbol, tax_exemption_code: T.nilable(String)} + end + + sig { returns(T::Boolean) } + attr_accessor :tax_exempt + + sig { returns(Symbol) } + attr_accessor :tax_provider + + sig { returns(T.nilable(String)) } + attr_accessor :tax_exemption_code + + sig do + params(tax_exempt: T::Boolean, tax_exemption_code: T.nilable(String), tax_provider: Symbol).void + end + def initialize(tax_exempt:, tax_exemption_code: nil, tax_provider: :avalara); end + + sig do + returns(Orb::Models::CustomerUpdateParams::TaxConfiguration::NewAvalaraTaxConfiguration::Shape) + end + def to_h; end + end + + class NewTaxJarConfiguration < Orb::BaseModel + Shape = T.type_alias { {tax_exempt: T::Boolean, tax_provider: Symbol} } + + sig { returns(T::Boolean) } + attr_accessor :tax_exempt + + sig { returns(Symbol) } + attr_accessor :tax_provider + + sig { params(tax_exempt: T::Boolean, tax_provider: Symbol).void } + def initialize(tax_exempt:, tax_provider: :taxjar); end + + sig { returns(Orb::Models::CustomerUpdateParams::TaxConfiguration::NewTaxJarConfiguration::Shape) } + def to_h; end + end + + sig do + override.returns( + [ + [Symbol, Orb::Models::CustomerUpdateParams::TaxConfiguration::NewAvalaraTaxConfiguration], + [Symbol, Orb::Models::CustomerUpdateParams::TaxConfiguration::NewTaxJarConfiguration] + ] + ) + end + private_class_method def self.variants; end + end + + class TaxID < Orb::BaseModel + Shape = T.type_alias { {country: Symbol, type: Symbol, value: String} } + + sig { returns(Symbol) } + attr_accessor :country + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(String) } + attr_accessor :value + + sig { params(country: Symbol, type: Symbol, value: String).void } + def initialize(country:, type:, value:); end + + sig { returns(Orb::Models::CustomerUpdateParams::TaxID::Shape) } + def to_h; end + + class Country < Orb::Enum + abstract! + + AD = :AD + AE = :AE + AR = :AR + AT = :AT + AU = :AU + BE = :BE + BG = :BG + BH = :BH + BO = :BO + BR = :BR + CA = :CA + CH = :CH + CL = :CL + CN = :CN + CO = :CO + CR = :CR + CY = :CY + CZ = :CZ + DE = :DE + DK = :DK + EE = :EE + DO = :DO + EC = :EC + EG = :EG + ES = :ES + EU = :EU + FI = :FI + FR = :FR + GB = :GB + GE = :GE + GR = :GR + HK = :HK + HR = :HR + HU = :HU + ID = :ID + IE = :IE + IL = :IL + IN = :IN + IS = :IS + IT = :IT + JP = :JP + KE = :KE + KR = :KR + KZ = :KZ + LI = :LI + LT = :LT + LU = :LU + LV = :LV + MT = :MT + MX = :MX + MY = :MY + NG = :NG + NL = :NL + NO = :NO + NZ = :NZ + OM = :OM + PE = :PE + PH = :PH + PL = :PL + PT = :PT + RO = :RO + RS = :RS + RU = :RU + SA = :SA + SE = :SE + SG = :SG + SI = :SI + SK = :SK + SV = :SV + TH = :TH + TR = :TR + TW = :TW + UA = :UA + US = :US + UY = :UY + VE = :VE + VN = :VN + ZA = :ZA + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class Type < Orb::Enum + abstract! + + AD_NRT = :ad_nrt + AE_TRN = :ae_trn + AR_CUIT = :ar_cuit + EU_VAT = :eu_vat + AU_ABN = :au_abn + AU_ARN = :au_arn + BG_UIC = :bg_uic + BH_VAT = :bh_vat + BO_TIN = :bo_tin + BR_CNPJ = :br_cnpj + BR_CPF = :br_cpf + CA_BN = :ca_bn + CA_GST_HST = :ca_gst_hst + CA_PST_BC = :ca_pst_bc + CA_PST_MB = :ca_pst_mb + CA_PST_SK = :ca_pst_sk + CA_QST = :ca_qst + CH_VAT = :ch_vat + CL_TIN = :cl_tin + CN_TIN = :cn_tin + CO_NIT = :co_nit + CR_TIN = :cr_tin + DO_RCN = :do_rcn + EC_RUC = :ec_ruc + EG_TIN = :eg_tin + ES_CIF = :es_cif + EU_OSS_VAT = :eu_oss_vat + GB_VAT = :gb_vat + GE_VAT = :ge_vat + HK_BR = :hk_br + HU_TIN = :hu_tin + ID_NPWP = :id_npwp + IL_VAT = :il_vat + IN_GST = :in_gst + IS_VAT = :is_vat + JP_CN = :jp_cn + JP_RN = :jp_rn + JP_TRN = :jp_trn + KE_PIN = :ke_pin + KR_BRN = :kr_brn + KZ_BIN = :kz_bin + LI_UID = :li_uid + MX_RFC = :mx_rfc + MY_FRP = :my_frp + MY_ITN = :my_itn + MY_SST = :my_sst + NG_TIN = :ng_tin + NO_VAT = :no_vat + NO_VOEC = :no_voec + NZ_GST = :nz_gst + OM_VAT = :om_vat + PE_RUC = :pe_ruc + PH_TIN = :ph_tin + RO_TIN = :ro_tin + RS_PIB = :rs_pib + RU_INN = :ru_inn + RU_KPP = :ru_kpp + SA_VAT = :sa_vat + SG_GST = :sg_gst + SG_UEN = :sg_uen + SI_TIN = :si_tin + SV_NIT = :sv_nit + TH_VAT = :th_vat + TR_TIN = :tr_tin + TW_VAT = :tw_vat + UA_VAT = :ua_vat + US_EIN = :us_ein + UY_RUC = :uy_ruc + VE_RIF = :ve_rif + VN_TIN = :vn_tin + ZA_VAT = :za_vat + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/balance_transaction_create_params.rbi b/rbi/lib/orb/models/customers/balance_transaction_create_params.rbi new file mode 100644 index 00000000..ad67a985 --- /dev/null +++ b/rbi/lib/orb/models/customers/balance_transaction_create_params.rbi @@ -0,0 +1,48 @@ +# typed: strong + +module Orb + module Models + module Customers + class BalanceTransactionCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all({amount: String, type: Symbol, description: T.nilable(String)}, Orb::RequestParameters::Shape) + end + + sig { returns(String) } + attr_accessor :amount + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig do + params( + amount: String, + type: Symbol, + description: T.nilable(String), + request_options: Orb::RequestOpts + ).void + end + def initialize(amount:, type:, description: nil, request_options: {}); end + + sig { returns(Orb::Models::Customers::BalanceTransactionCreateParams::Shape) } + def to_h; end + + class Type < Orb::Enum + abstract! + + INCREMENT = :increment + DECREMENT = :decrement + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/balance_transaction_create_response.rbi b/rbi/lib/orb/models/customers/balance_transaction_create_response.rbi new file mode 100644 index 00000000..b66dda00 --- /dev/null +++ b/rbi/lib/orb/models/customers/balance_transaction_create_response.rbi @@ -0,0 +1,136 @@ +# typed: strong + +module Orb + module Models + module Customers + class BalanceTransactionCreateResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + action: Symbol, + amount: String, + created_at: Time, + credit_note: T.nilable(Orb::Models::Customers::BalanceTransactionCreateResponse::CreditNote), + description: T.nilable(String), + ending_balance: String, + invoice: T.nilable(Orb::Models::Customers::BalanceTransactionCreateResponse::Invoice), + starting_balance: String, + type: Symbol + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :action + + sig { returns(String) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Customers::BalanceTransactionCreateResponse::CreditNote)) } + attr_accessor :credit_note + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(String) } + attr_accessor :ending_balance + + sig { returns(T.nilable(Orb::Models::Customers::BalanceTransactionCreateResponse::Invoice)) } + attr_accessor :invoice + + sig { returns(String) } + attr_accessor :starting_balance + + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + id: String, + action: Symbol, + amount: String, + created_at: Time, + credit_note: T.nilable(Orb::Models::Customers::BalanceTransactionCreateResponse::CreditNote), + description: T.nilable(String), + ending_balance: String, + invoice: T.nilable(Orb::Models::Customers::BalanceTransactionCreateResponse::Invoice), + starting_balance: String, + type: Symbol + ).void + end + def initialize( + id:, + action:, + amount:, + created_at:, + credit_note:, + description:, + ending_balance:, + invoice:, + starting_balance:, + type: + ); end + + sig { returns(Orb::Models::Customers::BalanceTransactionCreateResponse::Shape) } + def to_h; end + + class Action < Orb::Enum + abstract! + + APPLIED_TO_INVOICE = :applied_to_invoice + MANUAL_ADJUSTMENT = :manual_adjustment + PRORATED_REFUND = :prorated_refund + REVERT_PRORATED_REFUND = :revert_prorated_refund + RETURN_FROM_VOIDING = :return_from_voiding + CREDIT_NOTE_APPLIED = :credit_note_applied + CREDIT_NOTE_VOIDED = :credit_note_voided + OVERPAYMENT_REFUND = :overpayment_refund + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditNote < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Customers::BalanceTransactionCreateResponse::CreditNote::Shape) } + def to_h; end + end + + class Invoice < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Customers::BalanceTransactionCreateResponse::Invoice::Shape) } + def to_h; end + end + + class Type < Orb::Enum + abstract! + + INCREMENT = :increment + DECREMENT = :decrement + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/balance_transaction_list_params.rbi b/rbi/lib/orb/models/customers/balance_transaction_list_params.rbi new file mode 100644 index 00000000..a9a1ec85 --- /dev/null +++ b/rbi/lib/orb/models/customers/balance_transaction_list_params.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Orb + module Models + module Customers + class BalanceTransactionListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + cursor: T.nilable(String), + limit: Integer, + operation_time_gt: T.nilable(Time), + operation_time_gte: T.nilable(Time), + operation_time_lt: T.nilable(Time), + operation_time_lte: T.nilable(Time) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { returns(T.nilable(Time)) } + attr_accessor :operation_time_gt + + sig { returns(T.nilable(Time)) } + attr_accessor :operation_time_gte + + sig { returns(T.nilable(Time)) } + attr_accessor :operation_time_lt + + sig { returns(T.nilable(Time)) } + attr_accessor :operation_time_lte + + sig do + params( + cursor: T.nilable(String), + limit: Integer, + operation_time_gt: T.nilable(Time), + operation_time_gte: T.nilable(Time), + operation_time_lt: T.nilable(Time), + operation_time_lte: T.nilable(Time), + request_options: Orb::RequestOpts + ).void + end + def initialize( + cursor: nil, + limit: nil, + operation_time_gt: nil, + operation_time_gte: nil, + operation_time_lt: nil, + operation_time_lte: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::Customers::BalanceTransactionListParams::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/balance_transaction_list_response.rbi b/rbi/lib/orb/models/customers/balance_transaction_list_response.rbi new file mode 100644 index 00000000..6653a79c --- /dev/null +++ b/rbi/lib/orb/models/customers/balance_transaction_list_response.rbi @@ -0,0 +1,136 @@ +# typed: strong + +module Orb + module Models + module Customers + class BalanceTransactionListResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + action: Symbol, + amount: String, + created_at: Time, + credit_note: T.nilable(Orb::Models::Customers::BalanceTransactionListResponse::CreditNote), + description: T.nilable(String), + ending_balance: String, + invoice: T.nilable(Orb::Models::Customers::BalanceTransactionListResponse::Invoice), + starting_balance: String, + type: Symbol + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :action + + sig { returns(String) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Customers::BalanceTransactionListResponse::CreditNote)) } + attr_accessor :credit_note + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(String) } + attr_accessor :ending_balance + + sig { returns(T.nilable(Orb::Models::Customers::BalanceTransactionListResponse::Invoice)) } + attr_accessor :invoice + + sig { returns(String) } + attr_accessor :starting_balance + + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + id: String, + action: Symbol, + amount: String, + created_at: Time, + credit_note: T.nilable(Orb::Models::Customers::BalanceTransactionListResponse::CreditNote), + description: T.nilable(String), + ending_balance: String, + invoice: T.nilable(Orb::Models::Customers::BalanceTransactionListResponse::Invoice), + starting_balance: String, + type: Symbol + ).void + end + def initialize( + id:, + action:, + amount:, + created_at:, + credit_note:, + description:, + ending_balance:, + invoice:, + starting_balance:, + type: + ); end + + sig { returns(Orb::Models::Customers::BalanceTransactionListResponse::Shape) } + def to_h; end + + class Action < Orb::Enum + abstract! + + APPLIED_TO_INVOICE = :applied_to_invoice + MANUAL_ADJUSTMENT = :manual_adjustment + PRORATED_REFUND = :prorated_refund + REVERT_PRORATED_REFUND = :revert_prorated_refund + RETURN_FROM_VOIDING = :return_from_voiding + CREDIT_NOTE_APPLIED = :credit_note_applied + CREDIT_NOTE_VOIDED = :credit_note_voided + OVERPAYMENT_REFUND = :overpayment_refund + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditNote < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Customers::BalanceTransactionListResponse::CreditNote::Shape) } + def to_h; end + end + + class Invoice < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Customers::BalanceTransactionListResponse::Invoice::Shape) } + def to_h; end + end + + class Type < Orb::Enum + abstract! + + INCREMENT = :increment + DECREMENT = :decrement + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/cost_list_by_external_id_params.rbi b/rbi/lib/orb/models/customers/cost_list_by_external_id_params.rbi new file mode 100644 index 00000000..173ffece --- /dev/null +++ b/rbi/lib/orb/models/customers/cost_list_by_external_id_params.rbi @@ -0,0 +1,67 @@ +# typed: strong + +module Orb + module Models + module Customers + class CostListByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + currency: T.nilable(String), + timeframe_end: T.nilable(Time), + timeframe_start: T.nilable(Time), + view_mode: T.nilable(Symbol) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(Time)) } + attr_accessor :timeframe_end + + sig { returns(T.nilable(Time)) } + attr_accessor :timeframe_start + + sig { returns(T.nilable(Symbol)) } + attr_accessor :view_mode + + sig do + params( + currency: T.nilable(String), + timeframe_end: T.nilable(Time), + timeframe_start: T.nilable(Time), + view_mode: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).void + end + def initialize( + currency: nil, + timeframe_end: nil, + timeframe_start: nil, + view_mode: nil, + request_options: {} + ) + end + + sig { returns(Orb::Models::Customers::CostListByExternalIDParams::Shape) } + def to_h; end + + class ViewMode < Orb::Enum + abstract! + + PERIODIC = T.let(:periodic, T.nilable(Symbol)) + CUMULATIVE = T.let(:cumulative, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/cost_list_by_external_id_response.rbi b/rbi/lib/orb/models/customers/cost_list_by_external_id_response.rbi new file mode 100644 index 00000000..9808b47d --- /dev/null +++ b/rbi/lib/orb/models/customers/cost_list_by_external_id_response.rbi @@ -0,0 +1,97 @@ +# typed: strong + +module Orb + module Models + module Customers + class CostListByExternalIDResponse < Orb::BaseModel + Shape = T.type_alias { {data: T::Array[Orb::Models::Customers::CostListByExternalIDResponse::Data]} } + + sig { returns(T::Array[Orb::Models::Customers::CostListByExternalIDResponse::Data]) } + attr_accessor :data + + sig { params(data: T::Array[Orb::Models::Customers::CostListByExternalIDResponse::Data]).void } + def initialize(data:); end + + sig { returns(Orb::Models::Customers::CostListByExternalIDResponse::Shape) } + def to_h; end + + class Data < Orb::BaseModel + Shape = T.type_alias do + { + per_price_costs: T::Array[Orb::Models::Customers::CostListByExternalIDResponse::Data::PerPriceCost], + subtotal: String, + timeframe_end: Time, + timeframe_start: Time, + total: String + } + end + + sig { returns(T::Array[Orb::Models::Customers::CostListByExternalIDResponse::Data::PerPriceCost]) } + attr_accessor :per_price_costs + + sig { returns(String) } + attr_accessor :subtotal + + sig { returns(Time) } + attr_accessor :timeframe_end + + sig { returns(Time) } + attr_accessor :timeframe_start + + sig { returns(String) } + attr_accessor :total + + sig do + params( + per_price_costs: T::Array[Orb::Models::Customers::CostListByExternalIDResponse::Data::PerPriceCost], + subtotal: String, + timeframe_end: Time, + timeframe_start: Time, + total: String + ).void + end + def initialize(per_price_costs:, subtotal:, timeframe_end:, timeframe_start:, total:); end + + sig { returns(Orb::Models::Customers::CostListByExternalIDResponse::Data::Shape) } + def to_h; end + + class PerPriceCost < Orb::BaseModel + Shape = T.type_alias do + { + price: Orb::Models::Price::Variants, + subtotal: String, + total: String, + quantity: T.nilable(Float) + } + end + + sig { returns(Orb::Models::Price::Variants) } + attr_accessor :price + + sig { returns(String) } + attr_accessor :subtotal + + sig { returns(String) } + attr_accessor :total + + sig { returns(T.nilable(Float)) } + attr_accessor :quantity + + sig do + params( + price: Orb::Models::Price::Variants, + subtotal: String, + total: String, + quantity: T.nilable(Float) + ).void + end + def initialize(price:, subtotal:, total:, quantity: nil); end + + sig { returns(Orb::Models::Customers::CostListByExternalIDResponse::Data::PerPriceCost::Shape) } + def to_h; end + end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/cost_list_params.rbi b/rbi/lib/orb/models/customers/cost_list_params.rbi new file mode 100644 index 00000000..7657cc71 --- /dev/null +++ b/rbi/lib/orb/models/customers/cost_list_params.rbi @@ -0,0 +1,67 @@ +# typed: strong + +module Orb + module Models + module Customers + class CostListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + currency: T.nilable(String), + timeframe_end: T.nilable(Time), + timeframe_start: T.nilable(Time), + view_mode: T.nilable(Symbol) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(Time)) } + attr_accessor :timeframe_end + + sig { returns(T.nilable(Time)) } + attr_accessor :timeframe_start + + sig { returns(T.nilable(Symbol)) } + attr_accessor :view_mode + + sig do + params( + currency: T.nilable(String), + timeframe_end: T.nilable(Time), + timeframe_start: T.nilable(Time), + view_mode: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).void + end + def initialize( + currency: nil, + timeframe_end: nil, + timeframe_start: nil, + view_mode: nil, + request_options: {} + ) + end + + sig { returns(Orb::Models::Customers::CostListParams::Shape) } + def to_h; end + + class ViewMode < Orb::Enum + abstract! + + PERIODIC = T.let(:periodic, T.nilable(Symbol)) + CUMULATIVE = T.let(:cumulative, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/cost_list_response.rbi b/rbi/lib/orb/models/customers/cost_list_response.rbi new file mode 100644 index 00000000..4d12b672 --- /dev/null +++ b/rbi/lib/orb/models/customers/cost_list_response.rbi @@ -0,0 +1,97 @@ +# typed: strong + +module Orb + module Models + module Customers + class CostListResponse < Orb::BaseModel + Shape = T.type_alias { {data: T::Array[Orb::Models::Customers::CostListResponse::Data]} } + + sig { returns(T::Array[Orb::Models::Customers::CostListResponse::Data]) } + attr_accessor :data + + sig { params(data: T::Array[Orb::Models::Customers::CostListResponse::Data]).void } + def initialize(data:); end + + sig { returns(Orb::Models::Customers::CostListResponse::Shape) } + def to_h; end + + class Data < Orb::BaseModel + Shape = T.type_alias do + { + per_price_costs: T::Array[Orb::Models::Customers::CostListResponse::Data::PerPriceCost], + subtotal: String, + timeframe_end: Time, + timeframe_start: Time, + total: String + } + end + + sig { returns(T::Array[Orb::Models::Customers::CostListResponse::Data::PerPriceCost]) } + attr_accessor :per_price_costs + + sig { returns(String) } + attr_accessor :subtotal + + sig { returns(Time) } + attr_accessor :timeframe_end + + sig { returns(Time) } + attr_accessor :timeframe_start + + sig { returns(String) } + attr_accessor :total + + sig do + params( + per_price_costs: T::Array[Orb::Models::Customers::CostListResponse::Data::PerPriceCost], + subtotal: String, + timeframe_end: Time, + timeframe_start: Time, + total: String + ).void + end + def initialize(per_price_costs:, subtotal:, timeframe_end:, timeframe_start:, total:); end + + sig { returns(Orb::Models::Customers::CostListResponse::Data::Shape) } + def to_h; end + + class PerPriceCost < Orb::BaseModel + Shape = T.type_alias do + { + price: Orb::Models::Price::Variants, + subtotal: String, + total: String, + quantity: T.nilable(Float) + } + end + + sig { returns(Orb::Models::Price::Variants) } + attr_accessor :price + + sig { returns(String) } + attr_accessor :subtotal + + sig { returns(String) } + attr_accessor :total + + sig { returns(T.nilable(Float)) } + attr_accessor :quantity + + sig do + params( + price: Orb::Models::Price::Variants, + subtotal: String, + total: String, + quantity: T.nilable(Float) + ).void + end + def initialize(price:, subtotal:, total:, quantity: nil); end + + sig { returns(Orb::Models::Customers::CostListResponse::Data::PerPriceCost::Shape) } + def to_h; end + end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credit_list_by_external_id_params.rbi b/rbi/lib/orb/models/customers/credit_list_by_external_id_params.rbi new file mode 100644 index 00000000..4e9cfc17 --- /dev/null +++ b/rbi/lib/orb/models/customers/credit_list_by_external_id_params.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module Orb + module Models + module Customers + class CreditListByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + currency: T.nilable(String), + cursor: T.nilable(String), + include_all_blocks: T::Boolean, + limit: Integer + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_all_blocks + + sig { params(include_all_blocks: T::Boolean).void } + attr_writer :include_all_blocks + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig do + params( + currency: T.nilable(String), + cursor: T.nilable(String), + include_all_blocks: T::Boolean, + limit: Integer, + request_options: Orb::RequestOpts + ).void + end + def initialize(currency: nil, cursor: nil, include_all_blocks: nil, limit: nil, request_options: {}) + end + + sig { returns(Orb::Models::Customers::CreditListByExternalIDParams::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credit_list_by_external_id_response.rbi b/rbi/lib/orb/models/customers/credit_list_by_external_id_response.rbi new file mode 100644 index 00000000..268305e6 --- /dev/null +++ b/rbi/lib/orb/models/customers/credit_list_by_external_id_response.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Orb + module Models + module Customers + class CreditListByExternalIDResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + balance: Float, + effective_date: T.nilable(Time), + expiry_date: T.nilable(Time), + maximum_initial_balance: T.nilable(Float), + per_unit_cost_basis: T.nilable(String), + status: Symbol + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :balance + + sig { returns(T.nilable(Time)) } + attr_accessor :effective_date + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(Float)) } + attr_accessor :maximum_initial_balance + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig { returns(Symbol) } + attr_accessor :status + + sig do + params( + id: String, + balance: Float, + effective_date: T.nilable(Time), + expiry_date: T.nilable(Time), + maximum_initial_balance: T.nilable(Float), + per_unit_cost_basis: T.nilable(String), + status: Symbol + ).void + end + def initialize( + id:, + balance:, + effective_date:, + expiry_date:, + maximum_initial_balance:, + per_unit_cost_basis:, + status: + ) + end + + sig { returns(Orb::Models::Customers::CreditListByExternalIDResponse::Shape) } + def to_h; end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + PENDING_PAYMENT = :pending_payment + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credit_list_params.rbi b/rbi/lib/orb/models/customers/credit_list_params.rbi new file mode 100644 index 00000000..eb12cfee --- /dev/null +++ b/rbi/lib/orb/models/customers/credit_list_params.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module Orb + module Models + module Customers + class CreditListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + currency: T.nilable(String), + cursor: T.nilable(String), + include_all_blocks: T::Boolean, + limit: Integer + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_all_blocks + + sig { params(include_all_blocks: T::Boolean).void } + attr_writer :include_all_blocks + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig do + params( + currency: T.nilable(String), + cursor: T.nilable(String), + include_all_blocks: T::Boolean, + limit: Integer, + request_options: Orb::RequestOpts + ).void + end + def initialize(currency: nil, cursor: nil, include_all_blocks: nil, limit: nil, request_options: {}) + end + + sig { returns(Orb::Models::Customers::CreditListParams::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credit_list_response.rbi b/rbi/lib/orb/models/customers/credit_list_response.rbi new file mode 100644 index 00000000..ab7e9fab --- /dev/null +++ b/rbi/lib/orb/models/customers/credit_list_response.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Orb + module Models + module Customers + class CreditListResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + balance: Float, + effective_date: T.nilable(Time), + expiry_date: T.nilable(Time), + maximum_initial_balance: T.nilable(Float), + per_unit_cost_basis: T.nilable(String), + status: Symbol + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :balance + + sig { returns(T.nilable(Time)) } + attr_accessor :effective_date + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(Float)) } + attr_accessor :maximum_initial_balance + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig { returns(Symbol) } + attr_accessor :status + + sig do + params( + id: String, + balance: Float, + effective_date: T.nilable(Time), + expiry_date: T.nilable(Time), + maximum_initial_balance: T.nilable(Float), + per_unit_cost_basis: T.nilable(String), + status: Symbol + ).void + end + def initialize( + id:, + balance:, + effective_date:, + expiry_date:, + maximum_initial_balance:, + per_unit_cost_basis:, + status: + ) + end + + sig { returns(Orb::Models::Customers::CreditListResponse::Shape) } + def to_h; end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + PENDING_PAYMENT = :pending_payment + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi b/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi new file mode 100644 index 00000000..bfab8ead --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi @@ -0,0 +1,167 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class LedgerCreateEntryByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + amount: Float, + entry_type: Symbol, + currency: T.nilable(String), + description: T.nilable(String), + effective_date: T.nilable(Time), + expiry_date: T.nilable(Time), + invoice_settings: T.nilable(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + per_unit_cost_basis: T.nilable(String), + target_expiry_date: Date, + block_id: String, + void_reason: T.nilable(Symbol) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(T.nilable(Time)) } + attr_accessor :effective_date + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig do + returns(T.nilable(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings)) + end + attr_accessor :invoice_settings + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig { returns(Date) } + attr_accessor :target_expiry_date + + sig { returns(String) } + attr_accessor :block_id + + sig { returns(T.nilable(Symbol)) } + attr_accessor :void_reason + + sig do + params( + amount: Float, + entry_type: Symbol, + expiry_date: T.nilable(Time), + target_expiry_date: Date, + block_id: String, + currency: T.nilable(String), + description: T.nilable(String), + effective_date: T.nilable(Time), + invoice_settings: T.nilable(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + per_unit_cost_basis: T.nilable(String), + void_reason: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).void + end + def initialize( + amount:, + entry_type:, + expiry_date:, + target_expiry_date:, + block_id:, + currency: nil, + description: nil, + effective_date: nil, + invoice_settings: nil, + metadata: nil, + per_unit_cost_basis: nil, + void_reason: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::Shape) } + def to_h; end + + class EntryType < Orb::Enum + abstract! + + AMENDMENT = :amendment + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class InvoiceSettings < Orb::BaseModel + Shape = T.type_alias do + { + auto_collection: T::Boolean, + net_terms: Integer, + memo: T.nilable(String), + require_successful_payment: T::Boolean + } + end + + sig { returns(T::Boolean) } + attr_accessor :auto_collection + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :require_successful_payment + + sig { params(require_successful_payment: T::Boolean).void } + attr_writer :require_successful_payment + + sig do + params( + auto_collection: T::Boolean, + net_terms: Integer, + memo: T.nilable(String), + require_successful_payment: T::Boolean + ).void + end + def initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::Shape) + end + def to_h; end + end + + class VoidReason < Orb::Enum + abstract! + + REFUND = T.let(:refund, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbi b/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbi new file mode 100644 index 00000000..59c4041a --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbi @@ -0,0 +1,1193 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class LedgerCreateEntryByExternalIDResponse < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry, + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry, + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry, + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry, + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry, + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry, + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry + ) + end + + class IncrementLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + entry_type: :increment + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class DecrementLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + event_id: T.nilable(String), + invoice_id: T.nilable(String), + price_id: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig { returns(T.nilable(String)) } + attr_accessor :event_id + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_id + + sig { returns(T.nilable(String)) } + attr_accessor :price_id + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + event_id: T.nilable(String), + invoice_id: T.nilable(String), + price_id: T.nilable(String), + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + event_id: nil, + invoice_id: nil, + price_id: nil, + entry_type: :decrement + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class ExpirationChangeLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + new_block_expiry_date: T.nilable(Time), + starting_balance: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Time)) } + attr_accessor :new_block_expiry_date + + sig { returns(Float) } + attr_accessor :starting_balance + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + new_block_expiry_date: T.nilable(Time), + starting_balance: Float, + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + new_block_expiry_date:, + starting_balance:, + entry_type: :expiration_change + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class CreditBlockExpiryLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + entry_type: :credit_block_expiry + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class VoidLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + void_amount: Float, + void_reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig { returns(Float) } + attr_accessor :void_amount + + sig { returns(T.nilable(String)) } + attr_accessor :void_reason + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + void_amount: Float, + void_reason: T.nilable(String), + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + void_amount:, + void_reason:, + entry_type: :void + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class VoidInitiatedLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + new_block_expiry_date: Time, + starting_balance: Float, + void_amount: Float, + void_reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Time) } + attr_accessor :new_block_expiry_date + + sig { returns(Float) } + attr_accessor :starting_balance + + sig { returns(Float) } + attr_accessor :void_amount + + sig { returns(T.nilable(String)) } + attr_accessor :void_reason + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + new_block_expiry_date: Time, + starting_balance: Float, + void_amount: Float, + void_reason: T.nilable(String), + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + new_block_expiry_date:, + starting_balance:, + void_amount:, + void_reason:, + entry_type: :void_initiated + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class AmendmentLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + entry_type: :amendment + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry + ], + [ + Symbol, + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry + ], + [ + Symbol, + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry + ], + [ + Symbol, + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry + ], + [ + Symbol, + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry + ], + [ + Symbol, + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry + ], + [ + Symbol, + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry + ] + ] + ) + end + private_class_method def self.variants; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/ledger_create_entry_params.rbi b/rbi/lib/orb/models/customers/credits/ledger_create_entry_params.rbi new file mode 100644 index 00000000..13737768 --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/ledger_create_entry_params.rbi @@ -0,0 +1,165 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class LedgerCreateEntryParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + amount: Float, + entry_type: Symbol, + currency: T.nilable(String), + description: T.nilable(String), + effective_date: T.nilable(Time), + expiry_date: T.nilable(Time), + invoice_settings: T.nilable(Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + per_unit_cost_basis: T.nilable(String), + target_expiry_date: Date, + block_id: String, + void_reason: T.nilable(Symbol) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(T.nilable(Time)) } + attr_accessor :effective_date + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig do + returns(T.nilable(Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings)) + end + attr_accessor :invoice_settings + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig { returns(Date) } + attr_accessor :target_expiry_date + + sig { returns(String) } + attr_accessor :block_id + + sig { returns(T.nilable(Symbol)) } + attr_accessor :void_reason + + sig do + params( + amount: Float, + entry_type: Symbol, + expiry_date: T.nilable(Time), + target_expiry_date: Date, + block_id: String, + currency: T.nilable(String), + description: T.nilable(String), + effective_date: T.nilable(Time), + invoice_settings: T.nilable(Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + per_unit_cost_basis: T.nilable(String), + void_reason: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).void + end + def initialize( + amount:, + entry_type:, + expiry_date:, + target_expiry_date:, + block_id:, + currency: nil, + description: nil, + effective_date: nil, + invoice_settings: nil, + metadata: nil, + per_unit_cost_basis: nil, + void_reason: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::Customers::Credits::LedgerCreateEntryParams::Shape) } + def to_h; end + + class EntryType < Orb::Enum + abstract! + + AMENDMENT = :amendment + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class InvoiceSettings < Orb::BaseModel + Shape = T.type_alias do + { + auto_collection: T::Boolean, + net_terms: Integer, + memo: T.nilable(String), + require_successful_payment: T::Boolean + } + end + + sig { returns(T::Boolean) } + attr_accessor :auto_collection + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :require_successful_payment + + sig { params(require_successful_payment: T::Boolean).void } + attr_writer :require_successful_payment + + sig do + params( + auto_collection: T::Boolean, + net_terms: Integer, + memo: T.nilable(String), + require_successful_payment: T::Boolean + ).void + end + def initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil); end + + sig { returns(Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::Shape) } + def to_h; end + end + + class VoidReason < Orb::Enum + abstract! + + REFUND = T.let(:refund, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/ledger_create_entry_response.rbi b/rbi/lib/orb/models/customers/credits/ledger_create_entry_response.rbi new file mode 100644 index 00000000..b087daeb --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/ledger_create_entry_response.rbi @@ -0,0 +1,1184 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class LedgerCreateEntryResponse < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry, + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry, + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry, + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry, + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry, + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry, + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry + ) + end + + class IncrementLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + entry_type: :increment + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class DecrementLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + event_id: T.nilable(String), + invoice_id: T.nilable(String), + price_id: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig { returns(T.nilable(String)) } + attr_accessor :event_id + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_id + + sig { returns(T.nilable(String)) } + attr_accessor :price_id + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + event_id: T.nilable(String), + invoice_id: T.nilable(String), + price_id: T.nilable(String), + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + event_id: nil, + invoice_id: nil, + price_id: nil, + entry_type: :decrement + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class ExpirationChangeLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + new_block_expiry_date: T.nilable(Time), + starting_balance: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Time)) } + attr_accessor :new_block_expiry_date + + sig { returns(Float) } + attr_accessor :starting_balance + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + new_block_expiry_date: T.nilable(Time), + starting_balance: Float, + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + new_block_expiry_date:, + starting_balance:, + entry_type: :expiration_change + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class CreditBlockExpiryLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + entry_type: :credit_block_expiry + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class VoidLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + void_amount: Float, + void_reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig { returns(Float) } + attr_accessor :void_amount + + sig { returns(T.nilable(String)) } + attr_accessor :void_reason + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + void_amount: Float, + void_reason: T.nilable(String), + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + void_amount:, + void_reason:, + entry_type: :void + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class VoidInitiatedLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + new_block_expiry_date: Time, + starting_balance: Float, + void_amount: Float, + void_reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Time) } + attr_accessor :new_block_expiry_date + + sig { returns(Float) } + attr_accessor :starting_balance + + sig { returns(Float) } + attr_accessor :void_amount + + sig { returns(T.nilable(String)) } + attr_accessor :void_reason + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + new_block_expiry_date: Time, + starting_balance: Float, + void_amount: Float, + void_reason: T.nilable(String), + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + new_block_expiry_date:, + starting_balance:, + void_amount:, + void_reason:, + entry_type: :void_initiated + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class AmendmentLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + entry_type: :amendment + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry + ], + [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry], + [ + Symbol, + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry + ], + [ + Symbol, + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry + ], + [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry], + [ + Symbol, + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry + ], + [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry] + ] + ) + end + private_class_method def self.variants; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rbi b/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rbi new file mode 100644 index 00000000..d6e12472 --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rbi @@ -0,0 +1,122 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class LedgerListByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + currency: T.nilable(String), + cursor: T.nilable(String), + entry_status: T.nilable(Symbol), + entry_type: T.nilable(Symbol), + limit: Integer, + minimum_amount: T.nilable(String) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_gt + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_gte + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_lt + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_lte + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Symbol)) } + attr_accessor :entry_status + + sig { returns(T.nilable(Symbol)) } + attr_accessor :entry_type + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig do + params( + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + currency: T.nilable(String), + cursor: T.nilable(String), + entry_status: T.nilable(Symbol), + entry_type: T.nilable(Symbol), + limit: Integer, + minimum_amount: T.nilable(String), + request_options: Orb::RequestOpts + ).void + end + def initialize( + created_at_gt: nil, + created_at_gte: nil, + created_at_lt: nil, + created_at_lte: nil, + currency: nil, + cursor: nil, + entry_status: nil, + entry_type: nil, + limit: nil, + minimum_amount: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::Customers::Credits::LedgerListByExternalIDParams::Shape) } + def to_h; end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = T.let(:committed, T.nilable(Symbol)) + PENDING = T.let(:pending, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class EntryType < Orb::Enum + abstract! + + INCREMENT = T.let(:increment, T.nilable(Symbol)) + DECREMENT = T.let(:decrement, T.nilable(Symbol)) + EXPIRATION_CHANGE = T.let(:expiration_change, T.nilable(Symbol)) + CREDIT_BLOCK_EXPIRY = T.let(:credit_block_expiry, T.nilable(Symbol)) + VOID = T.let(:void, T.nilable(Symbol)) + VOID_INITIATED = T.let(:void_initiated, T.nilable(Symbol)) + AMENDMENT = T.let(:amendment, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rbi b/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rbi new file mode 100644 index 00000000..ebed147f --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rbi @@ -0,0 +1,1190 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class LedgerListByExternalIDResponse < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry, + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry, + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry, + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry, + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry, + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry, + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry + ) + end + + class IncrementLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + entry_type: :increment + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class DecrementLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + event_id: T.nilable(String), + invoice_id: T.nilable(String), + price_id: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig { returns(T.nilable(String)) } + attr_accessor :event_id + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_id + + sig { returns(T.nilable(String)) } + attr_accessor :price_id + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + event_id: T.nilable(String), + invoice_id: T.nilable(String), + price_id: T.nilable(String), + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + event_id: nil, + invoice_id: nil, + price_id: nil, + entry_type: :decrement + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class ExpirationChangeLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + new_block_expiry_date: T.nilable(Time), + starting_balance: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Time)) } + attr_accessor :new_block_expiry_date + + sig { returns(Float) } + attr_accessor :starting_balance + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + new_block_expiry_date: T.nilable(Time), + starting_balance: Float, + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + new_block_expiry_date:, + starting_balance:, + entry_type: :expiration_change + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class CreditBlockExpiryLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + entry_type: :credit_block_expiry + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class VoidLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + void_amount: Float, + void_reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig { returns(Float) } + attr_accessor :void_amount + + sig { returns(T.nilable(String)) } + attr_accessor :void_reason + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + void_amount: Float, + void_reason: T.nilable(String), + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + void_amount:, + void_reason:, + entry_type: :void + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class VoidInitiatedLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + new_block_expiry_date: Time, + starting_balance: Float, + void_amount: Float, + void_reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Time) } + attr_accessor :new_block_expiry_date + + sig { returns(Float) } + attr_accessor :starting_balance + + sig { returns(Float) } + attr_accessor :void_amount + + sig { returns(T.nilable(String)) } + attr_accessor :void_reason + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + new_block_expiry_date: Time, + starting_balance: Float, + void_amount: Float, + void_reason: T.nilable(String), + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + new_block_expiry_date:, + starting_balance:, + void_amount:, + void_reason:, + entry_type: :void_initiated + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class AmendmentLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + entry_type: :amendment + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry + ], + [ + Symbol, + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry + ], + [ + Symbol, + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry + ], + [ + Symbol, + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry + ], + [Symbol, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry], + [ + Symbol, + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry + ], + [ + Symbol, + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry + ] + ] + ) + end + private_class_method def self.variants; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/ledger_list_params.rbi b/rbi/lib/orb/models/customers/credits/ledger_list_params.rbi new file mode 100644 index 00000000..e66475ff --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/ledger_list_params.rbi @@ -0,0 +1,122 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class LedgerListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + currency: T.nilable(String), + cursor: T.nilable(String), + entry_status: T.nilable(Symbol), + entry_type: T.nilable(Symbol), + limit: Integer, + minimum_amount: T.nilable(String) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_gt + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_gte + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_lt + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_lte + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Symbol)) } + attr_accessor :entry_status + + sig { returns(T.nilable(Symbol)) } + attr_accessor :entry_type + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig do + params( + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + currency: T.nilable(String), + cursor: T.nilable(String), + entry_status: T.nilable(Symbol), + entry_type: T.nilable(Symbol), + limit: Integer, + minimum_amount: T.nilable(String), + request_options: Orb::RequestOpts + ).void + end + def initialize( + created_at_gt: nil, + created_at_gte: nil, + created_at_lt: nil, + created_at_lte: nil, + currency: nil, + cursor: nil, + entry_status: nil, + entry_type: nil, + limit: nil, + minimum_amount: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::Customers::Credits::LedgerListParams::Shape) } + def to_h; end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = T.let(:committed, T.nilable(Symbol)) + PENDING = T.let(:pending, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class EntryType < Orb::Enum + abstract! + + INCREMENT = T.let(:increment, T.nilable(Symbol)) + DECREMENT = T.let(:decrement, T.nilable(Symbol)) + EXPIRATION_CHANGE = T.let(:expiration_change, T.nilable(Symbol)) + CREDIT_BLOCK_EXPIRY = T.let(:credit_block_expiry, T.nilable(Symbol)) + VOID = T.let(:void, T.nilable(Symbol)) + VOID_INITIATED = T.let(:void_initiated, T.nilable(Symbol)) + AMENDMENT = T.let(:amendment, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/ledger_list_response.rbi b/rbi/lib/orb/models/customers/credits/ledger_list_response.rbi new file mode 100644 index 00000000..c29a20a9 --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/ledger_list_response.rbi @@ -0,0 +1,1160 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class LedgerListResponse < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry, + Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry, + Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry, + Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry, + Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry, + Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry, + Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry + ) + end + + class IncrementLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + entry_type: :increment + ); end + + sig { returns(Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::Shape) } + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class DecrementLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + event_id: T.nilable(String), + invoice_id: T.nilable(String), + price_id: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig { returns(T.nilable(String)) } + attr_accessor :event_id + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_id + + sig { returns(T.nilable(String)) } + attr_accessor :price_id + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + event_id: T.nilable(String), + invoice_id: T.nilable(String), + price_id: T.nilable(String), + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + event_id: nil, + invoice_id: nil, + price_id: nil, + entry_type: :decrement + ); end + + sig { returns(Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::Shape) } + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class ExpirationChangeLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + new_block_expiry_date: T.nilable(Time), + starting_balance: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Time)) } + attr_accessor :new_block_expiry_date + + sig { returns(Float) } + attr_accessor :starting_balance + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + new_block_expiry_date: T.nilable(Time), + starting_balance: Float, + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + new_block_expiry_date:, + starting_balance:, + entry_type: :expiration_change + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class CreditBlockExpiryLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + entry_type: :credit_block_expiry + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class VoidLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + void_amount: Float, + void_reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::CreditBlock) } + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig { returns(Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::Customer) } + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig { returns(Float) } + attr_accessor :void_amount + + sig { returns(T.nilable(String)) } + attr_accessor :void_reason + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + void_amount: Float, + void_reason: T.nilable(String), + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + void_amount:, + void_reason:, + entry_type: :void + ); end + + sig { returns(Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::Shape) } + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class VoidInitiatedLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + new_block_expiry_date: Time, + starting_balance: Float, + void_amount: Float, + void_reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Time) } + attr_accessor :new_block_expiry_date + + sig { returns(Float) } + attr_accessor :starting_balance + + sig { returns(Float) } + attr_accessor :void_amount + + sig { returns(T.nilable(String)) } + attr_accessor :void_reason + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + new_block_expiry_date: Time, + starting_balance: Float, + void_amount: Float, + void_reason: T.nilable(String), + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + new_block_expiry_date:, + starting_balance:, + void_amount:, + void_reason:, + entry_type: :void_initiated + ); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::Shape) + end + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class AmendmentLedgerEntry < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + entry_type: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::CreditBlock) + end + attr_accessor :credit_block + + sig { returns(String) } + attr_accessor :currency + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::Customer) + end + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(Float) } + attr_accessor :ending_balance + + sig { returns(Symbol) } + attr_accessor :entry_status + + sig { returns(Symbol) } + attr_accessor :entry_type + + sig { returns(Integer) } + attr_accessor :ledger_sequence_number + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(Float) } + attr_accessor :starting_balance + + sig do + params( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::Customer, + description: T.nilable(String), + ending_balance: Float, + entry_status: Symbol, + ledger_sequence_number: Integer, + metadata: T::Hash[Symbol, String], + starting_balance: Float, + entry_type: Symbol + ).void + end + def initialize( + id:, + amount:, + created_at:, + credit_block:, + currency:, + customer:, + description:, + ending_balance:, + entry_status:, + ledger_sequence_number:, + metadata:, + starting_balance:, + entry_type: :amendment + ); end + + sig { returns(Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::Shape) } + def to_h; end + + class CreditBlock < Orb::BaseModel + Shape = T.type_alias do + {id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :expiry_date + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_cost_basis + + sig do + params(id: String, expiry_date: T.nilable(Time), per_unit_cost_basis: T.nilable(String)).void + end + def initialize(id:, expiry_date:, per_unit_cost_basis:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::CreditBlock::Shape) + end + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig do + returns(Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::Customer::Shape) + end + def to_h; end + end + + class EntryStatus < Orb::Enum + abstract! + + COMMITTED = :committed + PENDING = :pending + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + sig do + override.returns( + [ + [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry], + [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry], + [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry], + [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry], + [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry], + [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry], + [Symbol, Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry] + ] + ) + end + private_class_method def self.variants; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rbi b/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rbi new file mode 100644 index 00000000..ea15bc7c --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rbi @@ -0,0 +1,127 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class TopUpCreateByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: T.nilable(Integer), + expires_after_unit: T.nilable(Symbol) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :currency + + sig { returns(Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::InvoiceSettings) } + attr_accessor :invoice_settings + + sig { returns(String) } + attr_accessor :per_unit_cost_basis + + sig { returns(String) } + attr_accessor :threshold + + sig { returns(T.nilable(Integer)) } + attr_accessor :expires_after + + sig { returns(T.nilable(Symbol)) } + attr_accessor :expires_after_unit + + sig do + params( + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: T.nilable(Integer), + expires_after_unit: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).void + end + def initialize( + amount:, + currency:, + invoice_settings:, + per_unit_cost_basis:, + threshold:, + expires_after: nil, + expires_after_unit: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::Shape) } + def to_h; end + + class InvoiceSettings < Orb::BaseModel + Shape = T.type_alias do + { + auto_collection: T::Boolean, + net_terms: Integer, + memo: T.nilable(String), + require_successful_payment: T::Boolean + } + end + + sig { returns(T::Boolean) } + attr_accessor :auto_collection + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :require_successful_payment + + sig { params(require_successful_payment: T::Boolean).void } + attr_writer :require_successful_payment + + sig do + params( + auto_collection: T::Boolean, + net_terms: Integer, + memo: T.nilable(String), + require_successful_payment: T::Boolean + ).void + end + def initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil); end + + sig do + returns(Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::InvoiceSettings::Shape) + end + def to_h; end + end + + class ExpiresAfterUnit < Orb::Enum + abstract! + + DAY = T.let(:day, T.nilable(Symbol)) + MONTH = T.let(:month, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rbi b/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rbi new file mode 100644 index 00000000..2523e1cd --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/top_up_create_by_external_id_response.rbi @@ -0,0 +1,125 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class TopUpCreateByExternalIDResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: T.nilable(Integer), + expires_after_unit: T.nilable(Symbol) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :currency + + sig { returns(Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::InvoiceSettings) } + attr_accessor :invoice_settings + + sig { returns(String) } + attr_accessor :per_unit_cost_basis + + sig { returns(String) } + attr_accessor :threshold + + sig { returns(T.nilable(Integer)) } + attr_accessor :expires_after + + sig { returns(T.nilable(Symbol)) } + attr_accessor :expires_after_unit + + sig do + params( + id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: T.nilable(Integer), + expires_after_unit: T.nilable(Symbol) + ).void + end + def initialize( + id:, + amount:, + currency:, + invoice_settings:, + per_unit_cost_basis:, + threshold:, + expires_after: nil, + expires_after_unit: nil + ); end + + sig { returns(Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::Shape) } + def to_h; end + + class InvoiceSettings < Orb::BaseModel + Shape = T.type_alias do + { + auto_collection: T::Boolean, + net_terms: Integer, + memo: T.nilable(String), + require_successful_payment: T::Boolean + } + end + + sig { returns(T::Boolean) } + attr_accessor :auto_collection + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :require_successful_payment + + sig { params(require_successful_payment: T::Boolean).void } + attr_writer :require_successful_payment + + sig do + params( + auto_collection: T::Boolean, + net_terms: Integer, + memo: T.nilable(String), + require_successful_payment: T::Boolean + ).void + end + def initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil); end + + sig do + returns(Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::InvoiceSettings::Shape) + end + def to_h; end + end + + class ExpiresAfterUnit < Orb::Enum + abstract! + + DAY = T.let(:day, T.nilable(Symbol)) + MONTH = T.let(:month, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/top_up_create_params.rbi b/rbi/lib/orb/models/customers/credits/top_up_create_params.rbi new file mode 100644 index 00000000..62b26fcc --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/top_up_create_params.rbi @@ -0,0 +1,125 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class TopUpCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateParams::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: T.nilable(Integer), + expires_after_unit: T.nilable(Symbol) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :currency + + sig { returns(Orb::Models::Customers::Credits::TopUpCreateParams::InvoiceSettings) } + attr_accessor :invoice_settings + + sig { returns(String) } + attr_accessor :per_unit_cost_basis + + sig { returns(String) } + attr_accessor :threshold + + sig { returns(T.nilable(Integer)) } + attr_accessor :expires_after + + sig { returns(T.nilable(Symbol)) } + attr_accessor :expires_after_unit + + sig do + params( + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateParams::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: T.nilable(Integer), + expires_after_unit: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).void + end + def initialize( + amount:, + currency:, + invoice_settings:, + per_unit_cost_basis:, + threshold:, + expires_after: nil, + expires_after_unit: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::Customers::Credits::TopUpCreateParams::Shape) } + def to_h; end + + class InvoiceSettings < Orb::BaseModel + Shape = T.type_alias do + { + auto_collection: T::Boolean, + net_terms: Integer, + memo: T.nilable(String), + require_successful_payment: T::Boolean + } + end + + sig { returns(T::Boolean) } + attr_accessor :auto_collection + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :require_successful_payment + + sig { params(require_successful_payment: T::Boolean).void } + attr_writer :require_successful_payment + + sig do + params( + auto_collection: T::Boolean, + net_terms: Integer, + memo: T.nilable(String), + require_successful_payment: T::Boolean + ).void + end + def initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil); end + + sig { returns(Orb::Models::Customers::Credits::TopUpCreateParams::InvoiceSettings::Shape) } + def to_h; end + end + + class ExpiresAfterUnit < Orb::Enum + abstract! + + DAY = T.let(:day, T.nilable(Symbol)) + MONTH = T.let(:month, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/top_up_create_response.rbi b/rbi/lib/orb/models/customers/credits/top_up_create_response.rbi new file mode 100644 index 00000000..db1bb5ba --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/top_up_create_response.rbi @@ -0,0 +1,123 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class TopUpCreateResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateResponse::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: T.nilable(Integer), + expires_after_unit: T.nilable(Symbol) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :currency + + sig { returns(Orb::Models::Customers::Credits::TopUpCreateResponse::InvoiceSettings) } + attr_accessor :invoice_settings + + sig { returns(String) } + attr_accessor :per_unit_cost_basis + + sig { returns(String) } + attr_accessor :threshold + + sig { returns(T.nilable(Integer)) } + attr_accessor :expires_after + + sig { returns(T.nilable(Symbol)) } + attr_accessor :expires_after_unit + + sig do + params( + id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateResponse::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: T.nilable(Integer), + expires_after_unit: T.nilable(Symbol) + ).void + end + def initialize( + id:, + amount:, + currency:, + invoice_settings:, + per_unit_cost_basis:, + threshold:, + expires_after: nil, + expires_after_unit: nil + ); end + + sig { returns(Orb::Models::Customers::Credits::TopUpCreateResponse::Shape) } + def to_h; end + + class InvoiceSettings < Orb::BaseModel + Shape = T.type_alias do + { + auto_collection: T::Boolean, + net_terms: Integer, + memo: T.nilable(String), + require_successful_payment: T::Boolean + } + end + + sig { returns(T::Boolean) } + attr_accessor :auto_collection + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :require_successful_payment + + sig { params(require_successful_payment: T::Boolean).void } + attr_writer :require_successful_payment + + sig do + params( + auto_collection: T::Boolean, + net_terms: Integer, + memo: T.nilable(String), + require_successful_payment: T::Boolean + ).void + end + def initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil); end + + sig { returns(Orb::Models::Customers::Credits::TopUpCreateResponse::InvoiceSettings::Shape) } + def to_h; end + end + + class ExpiresAfterUnit < Orb::Enum + abstract! + + DAY = T.let(:day, T.nilable(Symbol)) + MONTH = T.let(:month, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rbi b/rbi/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rbi new file mode 100644 index 00000000..77110c2d --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class TopUpDeleteByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({external_customer_id: String}, Orb::RequestParameters::Shape) } + + sig { returns(String) } + attr_accessor :external_customer_id + + sig { params(external_customer_id: String, request_options: Orb::RequestOpts).void } + def initialize(external_customer_id:, request_options: {}); end + + sig { returns(Orb::Models::Customers::Credits::TopUpDeleteByExternalIDParams::Shape) } + def to_h; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/top_up_delete_params.rbi b/rbi/lib/orb/models/customers/credits/top_up_delete_params.rbi new file mode 100644 index 00000000..12425bef --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/top_up_delete_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class TopUpDeleteParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({customer_id: String}, Orb::RequestParameters::Shape) } + + sig { returns(String) } + attr_accessor :customer_id + + sig { params(customer_id: String, request_options: Orb::RequestOpts).void } + def initialize(customer_id:, request_options: {}); end + + sig { returns(Orb::Models::Customers::Credits::TopUpDeleteParams::Shape) } + def to_h; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rbi b/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rbi new file mode 100644 index 00000000..da14300a --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class TopUpListByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all({cursor: T.nilable(String), limit: Integer}, Orb::RequestParameters::Shape) + end + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { params(cursor: T.nilable(String), limit: Integer, request_options: Orb::RequestOpts).void } + def initialize(cursor: nil, limit: nil, request_options: {}); end + + sig { returns(Orb::Models::Customers::Credits::TopUpListByExternalIDParams::Shape) } + def to_h; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rbi b/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rbi new file mode 100644 index 00000000..752663ef --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/top_up_list_by_external_id_response.rbi @@ -0,0 +1,125 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class TopUpListByExternalIDResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: T.nilable(Integer), + expires_after_unit: T.nilable(Symbol) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :currency + + sig { returns(Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::InvoiceSettings) } + attr_accessor :invoice_settings + + sig { returns(String) } + attr_accessor :per_unit_cost_basis + + sig { returns(String) } + attr_accessor :threshold + + sig { returns(T.nilable(Integer)) } + attr_accessor :expires_after + + sig { returns(T.nilable(Symbol)) } + attr_accessor :expires_after_unit + + sig do + params( + id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: T.nilable(Integer), + expires_after_unit: T.nilable(Symbol) + ).void + end + def initialize( + id:, + amount:, + currency:, + invoice_settings:, + per_unit_cost_basis:, + threshold:, + expires_after: nil, + expires_after_unit: nil + ); end + + sig { returns(Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::Shape) } + def to_h; end + + class InvoiceSettings < Orb::BaseModel + Shape = T.type_alias do + { + auto_collection: T::Boolean, + net_terms: Integer, + memo: T.nilable(String), + require_successful_payment: T::Boolean + } + end + + sig { returns(T::Boolean) } + attr_accessor :auto_collection + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :require_successful_payment + + sig { params(require_successful_payment: T::Boolean).void } + attr_writer :require_successful_payment + + sig do + params( + auto_collection: T::Boolean, + net_terms: Integer, + memo: T.nilable(String), + require_successful_payment: T::Boolean + ).void + end + def initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil); end + + sig do + returns(Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::InvoiceSettings::Shape) + end + def to_h; end + end + + class ExpiresAfterUnit < Orb::Enum + abstract! + + DAY = T.let(:day, T.nilable(Symbol)) + MONTH = T.let(:month, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/top_up_list_params.rbi b/rbi/lib/orb/models/customers/credits/top_up_list_params.rbi new file mode 100644 index 00000000..e1d76339 --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/top_up_list_params.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class TopUpListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all({cursor: T.nilable(String), limit: Integer}, Orb::RequestParameters::Shape) + end + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { params(cursor: T.nilable(String), limit: Integer, request_options: Orb::RequestOpts).void } + def initialize(cursor: nil, limit: nil, request_options: {}); end + + sig { returns(Orb::Models::Customers::Credits::TopUpListParams::Shape) } + def to_h; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/customers/credits/top_up_list_response.rbi b/rbi/lib/orb/models/customers/credits/top_up_list_response.rbi new file mode 100644 index 00000000..cf360c7a --- /dev/null +++ b/rbi/lib/orb/models/customers/credits/top_up_list_response.rbi @@ -0,0 +1,123 @@ +# typed: strong + +module Orb + module Models + module Customers + module Credits + class TopUpListResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpListResponse::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: T.nilable(Integer), + expires_after_unit: T.nilable(Symbol) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :currency + + sig { returns(Orb::Models::Customers::Credits::TopUpListResponse::InvoiceSettings) } + attr_accessor :invoice_settings + + sig { returns(String) } + attr_accessor :per_unit_cost_basis + + sig { returns(String) } + attr_accessor :threshold + + sig { returns(T.nilable(Integer)) } + attr_accessor :expires_after + + sig { returns(T.nilable(Symbol)) } + attr_accessor :expires_after_unit + + sig do + params( + id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpListResponse::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: T.nilable(Integer), + expires_after_unit: T.nilable(Symbol) + ).void + end + def initialize( + id:, + amount:, + currency:, + invoice_settings:, + per_unit_cost_basis:, + threshold:, + expires_after: nil, + expires_after_unit: nil + ); end + + sig { returns(Orb::Models::Customers::Credits::TopUpListResponse::Shape) } + def to_h; end + + class InvoiceSettings < Orb::BaseModel + Shape = T.type_alias do + { + auto_collection: T::Boolean, + net_terms: Integer, + memo: T.nilable(String), + require_successful_payment: T::Boolean + } + end + + sig { returns(T::Boolean) } + attr_accessor :auto_collection + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :require_successful_payment + + sig { params(require_successful_payment: T::Boolean).void } + attr_writer :require_successful_payment + + sig do + params( + auto_collection: T::Boolean, + net_terms: Integer, + memo: T.nilable(String), + require_successful_payment: T::Boolean + ).void + end + def initialize(auto_collection:, net_terms:, memo: nil, require_successful_payment: nil); end + + sig { returns(Orb::Models::Customers::Credits::TopUpListResponse::InvoiceSettings::Shape) } + def to_h; end + end + + class ExpiresAfterUnit < Orb::Enum + abstract! + + DAY = T.let(:day, T.nilable(Symbol)) + MONTH = T.let(:month, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end + end +end diff --git a/rbi/lib/orb/models/dimensional_price_group.rbi b/rbi/lib/orb/models/dimensional_price_group.rbi new file mode 100644 index 00000000..5505d0a5 --- /dev/null +++ b/rbi/lib/orb/models/dimensional_price_group.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Orb + module Models + class DimensionalPriceGroup < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric_id: String, + dimensions: T::Array[String], + external_dimensional_price_group_id: T.nilable(String), + metadata: T::Hash[Symbol, String], + name: String + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :billable_metric_id + + sig { returns(T::Array[String]) } + attr_accessor :dimensions + + sig { returns(T.nilable(String)) } + attr_accessor :external_dimensional_price_group_id + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(String) } + attr_accessor :name + + sig do + params( + id: String, + billable_metric_id: String, + dimensions: T::Array[String], + external_dimensional_price_group_id: T.nilable(String), + metadata: T::Hash[Symbol, String], + name: String + ).void + end + def initialize( + id:, + billable_metric_id:, + dimensions:, + external_dimensional_price_group_id:, + metadata:, + name: + ) + end + + sig { returns(Orb::Models::DimensionalPriceGroup::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/dimensional_price_group_create_params.rbi b/rbi/lib/orb/models/dimensional_price_group_create_params.rbi new file mode 100644 index 00000000..e4f097bc --- /dev/null +++ b/rbi/lib/orb/models/dimensional_price_group_create_params.rbi @@ -0,0 +1,60 @@ +# typed: strong + +module Orb + module Models + class DimensionalPriceGroupCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + billable_metric_id: String, + dimensions: T::Array[String], + name: String, + external_dimensional_price_group_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(String) } + attr_accessor :billable_metric_id + + sig { returns(T::Array[String]) } + attr_accessor :dimensions + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :external_dimensional_price_group_id + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + billable_metric_id: String, + dimensions: T::Array[String], + name: String, + external_dimensional_price_group_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).void + end + def initialize( + billable_metric_id:, + dimensions:, + name:, + external_dimensional_price_group_id: nil, + metadata: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::DimensionalPriceGroupCreateParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/dimensional_price_group_list_params.rbi b/rbi/lib/orb/models/dimensional_price_group_list_params.rbi new file mode 100644 index 00000000..159b6fa1 --- /dev/null +++ b/rbi/lib/orb/models/dimensional_price_group_list_params.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Orb + module Models + class DimensionalPriceGroupListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all({cursor: T.nilable(String), limit: Integer}, Orb::RequestParameters::Shape) + end + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { params(cursor: T.nilable(String), limit: Integer, request_options: Orb::RequestOpts).void } + def initialize(cursor: nil, limit: nil, request_options: {}); end + + sig { returns(Orb::Models::DimensionalPriceGroupListParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/dimensional_price_group_retrieve_params.rbi b/rbi/lib/orb/models/dimensional_price_group_retrieve_params.rbi new file mode 100644 index 00000000..a5016162 --- /dev/null +++ b/rbi/lib/orb/models/dimensional_price_group_retrieve_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class DimensionalPriceGroupRetrieveParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::DimensionalPriceGroupRetrieveParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/dimensional_price_groups.rbi b/rbi/lib/orb/models/dimensional_price_groups.rbi new file mode 100644 index 00000000..f49a400f --- /dev/null +++ b/rbi/lib/orb/models/dimensional_price_groups.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Orb + module Models + class DimensionalPriceGroupsAPI < Orb::BaseModel + Shape = T.type_alias do + { + data: T::Array[Orb::Models::DimensionalPriceGroup], + pagination_metadata: Orb::Models::PaginationMetadata + } + end + + sig { returns(T::Array[Orb::Models::DimensionalPriceGroup]) } + attr_accessor :data + + sig { returns(Orb::Models::PaginationMetadata) } + attr_accessor :pagination_metadata + + sig do + params( + data: T::Array[Orb::Models::DimensionalPriceGroup], + pagination_metadata: Orb::Models::PaginationMetadata + ).void + end + def initialize(data:, pagination_metadata:); end + + sig { returns(Orb::Models::DimensionalPriceGroupsAPI::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbi b/rbi/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbi new file mode 100644 index 00000000..ff1473bb --- /dev/null +++ b/rbi/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Orb + module Models + module DimensionalPriceGroups + class ExternalDimensionalPriceGroupIDRetrieveParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig do + returns(Orb::Models::DimensionalPriceGroups::ExternalDimensionalPriceGroupIDRetrieveParams::Shape) + end + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/discount.rbi b/rbi/lib/orb/models/discount.rbi new file mode 100644 index 00000000..bf577e59 --- /dev/null +++ b/rbi/lib/orb/models/discount.rbi @@ -0,0 +1,66 @@ +# typed: strong + +module Orb + module Models + class Discount < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::PercentageDiscount, + Orb::Models::TrialDiscount, + Orb::Models::Discount::UsageDiscount, + Orb::Models::AmountDiscount + ) + end + + class UsageDiscount < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + discount_type: Symbol, + usage_discount: Float, + reason: T.nilable(String) + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(Float) } + attr_accessor :usage_discount + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + applies_to_price_ids: T::Array[String], + usage_discount: Float, + reason: T.nilable(String), + discount_type: Symbol + ).void + end + def initialize(applies_to_price_ids:, usage_discount:, reason: nil, discount_type: :usage); end + + sig { returns(Orb::Models::Discount::UsageDiscount::Shape) } + def to_h; end + end + + sig do + override.returns( + [ + [Symbol, Orb::Models::PercentageDiscount], + [Symbol, Orb::Models::TrialDiscount], + [Symbol, Orb::Models::Discount::UsageDiscount], + [Symbol, Orb::Models::AmountDiscount] + ] + ) + end + private_class_method def self.variants; end + end + end +end diff --git a/rbi/lib/orb/models/evaluate_price_group.rbi b/rbi/lib/orb/models/evaluate_price_group.rbi new file mode 100644 index 00000000..1f02f0e0 --- /dev/null +++ b/rbi/lib/orb/models/evaluate_price_group.rbi @@ -0,0 +1,45 @@ +# typed: strong + +module Orb + module Models + class EvaluatePriceGroup < Orb::BaseModel + Shape = T.type_alias do + { + amount: String, + grouping_values: T::Array[Orb::Models::EvaluatePriceGroup::GroupingValue::Variants], + quantity: Float + } + end + + sig { returns(String) } + attr_accessor :amount + + sig { returns(T::Array[Orb::Models::EvaluatePriceGroup::GroupingValue::Variants]) } + attr_accessor :grouping_values + + sig { returns(Float) } + attr_accessor :quantity + + sig do + params( + amount: String, + grouping_values: T::Array[Orb::Models::EvaluatePriceGroup::GroupingValue::Variants], + quantity: Float + ).void + end + def initialize(amount:, grouping_values:, quantity:); end + + sig { returns(Orb::Models::EvaluatePriceGroup::Shape) } + def to_h; end + + class GroupingValue < Orb::Union + abstract! + + Variants = T.type_alias { T.any(String, Float, T::Boolean) } + + sig { override.returns([[NilClass, String], [NilClass, Float], [NilClass, T::Boolean]]) } + private_class_method def self.variants; end + end + end + end +end diff --git a/rbi/lib/orb/models/event_deprecate_params.rbi b/rbi/lib/orb/models/event_deprecate_params.rbi new file mode 100644 index 00000000..c6b5c1ce --- /dev/null +++ b/rbi/lib/orb/models/event_deprecate_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class EventDeprecateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::EventDeprecateParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/event_deprecate_response.rbi b/rbi/lib/orb/models/event_deprecate_response.rbi new file mode 100644 index 00000000..b9c0d1f6 --- /dev/null +++ b/rbi/lib/orb/models/event_deprecate_response.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class EventDeprecateResponse < Orb::BaseModel + Shape = T.type_alias { {deprecated: String} } + + sig { returns(String) } + attr_accessor :deprecated + + sig { params(deprecated: String).void } + def initialize(deprecated:); end + + sig { returns(Orb::Models::EventDeprecateResponse::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/event_ingest_params.rbi b/rbi/lib/orb/models/event_ingest_params.rbi new file mode 100644 index 00000000..e0a8ad93 --- /dev/null +++ b/rbi/lib/orb/models/event_ingest_params.rbi @@ -0,0 +1,100 @@ +# typed: strong + +module Orb + module Models + class EventIngestParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + events: T::Array[Orb::Models::EventIngestParams::Event], + backfill_id: T.nilable(String), + debug: T::Boolean + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T::Array[Orb::Models::EventIngestParams::Event]) } + attr_accessor :events + + sig { returns(T.nilable(String)) } + attr_accessor :backfill_id + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :debug + + sig { params(debug: T::Boolean).void } + attr_writer :debug + + sig do + params( + events: T::Array[Orb::Models::EventIngestParams::Event], + backfill_id: T.nilable(String), + debug: T::Boolean, + request_options: Orb::RequestOpts + ).void + end + def initialize(events:, backfill_id: nil, debug: nil, request_options: {}); end + + sig { returns(Orb::Models::EventIngestParams::Shape) } + def to_h; end + + class Event < Orb::BaseModel + Shape = T.type_alias do + { + event_name: String, + idempotency_key: String, + properties: T.anything, + timestamp: Time, + customer_id: T.nilable(String), + external_customer_id: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :event_name + + sig { returns(String) } + attr_accessor :idempotency_key + + sig { returns(T.anything) } + attr_accessor :properties + + sig { returns(Time) } + attr_accessor :timestamp + + sig { returns(T.nilable(String)) } + attr_accessor :customer_id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig do + params( + event_name: String, + idempotency_key: String, + properties: T.anything, + timestamp: Time, + customer_id: T.nilable(String), + external_customer_id: T.nilable(String) + ).void + end + def initialize( + event_name:, + idempotency_key:, + properties:, + timestamp:, + customer_id: nil, + external_customer_id: nil + ) + end + + sig { returns(Orb::Models::EventIngestParams::Event::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/event_ingest_response.rbi b/rbi/lib/orb/models/event_ingest_response.rbi new file mode 100644 index 00000000..485d98a1 --- /dev/null +++ b/rbi/lib/orb/models/event_ingest_response.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module Orb + module Models + class EventIngestResponse < Orb::BaseModel + Shape = T.type_alias do + { + validation_failed: T::Array[Orb::Models::EventIngestResponse::ValidationFailed], + debug: T.nilable(Orb::Models::EventIngestResponse::Debug) + } + end + + sig { returns(T::Array[Orb::Models::EventIngestResponse::ValidationFailed]) } + attr_accessor :validation_failed + + sig { returns(T.nilable(Orb::Models::EventIngestResponse::Debug)) } + attr_accessor :debug + + sig do + params( + validation_failed: T::Array[Orb::Models::EventIngestResponse::ValidationFailed], + debug: T.nilable(Orb::Models::EventIngestResponse::Debug) + ).void + end + def initialize(validation_failed:, debug: nil); end + + sig { returns(Orb::Models::EventIngestResponse::Shape) } + def to_h; end + + class ValidationFailed < Orb::BaseModel + Shape = T.type_alias { {idempotency_key: String, validation_errors: T::Array[String]} } + + sig { returns(String) } + attr_accessor :idempotency_key + + sig { returns(T::Array[String]) } + attr_accessor :validation_errors + + sig { params(idempotency_key: String, validation_errors: T::Array[String]).void } + def initialize(idempotency_key:, validation_errors:); end + + sig { returns(Orb::Models::EventIngestResponse::ValidationFailed::Shape) } + def to_h; end + end + + class Debug < Orb::BaseModel + Shape = T.type_alias { {duplicate: T::Array[String], ingested: T::Array[String]} } + + sig { returns(T::Array[String]) } + attr_accessor :duplicate + + sig { returns(T::Array[String]) } + attr_accessor :ingested + + sig { params(duplicate: T::Array[String], ingested: T::Array[String]).void } + def initialize(duplicate:, ingested:); end + + sig { returns(Orb::Models::EventIngestResponse::Debug::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/event_search_params.rbi b/rbi/lib/orb/models/event_search_params.rbi new file mode 100644 index 00000000..a3aea916 --- /dev/null +++ b/rbi/lib/orb/models/event_search_params.rbi @@ -0,0 +1,39 @@ +# typed: strong + +module Orb + module Models + class EventSearchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + {event_ids: T::Array[String], timeframe_end: T.nilable(Time), timeframe_start: T.nilable(Time)}, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T::Array[String]) } + attr_accessor :event_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :timeframe_end + + sig { returns(T.nilable(Time)) } + attr_accessor :timeframe_start + + sig do + params( + event_ids: T::Array[String], + timeframe_end: T.nilable(Time), + timeframe_start: T.nilable(Time), + request_options: Orb::RequestOpts + ).void + end + def initialize(event_ids:, timeframe_end: nil, timeframe_start: nil, request_options: {}); end + + sig { returns(Orb::Models::EventSearchParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/event_search_response.rbi b/rbi/lib/orb/models/event_search_response.rbi new file mode 100644 index 00000000..706d5d63 --- /dev/null +++ b/rbi/lib/orb/models/event_search_response.rbi @@ -0,0 +1,78 @@ +# typed: strong + +module Orb + module Models + class EventSearchResponse < Orb::BaseModel + Shape = T.type_alias { {data: T::Array[Orb::Models::EventSearchResponse::Data]} } + + sig { returns(T::Array[Orb::Models::EventSearchResponse::Data]) } + attr_accessor :data + + sig { params(data: T::Array[Orb::Models::EventSearchResponse::Data]).void } + def initialize(data:); end + + sig { returns(Orb::Models::EventSearchResponse::Shape) } + def to_h; end + + class Data < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + customer_id: T.nilable(String), + deprecated: T::Boolean, + event_name: String, + external_customer_id: T.nilable(String), + properties: T.anything, + timestamp: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :customer_id + + sig { returns(T::Boolean) } + attr_accessor :deprecated + + sig { returns(String) } + attr_accessor :event_name + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { returns(T.anything) } + attr_accessor :properties + + sig { returns(Time) } + attr_accessor :timestamp + + sig do + params( + id: String, + customer_id: T.nilable(String), + deprecated: T::Boolean, + event_name: String, + external_customer_id: T.nilable(String), + properties: T.anything, + timestamp: Time + ).void + end + def initialize( + id:, + customer_id:, + deprecated:, + event_name:, + external_customer_id:, + properties:, + timestamp: + ) + end + + sig { returns(Orb::Models::EventSearchResponse::Data::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/event_update_params.rbi b/rbi/lib/orb/models/event_update_params.rbi new file mode 100644 index 00000000..d8b7f800 --- /dev/null +++ b/rbi/lib/orb/models/event_update_params.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module Orb + module Models + class EventUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + event_name: String, + properties: T.anything, + timestamp: Time, + customer_id: T.nilable(String), + external_customer_id: T.nilable(String) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(String) } + attr_accessor :event_name + + sig { returns(T.anything) } + attr_accessor :properties + + sig { returns(Time) } + attr_accessor :timestamp + + sig { returns(T.nilable(String)) } + attr_accessor :customer_id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig do + params( + event_name: String, + properties: T.anything, + timestamp: Time, + customer_id: T.nilable(String), + external_customer_id: T.nilable(String), + request_options: Orb::RequestOpts + ).void + end + def initialize( + event_name:, + properties:, + timestamp:, + customer_id: nil, + external_customer_id: nil, + request_options: {} + ) + end + + sig { returns(Orb::Models::EventUpdateParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/event_update_response.rbi b/rbi/lib/orb/models/event_update_response.rbi new file mode 100644 index 00000000..38b647b9 --- /dev/null +++ b/rbi/lib/orb/models/event_update_response.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class EventUpdateResponse < Orb::BaseModel + Shape = T.type_alias { {amended: String} } + + sig { returns(String) } + attr_accessor :amended + + sig { params(amended: String).void } + def initialize(amended:); end + + sig { returns(Orb::Models::EventUpdateResponse::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/events/backfill_close_params.rbi b/rbi/lib/orb/models/events/backfill_close_params.rbi new file mode 100644 index 00000000..4835eafe --- /dev/null +++ b/rbi/lib/orb/models/events/backfill_close_params.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module Orb + module Models + module Events + class BackfillCloseParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::Events::BackfillCloseParams::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/events/backfill_close_response.rbi b/rbi/lib/orb/models/events/backfill_close_response.rbi new file mode 100644 index 00000000..e4ddbcdd --- /dev/null +++ b/rbi/lib/orb/models/events/backfill_close_response.rbi @@ -0,0 +1,96 @@ +# typed: strong + +module Orb + module Models + module Events + class BackfillCloseResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + close_time: T.nilable(Time), + created_at: Time, + customer_id: T.nilable(String), + events_ingested: Integer, + reverted_at: T.nilable(Time), + status: Symbol, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :close_time + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(String)) } + attr_accessor :customer_id + + sig { returns(Integer) } + attr_accessor :events_ingested + + sig { returns(T.nilable(Time)) } + attr_accessor :reverted_at + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Time) } + attr_accessor :timeframe_end + + sig { returns(Time) } + attr_accessor :timeframe_start + + sig { returns(T.nilable(String)) } + attr_accessor :deprecation_filter + + sig do + params( + id: String, + close_time: T.nilable(Time), + created_at: Time, + customer_id: T.nilable(String), + events_ingested: Integer, + reverted_at: T.nilable(Time), + status: Symbol, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: T.nilable(String) + ).void + end + def initialize( + id:, + close_time:, + created_at:, + customer_id:, + events_ingested:, + reverted_at:, + status:, + timeframe_end:, + timeframe_start:, + deprecation_filter: nil + ); end + + sig { returns(Orb::Models::Events::BackfillCloseResponse::Shape) } + def to_h; end + + class Status < Orb::Enum + abstract! + + PENDING = :pending + REFLECTED = :reflected + PENDING_REVERT = :pending_revert + REVERTED = :reverted + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/events/backfill_create_params.rbi b/rbi/lib/orb/models/events/backfill_create_params.rbi new file mode 100644 index 00000000..4a8f34e6 --- /dev/null +++ b/rbi/lib/orb/models/events/backfill_create_params.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Orb + module Models + module Events + class BackfillCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + timeframe_end: Time, + timeframe_start: Time, + close_time: T.nilable(Time), + customer_id: T.nilable(String), + deprecation_filter: T.nilable(String), + external_customer_id: T.nilable(String), + replace_existing_events: T::Boolean + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(Time) } + attr_accessor :timeframe_end + + sig { returns(Time) } + attr_accessor :timeframe_start + + sig { returns(T.nilable(Time)) } + attr_accessor :close_time + + sig { returns(T.nilable(String)) } + attr_accessor :customer_id + + sig { returns(T.nilable(String)) } + attr_accessor :deprecation_filter + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :replace_existing_events + + sig { params(replace_existing_events: T::Boolean).void } + attr_writer :replace_existing_events + + sig do + params( + timeframe_end: Time, + timeframe_start: Time, + close_time: T.nilable(Time), + customer_id: T.nilable(String), + deprecation_filter: T.nilable(String), + external_customer_id: T.nilable(String), + replace_existing_events: T::Boolean, + request_options: Orb::RequestOpts + ).void + end + def initialize( + timeframe_end:, + timeframe_start:, + close_time: nil, + customer_id: nil, + deprecation_filter: nil, + external_customer_id: nil, + replace_existing_events: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::Events::BackfillCreateParams::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/events/backfill_create_response.rbi b/rbi/lib/orb/models/events/backfill_create_response.rbi new file mode 100644 index 00000000..b4d83b15 --- /dev/null +++ b/rbi/lib/orb/models/events/backfill_create_response.rbi @@ -0,0 +1,96 @@ +# typed: strong + +module Orb + module Models + module Events + class BackfillCreateResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + close_time: T.nilable(Time), + created_at: Time, + customer_id: T.nilable(String), + events_ingested: Integer, + reverted_at: T.nilable(Time), + status: Symbol, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :close_time + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(String)) } + attr_accessor :customer_id + + sig { returns(Integer) } + attr_accessor :events_ingested + + sig { returns(T.nilable(Time)) } + attr_accessor :reverted_at + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Time) } + attr_accessor :timeframe_end + + sig { returns(Time) } + attr_accessor :timeframe_start + + sig { returns(T.nilable(String)) } + attr_accessor :deprecation_filter + + sig do + params( + id: String, + close_time: T.nilable(Time), + created_at: Time, + customer_id: T.nilable(String), + events_ingested: Integer, + reverted_at: T.nilable(Time), + status: Symbol, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: T.nilable(String) + ).void + end + def initialize( + id:, + close_time:, + created_at:, + customer_id:, + events_ingested:, + reverted_at:, + status:, + timeframe_end:, + timeframe_start:, + deprecation_filter: nil + ); end + + sig { returns(Orb::Models::Events::BackfillCreateResponse::Shape) } + def to_h; end + + class Status < Orb::Enum + abstract! + + PENDING = :pending + REFLECTED = :reflected + PENDING_REVERT = :pending_revert + REVERTED = :reverted + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/events/backfill_fetch_params.rbi b/rbi/lib/orb/models/events/backfill_fetch_params.rbi new file mode 100644 index 00000000..6a40173e --- /dev/null +++ b/rbi/lib/orb/models/events/backfill_fetch_params.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module Orb + module Models + module Events + class BackfillFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::Events::BackfillFetchParams::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/events/backfill_fetch_response.rbi b/rbi/lib/orb/models/events/backfill_fetch_response.rbi new file mode 100644 index 00000000..0ae79fc2 --- /dev/null +++ b/rbi/lib/orb/models/events/backfill_fetch_response.rbi @@ -0,0 +1,96 @@ +# typed: strong + +module Orb + module Models + module Events + class BackfillFetchResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + close_time: T.nilable(Time), + created_at: Time, + customer_id: T.nilable(String), + events_ingested: Integer, + reverted_at: T.nilable(Time), + status: Symbol, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :close_time + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(String)) } + attr_accessor :customer_id + + sig { returns(Integer) } + attr_accessor :events_ingested + + sig { returns(T.nilable(Time)) } + attr_accessor :reverted_at + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Time) } + attr_accessor :timeframe_end + + sig { returns(Time) } + attr_accessor :timeframe_start + + sig { returns(T.nilable(String)) } + attr_accessor :deprecation_filter + + sig do + params( + id: String, + close_time: T.nilable(Time), + created_at: Time, + customer_id: T.nilable(String), + events_ingested: Integer, + reverted_at: T.nilable(Time), + status: Symbol, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: T.nilable(String) + ).void + end + def initialize( + id:, + close_time:, + created_at:, + customer_id:, + events_ingested:, + reverted_at:, + status:, + timeframe_end:, + timeframe_start:, + deprecation_filter: nil + ); end + + sig { returns(Orb::Models::Events::BackfillFetchResponse::Shape) } + def to_h; end + + class Status < Orb::Enum + abstract! + + PENDING = :pending + REFLECTED = :reflected + PENDING_REVERT = :pending_revert + REVERTED = :reverted + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/events/backfill_list_params.rbi b/rbi/lib/orb/models/events/backfill_list_params.rbi new file mode 100644 index 00000000..f9477e5b --- /dev/null +++ b/rbi/lib/orb/models/events/backfill_list_params.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Orb + module Models + module Events + class BackfillListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all({cursor: T.nilable(String), limit: Integer}, Orb::RequestParameters::Shape) + end + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { params(cursor: T.nilable(String), limit: Integer, request_options: Orb::RequestOpts).void } + def initialize(cursor: nil, limit: nil, request_options: {}); end + + sig { returns(Orb::Models::Events::BackfillListParams::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/events/backfill_list_response.rbi b/rbi/lib/orb/models/events/backfill_list_response.rbi new file mode 100644 index 00000000..8ade674a --- /dev/null +++ b/rbi/lib/orb/models/events/backfill_list_response.rbi @@ -0,0 +1,96 @@ +# typed: strong + +module Orb + module Models + module Events + class BackfillListResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + close_time: T.nilable(Time), + created_at: Time, + customer_id: T.nilable(String), + events_ingested: Integer, + reverted_at: T.nilable(Time), + status: Symbol, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :close_time + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(String)) } + attr_accessor :customer_id + + sig { returns(Integer) } + attr_accessor :events_ingested + + sig { returns(T.nilable(Time)) } + attr_accessor :reverted_at + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Time) } + attr_accessor :timeframe_end + + sig { returns(Time) } + attr_accessor :timeframe_start + + sig { returns(T.nilable(String)) } + attr_accessor :deprecation_filter + + sig do + params( + id: String, + close_time: T.nilable(Time), + created_at: Time, + customer_id: T.nilable(String), + events_ingested: Integer, + reverted_at: T.nilable(Time), + status: Symbol, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: T.nilable(String) + ).void + end + def initialize( + id:, + close_time:, + created_at:, + customer_id:, + events_ingested:, + reverted_at:, + status:, + timeframe_end:, + timeframe_start:, + deprecation_filter: nil + ); end + + sig { returns(Orb::Models::Events::BackfillListResponse::Shape) } + def to_h; end + + class Status < Orb::Enum + abstract! + + PENDING = :pending + REFLECTED = :reflected + PENDING_REVERT = :pending_revert + REVERTED = :reverted + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/events/backfill_revert_params.rbi b/rbi/lib/orb/models/events/backfill_revert_params.rbi new file mode 100644 index 00000000..26a87a68 --- /dev/null +++ b/rbi/lib/orb/models/events/backfill_revert_params.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module Orb + module Models + module Events + class BackfillRevertParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::Events::BackfillRevertParams::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/events/backfill_revert_response.rbi b/rbi/lib/orb/models/events/backfill_revert_response.rbi new file mode 100644 index 00000000..ccb1b146 --- /dev/null +++ b/rbi/lib/orb/models/events/backfill_revert_response.rbi @@ -0,0 +1,96 @@ +# typed: strong + +module Orb + module Models + module Events + class BackfillRevertResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + close_time: T.nilable(Time), + created_at: Time, + customer_id: T.nilable(String), + events_ingested: Integer, + reverted_at: T.nilable(Time), + status: Symbol, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Time)) } + attr_accessor :close_time + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(String)) } + attr_accessor :customer_id + + sig { returns(Integer) } + attr_accessor :events_ingested + + sig { returns(T.nilable(Time)) } + attr_accessor :reverted_at + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Time) } + attr_accessor :timeframe_end + + sig { returns(Time) } + attr_accessor :timeframe_start + + sig { returns(T.nilable(String)) } + attr_accessor :deprecation_filter + + sig do + params( + id: String, + close_time: T.nilable(Time), + created_at: Time, + customer_id: T.nilable(String), + events_ingested: Integer, + reverted_at: T.nilable(Time), + status: Symbol, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: T.nilable(String) + ).void + end + def initialize( + id:, + close_time:, + created_at:, + customer_id:, + events_ingested:, + reverted_at:, + status:, + timeframe_end:, + timeframe_start:, + deprecation_filter: nil + ); end + + sig { returns(Orb::Models::Events::BackfillRevertResponse::Shape) } + def to_h; end + + class Status < Orb::Enum + abstract! + + PENDING = :pending + REFLECTED = :reflected + PENDING_REVERT = :pending_revert + REVERTED = :reverted + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/events/event_volumes.rbi b/rbi/lib/orb/models/events/event_volumes.rbi new file mode 100644 index 00000000..966b7f28 --- /dev/null +++ b/rbi/lib/orb/models/events/event_volumes.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module Orb + module Models + EventVolumes = T.type_alias { Events::EventVolumes } + + module Events + class EventVolumes < Orb::BaseModel + Shape = T.type_alias { {data: T::Array[Orb::Models::Events::EventVolumes::Data]} } + + sig { returns(T::Array[Orb::Models::Events::EventVolumes::Data]) } + attr_accessor :data + + sig { params(data: T::Array[Orb::Models::Events::EventVolumes::Data]).void } + def initialize(data:); end + + sig { returns(Orb::Models::Events::EventVolumes::Shape) } + def to_h; end + + class Data < Orb::BaseModel + Shape = T.type_alias { {count: Integer, timeframe_end: Time, timeframe_start: Time} } + + sig { returns(Integer) } + attr_accessor :count + + sig { returns(Time) } + attr_accessor :timeframe_end + + sig { returns(Time) } + attr_accessor :timeframe_start + + sig { params(count: Integer, timeframe_end: Time, timeframe_start: Time).void } + def initialize(count:, timeframe_end:, timeframe_start:); end + + sig { returns(Orb::Models::Events::EventVolumes::Data::Shape) } + def to_h; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/events/volume_list_params.rbi b/rbi/lib/orb/models/events/volume_list_params.rbi new file mode 100644 index 00000000..6f1edb5e --- /dev/null +++ b/rbi/lib/orb/models/events/volume_list_params.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Orb + module Models + module Events + class VolumeListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + {timeframe_start: Time, cursor: T.nilable(String), limit: Integer, timeframe_end: Time}, + Orb::RequestParameters::Shape + ) + end + + sig { returns(Time) } + attr_accessor :timeframe_start + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { returns(T.nilable(Time)) } + attr_reader :timeframe_end + + sig { params(timeframe_end: Time).void } + attr_writer :timeframe_end + + sig do + params( + timeframe_start: Time, + cursor: T.nilable(String), + limit: Integer, + timeframe_end: Time, + request_options: Orb::RequestOpts + ).void + end + def initialize(timeframe_start:, cursor: nil, limit: nil, timeframe_end: nil, request_options: {}) + end + + sig { returns(Orb::Models::Events::VolumeListParams::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/invoice.rbi b/rbi/lib/orb/models/invoice.rbi new file mode 100644 index 00000000..fb3b09c5 --- /dev/null +++ b/rbi/lib/orb/models/invoice.rbi @@ -0,0 +1,1662 @@ +# typed: strong + +module Orb + module Models + class Invoice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount_due: String, + auto_collection: Orb::Models::Invoice::AutoCollection, + billing_address: T.nilable(Orb::Models::Invoice::BillingAddress), + created_at: Time, + credit_notes: T::Array[Orb::Models::Invoice::CreditNote], + currency: String, + customer: Orb::Models::Invoice::Customer, + customer_balance_transactions: T::Array[Orb::Models::Invoice::CustomerBalanceTransaction], + customer_tax_id: T.nilable(Orb::Models::Invoice::CustomerTaxID), + discount: T.anything, + discounts: T::Array[Orb::Models::InvoiceLevelDiscount::Variants], + due_date: T.nilable(Time), + eligible_to_issue_at: T.nilable(Time), + hosted_invoice_url: T.nilable(String), + invoice_date: Time, + invoice_number: String, + invoice_pdf: T.nilable(String), + invoice_source: Symbol, + issue_failed_at: T.nilable(Time), + issued_at: T.nilable(Time), + line_items: T::Array[Orb::Models::Invoice::LineItem], + maximum: T.nilable(Orb::Models::Invoice::Maximum), + maximum_amount: T.nilable(String), + memo: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Invoice::Minimum), + minimum_amount: T.nilable(String), + paid_at: T.nilable(Time), + payment_attempts: T::Array[Orb::Models::Invoice::PaymentAttempt], + payment_failed_at: T.nilable(Time), + payment_started_at: T.nilable(Time), + scheduled_issue_at: T.nilable(Time), + shipping_address: T.nilable(Orb::Models::Invoice::ShippingAddress), + status: Symbol, + subscription: T.nilable(Orb::Models::Invoice::Subscription), + subtotal: String, + sync_failed_at: T.nilable(Time), + total: String, + voided_at: T.nilable(Time), + will_auto_issue: T::Boolean + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :amount_due + + sig { returns(Orb::Models::Invoice::AutoCollection) } + attr_accessor :auto_collection + + sig { returns(T.nilable(Orb::Models::Invoice::BillingAddress)) } + attr_accessor :billing_address + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T::Array[Orb::Models::Invoice::CreditNote]) } + attr_accessor :credit_notes + + sig { returns(String) } + attr_accessor :currency + + sig { returns(Orb::Models::Invoice::Customer) } + attr_accessor :customer + + sig { returns(T::Array[Orb::Models::Invoice::CustomerBalanceTransaction]) } + attr_accessor :customer_balance_transactions + + sig { returns(T.nilable(Orb::Models::Invoice::CustomerTaxID)) } + attr_accessor :customer_tax_id + + sig { returns(T.anything) } + attr_accessor :discount + + sig { returns(T::Array[Orb::Models::InvoiceLevelDiscount::Variants]) } + attr_accessor :discounts + + sig { returns(T.nilable(Time)) } + attr_accessor :due_date + + sig { returns(T.nilable(Time)) } + attr_accessor :eligible_to_issue_at + + sig { returns(T.nilable(String)) } + attr_accessor :hosted_invoice_url + + sig { returns(Time) } + attr_accessor :invoice_date + + sig { returns(String) } + attr_accessor :invoice_number + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_pdf + + sig { returns(Symbol) } + attr_accessor :invoice_source + + sig { returns(T.nilable(Time)) } + attr_accessor :issue_failed_at + + sig { returns(T.nilable(Time)) } + attr_accessor :issued_at + + sig { returns(T::Array[Orb::Models::Invoice::LineItem]) } + attr_accessor :line_items + + sig { returns(T.nilable(Orb::Models::Invoice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Invoice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Time)) } + attr_accessor :paid_at + + sig { returns(T::Array[Orb::Models::Invoice::PaymentAttempt]) } + attr_accessor :payment_attempts + + sig { returns(T.nilable(Time)) } + attr_accessor :payment_failed_at + + sig { returns(T.nilable(Time)) } + attr_accessor :payment_started_at + + sig { returns(T.nilable(Time)) } + attr_accessor :scheduled_issue_at + + sig { returns(T.nilable(Orb::Models::Invoice::ShippingAddress)) } + attr_accessor :shipping_address + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(T.nilable(Orb::Models::Invoice::Subscription)) } + attr_accessor :subscription + + sig { returns(String) } + attr_accessor :subtotal + + sig { returns(T.nilable(Time)) } + attr_accessor :sync_failed_at + + sig { returns(String) } + attr_accessor :total + + sig { returns(T.nilable(Time)) } + attr_accessor :voided_at + + sig { returns(T::Boolean) } + attr_accessor :will_auto_issue + + sig do + params( + id: String, + amount_due: String, + auto_collection: Orb::Models::Invoice::AutoCollection, + billing_address: T.nilable(Orb::Models::Invoice::BillingAddress), + created_at: Time, + credit_notes: T::Array[Orb::Models::Invoice::CreditNote], + currency: String, + customer: Orb::Models::Invoice::Customer, + customer_balance_transactions: T::Array[Orb::Models::Invoice::CustomerBalanceTransaction], + customer_tax_id: T.nilable(Orb::Models::Invoice::CustomerTaxID), + discount: T.anything, + discounts: T::Array[Orb::Models::InvoiceLevelDiscount::Variants], + due_date: T.nilable(Time), + eligible_to_issue_at: T.nilable(Time), + hosted_invoice_url: T.nilable(String), + invoice_date: Time, + invoice_number: String, + invoice_pdf: T.nilable(String), + invoice_source: Symbol, + issue_failed_at: T.nilable(Time), + issued_at: T.nilable(Time), + line_items: T::Array[Orb::Models::Invoice::LineItem], + maximum: T.nilable(Orb::Models::Invoice::Maximum), + maximum_amount: T.nilable(String), + memo: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Invoice::Minimum), + minimum_amount: T.nilable(String), + paid_at: T.nilable(Time), + payment_attempts: T::Array[Orb::Models::Invoice::PaymentAttempt], + payment_failed_at: T.nilable(Time), + payment_started_at: T.nilable(Time), + scheduled_issue_at: T.nilable(Time), + shipping_address: T.nilable(Orb::Models::Invoice::ShippingAddress), + status: Symbol, + subscription: T.nilable(Orb::Models::Invoice::Subscription), + subtotal: String, + sync_failed_at: T.nilable(Time), + total: String, + voided_at: T.nilable(Time), + will_auto_issue: T::Boolean + ).void + end + def initialize( + id:, + amount_due:, + auto_collection:, + billing_address:, + created_at:, + credit_notes:, + currency:, + customer:, + customer_balance_transactions:, + customer_tax_id:, + discount:, + discounts:, + due_date:, + eligible_to_issue_at:, + hosted_invoice_url:, + invoice_date:, + invoice_number:, + invoice_pdf:, + invoice_source:, + issue_failed_at:, + issued_at:, + line_items:, + maximum:, + maximum_amount:, + memo:, + metadata:, + minimum:, + minimum_amount:, + paid_at:, + payment_attempts:, + payment_failed_at:, + payment_started_at:, + scheduled_issue_at:, + shipping_address:, + status:, + subscription:, + subtotal:, + sync_failed_at:, + total:, + voided_at:, + will_auto_issue: + ); end + + sig { returns(Orb::Models::Invoice::Shape) } + def to_h; end + + class AutoCollection < Orb::BaseModel + Shape = T.type_alias do + { + enabled: T.nilable(T::Boolean), + next_attempt_at: T.nilable(Time), + num_attempts: T.nilable(Integer), + previously_attempted_at: T.nilable(Time) + } + end + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :enabled + + sig { returns(T.nilable(Time)) } + attr_accessor :next_attempt_at + + sig { returns(T.nilable(Integer)) } + attr_accessor :num_attempts + + sig { returns(T.nilable(Time)) } + attr_accessor :previously_attempted_at + + sig do + params( + enabled: T.nilable(T::Boolean), + next_attempt_at: T.nilable(Time), + num_attempts: T.nilable(Integer), + previously_attempted_at: T.nilable(Time) + ).void + end + def initialize(enabled:, next_attempt_at:, num_attempts:, previously_attempted_at:); end + + sig { returns(Orb::Models::Invoice::AutoCollection::Shape) } + def to_h; end + end + + class BillingAddress < Orb::BaseModel + Shape = T.type_alias do + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + sig { returns(T.nilable(String)) } + attr_accessor :country + + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + sig { returns(T.nilable(String)) } + attr_accessor :state + + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).void + end + def initialize(city:, country:, line1:, line2:, postal_code:, state:); end + + sig { returns(Orb::Models::Invoice::BillingAddress::Shape) } + def to_h; end + end + + class CreditNote < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + credit_note_number: String, + memo: T.nilable(String), + reason: String, + total: String, + type: String, + voided_at: T.nilable(Time) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :credit_note_number + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(String) } + attr_accessor :reason + + sig { returns(String) } + attr_accessor :total + + sig { returns(String) } + attr_accessor :type + + sig { returns(T.nilable(Time)) } + attr_accessor :voided_at + + sig do + params( + id: String, + credit_note_number: String, + memo: T.nilable(String), + reason: String, + total: String, + type: String, + voided_at: T.nilable(Time) + ).void + end + def initialize(id:, credit_note_number:, memo:, reason:, total:, type:, voided_at:); end + + sig { returns(Orb::Models::Invoice::CreditNote::Shape) } + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig { returns(Orb::Models::Invoice::Customer::Shape) } + def to_h; end + end + + class CustomerBalanceTransaction < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + action: Symbol, + amount: String, + created_at: Time, + credit_note: T.nilable(Orb::Models::Invoice::CustomerBalanceTransaction::CreditNote), + description: T.nilable(String), + ending_balance: String, + invoice: T.nilable(Orb::Models::Invoice::CustomerBalanceTransaction::Invoice), + starting_balance: String, + type: Symbol + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :action + + sig { returns(String) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Invoice::CustomerBalanceTransaction::CreditNote)) } + attr_accessor :credit_note + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(String) } + attr_accessor :ending_balance + + sig { returns(T.nilable(Orb::Models::Invoice::CustomerBalanceTransaction::Invoice)) } + attr_accessor :invoice + + sig { returns(String) } + attr_accessor :starting_balance + + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + id: String, + action: Symbol, + amount: String, + created_at: Time, + credit_note: T.nilable(Orb::Models::Invoice::CustomerBalanceTransaction::CreditNote), + description: T.nilable(String), + ending_balance: String, + invoice: T.nilable(Orb::Models::Invoice::CustomerBalanceTransaction::Invoice), + starting_balance: String, + type: Symbol + ).void + end + def initialize( + id:, + action:, + amount:, + created_at:, + credit_note:, + description:, + ending_balance:, + invoice:, + starting_balance:, + type: + ); end + + sig { returns(Orb::Models::Invoice::CustomerBalanceTransaction::Shape) } + def to_h; end + + class Action < Orb::Enum + abstract! + + APPLIED_TO_INVOICE = :applied_to_invoice + MANUAL_ADJUSTMENT = :manual_adjustment + PRORATED_REFUND = :prorated_refund + REVERT_PRORATED_REFUND = :revert_prorated_refund + RETURN_FROM_VOIDING = :return_from_voiding + CREDIT_NOTE_APPLIED = :credit_note_applied + CREDIT_NOTE_VOIDED = :credit_note_voided + OVERPAYMENT_REFUND = :overpayment_refund + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditNote < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Invoice::CustomerBalanceTransaction::CreditNote::Shape) } + def to_h; end + end + + class Invoice < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Invoice::CustomerBalanceTransaction::Invoice::Shape) } + def to_h; end + end + + class Type < Orb::Enum + abstract! + + INCREMENT = :increment + DECREMENT = :decrement + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class CustomerTaxID < Orb::BaseModel + Shape = T.type_alias { {country: Symbol, type: Symbol, value: String} } + + sig { returns(Symbol) } + attr_accessor :country + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(String) } + attr_accessor :value + + sig { params(country: Symbol, type: Symbol, value: String).void } + def initialize(country:, type:, value:); end + + sig { returns(Orb::Models::Invoice::CustomerTaxID::Shape) } + def to_h; end + + class Country < Orb::Enum + abstract! + + AD = :AD + AE = :AE + AR = :AR + AT = :AT + AU = :AU + BE = :BE + BG = :BG + BH = :BH + BO = :BO + BR = :BR + CA = :CA + CH = :CH + CL = :CL + CN = :CN + CO = :CO + CR = :CR + CY = :CY + CZ = :CZ + DE = :DE + DK = :DK + EE = :EE + DO = :DO + EC = :EC + EG = :EG + ES = :ES + EU = :EU + FI = :FI + FR = :FR + GB = :GB + GE = :GE + GR = :GR + HK = :HK + HR = :HR + HU = :HU + ID = :ID + IE = :IE + IL = :IL + IN = :IN + IS = :IS + IT = :IT + JP = :JP + KE = :KE + KR = :KR + KZ = :KZ + LI = :LI + LT = :LT + LU = :LU + LV = :LV + MT = :MT + MX = :MX + MY = :MY + NG = :NG + NL = :NL + NO = :NO + NZ = :NZ + OM = :OM + PE = :PE + PH = :PH + PL = :PL + PT = :PT + RO = :RO + RS = :RS + RU = :RU + SA = :SA + SE = :SE + SG = :SG + SI = :SI + SK = :SK + SV = :SV + TH = :TH + TR = :TR + TW = :TW + UA = :UA + US = :US + UY = :UY + VE = :VE + VN = :VN + ZA = :ZA + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class Type < Orb::Enum + abstract! + + AD_NRT = :ad_nrt + AE_TRN = :ae_trn + AR_CUIT = :ar_cuit + EU_VAT = :eu_vat + AU_ABN = :au_abn + AU_ARN = :au_arn + BG_UIC = :bg_uic + BH_VAT = :bh_vat + BO_TIN = :bo_tin + BR_CNPJ = :br_cnpj + BR_CPF = :br_cpf + CA_BN = :ca_bn + CA_GST_HST = :ca_gst_hst + CA_PST_BC = :ca_pst_bc + CA_PST_MB = :ca_pst_mb + CA_PST_SK = :ca_pst_sk + CA_QST = :ca_qst + CH_VAT = :ch_vat + CL_TIN = :cl_tin + CN_TIN = :cn_tin + CO_NIT = :co_nit + CR_TIN = :cr_tin + DO_RCN = :do_rcn + EC_RUC = :ec_ruc + EG_TIN = :eg_tin + ES_CIF = :es_cif + EU_OSS_VAT = :eu_oss_vat + GB_VAT = :gb_vat + GE_VAT = :ge_vat + HK_BR = :hk_br + HU_TIN = :hu_tin + ID_NPWP = :id_npwp + IL_VAT = :il_vat + IN_GST = :in_gst + IS_VAT = :is_vat + JP_CN = :jp_cn + JP_RN = :jp_rn + JP_TRN = :jp_trn + KE_PIN = :ke_pin + KR_BRN = :kr_brn + KZ_BIN = :kz_bin + LI_UID = :li_uid + MX_RFC = :mx_rfc + MY_FRP = :my_frp + MY_ITN = :my_itn + MY_SST = :my_sst + NG_TIN = :ng_tin + NO_VAT = :no_vat + NO_VOEC = :no_voec + NZ_GST = :nz_gst + OM_VAT = :om_vat + PE_RUC = :pe_ruc + PH_TIN = :ph_tin + RO_TIN = :ro_tin + RS_PIB = :rs_pib + RU_INN = :ru_inn + RU_KPP = :ru_kpp + SA_VAT = :sa_vat + SG_GST = :sg_gst + SG_UEN = :sg_uen + SI_TIN = :si_tin + SV_NIT = :sv_nit + TH_VAT = :th_vat + TR_TIN = :tr_tin + TW_VAT = :tw_vat + UA_VAT = :ua_vat + US_EIN = :us_ein + UY_RUC = :uy_ruc + VE_RIF = :ve_rif + VN_TIN = :vn_tin + ZA_VAT = :za_vat + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoiceSource < Orb::Enum + abstract! + + SUBSCRIPTION = :subscription + PARTIAL = :partial + ONE_OFF = :one_off + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class LineItem < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjusted_subtotal: String, + adjustments: T::Array[Orb::Models::Invoice::LineItem::Adjustment::Variants], + amount: String, + credits_applied: String, + discount: T.nilable(Orb::Models::Discount::Variants), + end_date: Time, + grouping: T.nilable(String), + maximum: T.nilable(Orb::Models::Invoice::LineItem::Maximum), + maximum_amount: T.nilable(String), + minimum: T.nilable(Orb::Models::Invoice::LineItem::Minimum), + minimum_amount: T.nilable(String), + name: String, + partially_invoiced_amount: String, + price: T.nilable(Orb::Models::Price::Variants), + quantity: Float, + start_date: Time, + sub_line_items: T::Array[Orb::Models::Invoice::LineItem::SubLineItem::Variants], + subtotal: String, + tax_amounts: T::Array[Orb::Models::Invoice::LineItem::TaxAmount] + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :adjusted_subtotal + + sig { returns(T::Array[Orb::Models::Invoice::LineItem::Adjustment::Variants]) } + attr_accessor :adjustments + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :credits_applied + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(Time) } + attr_accessor :end_date + + sig { returns(T.nilable(String)) } + attr_accessor :grouping + + sig { returns(T.nilable(Orb::Models::Invoice::LineItem::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Orb::Models::Invoice::LineItem::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(String) } + attr_accessor :name + + sig { returns(String) } + attr_accessor :partially_invoiced_amount + + sig { returns(T.nilable(Orb::Models::Price::Variants)) } + attr_accessor :price + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(T::Array[Orb::Models::Invoice::LineItem::SubLineItem::Variants]) } + attr_accessor :sub_line_items + + sig { returns(String) } + attr_accessor :subtotal + + sig { returns(T::Array[Orb::Models::Invoice::LineItem::TaxAmount]) } + attr_accessor :tax_amounts + + sig do + params( + id: String, + adjusted_subtotal: String, + adjustments: T::Array[Orb::Models::Invoice::LineItem::Adjustment::Variants], + amount: String, + credits_applied: String, + discount: T.nilable(Orb::Models::Discount::Variants), + end_date: Time, + grouping: T.nilable(String), + maximum: T.nilable(Orb::Models::Invoice::LineItem::Maximum), + maximum_amount: T.nilable(String), + minimum: T.nilable(Orb::Models::Invoice::LineItem::Minimum), + minimum_amount: T.nilable(String), + name: String, + partially_invoiced_amount: String, + price: T.nilable(Orb::Models::Price::Variants), + quantity: Float, + start_date: Time, + sub_line_items: T::Array[Orb::Models::Invoice::LineItem::SubLineItem::Variants], + subtotal: String, + tax_amounts: T::Array[Orb::Models::Invoice::LineItem::TaxAmount] + ).void + end + def initialize( + id:, + adjusted_subtotal:, + adjustments:, + amount:, + credits_applied:, + discount:, + end_date:, + grouping:, + maximum:, + maximum_amount:, + minimum:, + minimum_amount:, + name:, + partially_invoiced_amount:, + price:, + quantity:, + start_date:, + sub_line_items:, + subtotal:, + tax_amounts: + ); end + + sig { returns(Orb::Models::Invoice::LineItem::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::Invoice::LineItem::Adjustment::AmountDiscountAdjustment, + Orb::Models::Invoice::LineItem::Adjustment::PercentageDiscountAdjustment, + Orb::Models::Invoice::LineItem::Adjustment::UsageDiscountAdjustment, + Orb::Models::Invoice::LineItem::Adjustment::MinimumAdjustment, + Orb::Models::Invoice::LineItem::Adjustment::MaximumAdjustment + ) + end + + class AmountDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + amount_discount:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + adjustment_type: :amount_discount + ); end + + sig { returns(Orb::Models::Invoice::LineItem::Adjustment::AmountDiscountAdjustment::Shape) } + def to_h; end + end + + class PercentageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + percentage_discount:, + plan_phase_order:, + reason:, + adjustment_type: :percentage_discount + ); end + + sig { returns(Orb::Models::Invoice::LineItem::Adjustment::PercentageDiscountAdjustment::Shape) } + def to_h; end + end + + class UsageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float, + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + usage_discount:, + adjustment_type: :usage_discount + ); end + + sig { returns(Orb::Models::Invoice::LineItem::Adjustment::UsageDiscountAdjustment::Shape) } + def to_h; end + end + + class MinimumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + item_id:, + minimum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :minimum + ); end + + sig { returns(Orb::Models::Invoice::LineItem::Adjustment::MinimumAdjustment::Shape) } + def to_h; end + end + + class MaximumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + maximum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :maximum + ); end + + sig { returns(Orb::Models::Invoice::LineItem::Adjustment::MaximumAdjustment::Shape) } + def to_h; end + end + + sig do + override.returns( + [ + [Symbol, Orb::Models::Invoice::LineItem::Adjustment::AmountDiscountAdjustment], + [Symbol, Orb::Models::Invoice::LineItem::Adjustment::PercentageDiscountAdjustment], + [Symbol, Orb::Models::Invoice::LineItem::Adjustment::UsageDiscountAdjustment], + [Symbol, Orb::Models::Invoice::LineItem::Adjustment::MinimumAdjustment], + [Symbol, Orb::Models::Invoice::LineItem::Adjustment::MaximumAdjustment] + ] + ) + end + private_class_method def self.variants; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Invoice::LineItem::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Invoice::LineItem::Minimum::Shape) } + def to_h; end + end + + class SubLineItem < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem, + Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem, + Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem + ) + end + + class MatrixSubLineItem < Orb::BaseModel + Shape = T.type_alias do + { + amount: String, + grouping: T.nilable(Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::Grouping), + matrix_config: Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig, + name: String, + quantity: Float, + type: Symbol + } + end + + sig { returns(String) } + attr_accessor :amount + + sig do + returns(T.nilable(Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::Grouping)) + end + attr_accessor :grouping + + sig { returns(Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig) } + attr_accessor :matrix_config + + sig { returns(String) } + attr_accessor :name + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + amount: String, + grouping: T.nilable(Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::Grouping), + matrix_config: Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig, + name: String, + quantity: Float, + type: Symbol + ).void + end + def initialize(amount:, grouping:, matrix_config:, name:, quantity:, type: :matrix); end + + sig { returns(Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::Shape) } + def to_h; end + + class Grouping < Orb::BaseModel + Shape = T.type_alias { {key: String, value: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :key + + sig { returns(T.nilable(String)) } + attr_accessor :value + + sig { params(key: String, value: T.nilable(String)).void } + def initialize(key:, value:); end + + sig { returns(Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::Grouping::Shape) } + def to_h; end + end + + class MatrixConfig < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[T.nilable(String)]} } + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimension_values + + sig { params(dimension_values: T::Array[T.nilable(String)]).void } + def initialize(dimension_values:); end + + sig do + returns(Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig::Shape) + end + def to_h; end + end + end + + class TierSubLineItem < Orb::BaseModel + Shape = T.type_alias do + { + amount: String, + grouping: T.nilable(Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::Grouping), + name: String, + quantity: Float, + tier_config: Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::TierConfig, + type: Symbol + } + end + + sig { returns(String) } + attr_accessor :amount + + sig { returns(T.nilable(Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::Grouping)) } + attr_accessor :grouping + + sig { returns(String) } + attr_accessor :name + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::TierConfig) } + attr_accessor :tier_config + + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + amount: String, + grouping: T.nilable(Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::Grouping), + name: String, + quantity: Float, + tier_config: Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::TierConfig, + type: Symbol + ).void + end + def initialize(amount:, grouping:, name:, quantity:, tier_config:, type: :tier); end + + sig { returns(Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::Shape) } + def to_h; end + + class Grouping < Orb::BaseModel + Shape = T.type_alias { {key: String, value: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :key + + sig { returns(T.nilable(String)) } + attr_accessor :value + + sig { params(key: String, value: T.nilable(String)).void } + def initialize(key:, value:); end + + sig { returns(Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::Grouping::Shape) } + def to_h; end + end + + class TierConfig < Orb::BaseModel + Shape = T.type_alias { {first_unit: Float, last_unit: T.nilable(Float), unit_amount: String} } + + sig { returns(Float) } + attr_accessor :first_unit + + sig { returns(T.nilable(Float)) } + attr_accessor :last_unit + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(first_unit: Float, last_unit: T.nilable(Float), unit_amount: String).void } + def initialize(first_unit:, last_unit:, unit_amount:); end + + sig { returns(Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::TierConfig::Shape) } + def to_h; end + end + end + + class OtherSubLineItem < Orb::BaseModel + Shape = T.type_alias do + { + amount: String, + grouping: T.nilable(Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem::Grouping), + name: String, + quantity: Float, + type: Symbol + } + end + + sig { returns(String) } + attr_accessor :amount + + sig do + returns(T.nilable(Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem::Grouping)) + end + attr_accessor :grouping + + sig { returns(String) } + attr_accessor :name + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + amount: String, + grouping: T.nilable(Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem::Grouping), + name: String, + quantity: Float, + type: Symbol + ).void + end + def initialize(amount:, grouping:, name:, quantity:, type: :"'null'"); end + + sig { returns(Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem::Shape) } + def to_h; end + + class Grouping < Orb::BaseModel + Shape = T.type_alias { {key: String, value: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :key + + sig { returns(T.nilable(String)) } + attr_accessor :value + + sig { params(key: String, value: T.nilable(String)).void } + def initialize(key:, value:); end + + sig { returns(Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem::Grouping::Shape) } + def to_h; end + end + end + + sig do + override.returns( + [ + [Symbol, Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem], + [Symbol, Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem], + [Symbol, Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem] + ] + ) + end + private_class_method def self.variants; end + end + + class TaxAmount < Orb::BaseModel + Shape = T.type_alias do + {amount: String, tax_rate_description: String, tax_rate_percentage: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :tax_rate_description + + sig { returns(T.nilable(String)) } + attr_accessor :tax_rate_percentage + + sig do + params(amount: String, tax_rate_description: String, tax_rate_percentage: T.nilable(String)).void + end + def initialize(amount:, tax_rate_description:, tax_rate_percentage:); end + + sig { returns(Orb::Models::Invoice::LineItem::TaxAmount::Shape) } + def to_h; end + end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Invoice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Invoice::Minimum::Shape) } + def to_h; end + end + + class PaymentAttempt < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: String, + created_at: Time, + payment_provider: T.nilable(Symbol), + payment_provider_id: T.nilable(String), + succeeded: T::Boolean + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Symbol)) } + attr_accessor :payment_provider + + sig { returns(T.nilable(String)) } + attr_accessor :payment_provider_id + + sig { returns(T::Boolean) } + attr_accessor :succeeded + + sig do + params( + id: String, + amount: String, + created_at: Time, + payment_provider: T.nilable(Symbol), + payment_provider_id: T.nilable(String), + succeeded: T::Boolean + ).void + end + def initialize(id:, amount:, created_at:, payment_provider:, payment_provider_id:, succeeded:); end + + sig { returns(Orb::Models::Invoice::PaymentAttempt::Shape) } + def to_h; end + + class PaymentProvider < Orb::Enum + abstract! + + STRIPE = T.let(:stripe, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class ShippingAddress < Orb::BaseModel + Shape = T.type_alias do + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + sig { returns(T.nilable(String)) } + attr_accessor :country + + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + sig { returns(T.nilable(String)) } + attr_accessor :state + + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).void + end + def initialize(city:, country:, line1:, line2:, postal_code:, state:); end + + sig { returns(Orb::Models::Invoice::ShippingAddress::Shape) } + def to_h; end + end + + class Status < Orb::Enum + abstract! + + ISSUED = :issued + PAID = :paid + SYNCED = :synced + VOID = :void + DRAFT = :draft + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class Subscription < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Invoice::Subscription::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/invoice_create_params.rbi b/rbi/lib/orb/models/invoice_create_params.rbi new file mode 100644 index 00000000..e5cbcec9 --- /dev/null +++ b/rbi/lib/orb/models/invoice_create_params.rbi @@ -0,0 +1,166 @@ +# typed: strong + +module Orb + module Models + class InvoiceCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + currency: String, + invoice_date: Time, + line_items: T::Array[Orb::Models::InvoiceCreateParams::LineItem], + net_terms: Integer, + customer_id: T.nilable(String), + discount: T.nilable(Orb::Models::Discount::Variants), + external_customer_id: T.nilable(String), + memo: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + will_auto_issue: T::Boolean + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(String) } + attr_accessor :currency + + sig { returns(Time) } + attr_accessor :invoice_date + + sig { returns(T::Array[Orb::Models::InvoiceCreateParams::LineItem]) } + attr_accessor :line_items + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(T.nilable(String)) } + attr_accessor :customer_id + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :will_auto_issue + + sig { params(will_auto_issue: T::Boolean).void } + attr_writer :will_auto_issue + + sig do + params( + currency: String, + invoice_date: Time, + line_items: T::Array[Orb::Models::InvoiceCreateParams::LineItem], + net_terms: Integer, + customer_id: T.nilable(String), + discount: T.nilable(Orb::Models::Discount::Variants), + external_customer_id: T.nilable(String), + memo: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + will_auto_issue: T::Boolean, + request_options: Orb::RequestOpts + ).void + end + def initialize( + currency:, + invoice_date:, + line_items:, + net_terms:, + customer_id: nil, + discount: nil, + external_customer_id: nil, + memo: nil, + metadata: nil, + will_auto_issue: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::InvoiceCreateParams::Shape) } + def to_h; end + + class LineItem < Orb::BaseModel + Shape = T.type_alias do + { + end_date: Date, + item_id: String, + model_type: Symbol, + name: String, + quantity: Float, + start_date: Date, + unit_config: Orb::Models::InvoiceCreateParams::LineItem::UnitConfig + } + end + + sig { returns(Date) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Date) } + attr_accessor :start_date + + sig { returns(Orb::Models::InvoiceCreateParams::LineItem::UnitConfig) } + attr_accessor :unit_config + + sig do + params( + end_date: Date, + item_id: String, + model_type: Symbol, + name: String, + quantity: Float, + start_date: Date, + unit_config: Orb::Models::InvoiceCreateParams::LineItem::UnitConfig + ).void + end + def initialize(end_date:, item_id:, model_type:, name:, quantity:, start_date:, unit_config:); end + + sig { returns(Orb::Models::InvoiceCreateParams::LineItem::Shape) } + def to_h; end + + class ModelType < Orb::Enum + abstract! + + UNIT = :unit + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class UnitConfig < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(unit_amount: String).void } + def initialize(unit_amount:); end + + sig { returns(Orb::Models::InvoiceCreateParams::LineItem::UnitConfig::Shape) } + def to_h; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/invoice_fetch_params.rbi b/rbi/lib/orb/models/invoice_fetch_params.rbi new file mode 100644 index 00000000..d1d4781f --- /dev/null +++ b/rbi/lib/orb/models/invoice_fetch_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class InvoiceFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::InvoiceFetchParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/invoice_fetch_upcoming_params.rbi b/rbi/lib/orb/models/invoice_fetch_upcoming_params.rbi new file mode 100644 index 00000000..f708fca2 --- /dev/null +++ b/rbi/lib/orb/models/invoice_fetch_upcoming_params.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Orb + module Models + class InvoiceFetchUpcomingParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({subscription_id: String}, Orb::RequestParameters::Shape) } + + sig { returns(String) } + attr_accessor :subscription_id + + sig { params(subscription_id: String, request_options: Orb::RequestOpts).void } + def initialize(subscription_id:, request_options: {}); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/invoice_fetch_upcoming_response.rbi b/rbi/lib/orb/models/invoice_fetch_upcoming_response.rbi new file mode 100644 index 00000000..7107a4ac --- /dev/null +++ b/rbi/lib/orb/models/invoice_fetch_upcoming_response.rbi @@ -0,0 +1,1712 @@ +# typed: strong + +module Orb + module Models + class InvoiceFetchUpcomingResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount_due: String, + auto_collection: Orb::Models::InvoiceFetchUpcomingResponse::AutoCollection, + billing_address: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::BillingAddress), + created_at: Time, + credit_notes: T::Array[Orb::Models::InvoiceFetchUpcomingResponse::CreditNote], + currency: String, + customer: Orb::Models::InvoiceFetchUpcomingResponse::Customer, + customer_balance_transactions: T::Array[Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction], + customer_tax_id: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID), + discount: T.anything, + discounts: T::Array[Orb::Models::InvoiceLevelDiscount::Variants], + due_date: T.nilable(Time), + eligible_to_issue_at: T.nilable(Time), + hosted_invoice_url: T.nilable(String), + invoice_number: String, + invoice_pdf: T.nilable(String), + invoice_source: Symbol, + issue_failed_at: T.nilable(Time), + issued_at: T.nilable(Time), + line_items: T::Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem], + maximum: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::Maximum), + maximum_amount: T.nilable(String), + memo: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::Minimum), + minimum_amount: T.nilable(String), + paid_at: T.nilable(Time), + payment_attempts: T::Array[Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt], + payment_failed_at: T.nilable(Time), + payment_started_at: T.nilable(Time), + scheduled_issue_at: T.nilable(Time), + shipping_address: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::ShippingAddress), + status: Symbol, + subscription: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::Subscription), + subtotal: String, + sync_failed_at: T.nilable(Time), + target_date: Time, + total: String, + voided_at: T.nilable(Time), + will_auto_issue: T::Boolean + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :amount_due + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::AutoCollection) } + attr_accessor :auto_collection + + sig { returns(T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::BillingAddress)) } + attr_accessor :billing_address + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T::Array[Orb::Models::InvoiceFetchUpcomingResponse::CreditNote]) } + attr_accessor :credit_notes + + sig { returns(String) } + attr_accessor :currency + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::Customer) } + attr_accessor :customer + + sig { returns(T::Array[Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction]) } + attr_accessor :customer_balance_transactions + + sig { returns(T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID)) } + attr_accessor :customer_tax_id + + sig { returns(T.anything) } + attr_accessor :discount + + sig { returns(T::Array[Orb::Models::InvoiceLevelDiscount::Variants]) } + attr_accessor :discounts + + sig { returns(T.nilable(Time)) } + attr_accessor :due_date + + sig { returns(T.nilable(Time)) } + attr_accessor :eligible_to_issue_at + + sig { returns(T.nilable(String)) } + attr_accessor :hosted_invoice_url + + sig { returns(String) } + attr_accessor :invoice_number + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_pdf + + sig { returns(Symbol) } + attr_accessor :invoice_source + + sig { returns(T.nilable(Time)) } + attr_accessor :issue_failed_at + + sig { returns(T.nilable(Time)) } + attr_accessor :issued_at + + sig { returns(T::Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem]) } + attr_accessor :line_items + + sig { returns(T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Time)) } + attr_accessor :paid_at + + sig { returns(T::Array[Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt]) } + attr_accessor :payment_attempts + + sig { returns(T.nilable(Time)) } + attr_accessor :payment_failed_at + + sig { returns(T.nilable(Time)) } + attr_accessor :payment_started_at + + sig { returns(T.nilable(Time)) } + attr_accessor :scheduled_issue_at + + sig { returns(T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::ShippingAddress)) } + attr_accessor :shipping_address + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::Subscription)) } + attr_accessor :subscription + + sig { returns(String) } + attr_accessor :subtotal + + sig { returns(T.nilable(Time)) } + attr_accessor :sync_failed_at + + sig { returns(Time) } + attr_accessor :target_date + + sig { returns(String) } + attr_accessor :total + + sig { returns(T.nilable(Time)) } + attr_accessor :voided_at + + sig { returns(T::Boolean) } + attr_accessor :will_auto_issue + + sig do + params( + id: String, + amount_due: String, + auto_collection: Orb::Models::InvoiceFetchUpcomingResponse::AutoCollection, + billing_address: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::BillingAddress), + created_at: Time, + credit_notes: T::Array[Orb::Models::InvoiceFetchUpcomingResponse::CreditNote], + currency: String, + customer: Orb::Models::InvoiceFetchUpcomingResponse::Customer, + customer_balance_transactions: T::Array[Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction], + customer_tax_id: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID), + discount: T.anything, + discounts: T::Array[Orb::Models::InvoiceLevelDiscount::Variants], + due_date: T.nilable(Time), + eligible_to_issue_at: T.nilable(Time), + hosted_invoice_url: T.nilable(String), + invoice_number: String, + invoice_pdf: T.nilable(String), + invoice_source: Symbol, + issue_failed_at: T.nilable(Time), + issued_at: T.nilable(Time), + line_items: T::Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem], + maximum: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::Maximum), + maximum_amount: T.nilable(String), + memo: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::Minimum), + minimum_amount: T.nilable(String), + paid_at: T.nilable(Time), + payment_attempts: T::Array[Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt], + payment_failed_at: T.nilable(Time), + payment_started_at: T.nilable(Time), + scheduled_issue_at: T.nilable(Time), + shipping_address: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::ShippingAddress), + status: Symbol, + subscription: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::Subscription), + subtotal: String, + sync_failed_at: T.nilable(Time), + target_date: Time, + total: String, + voided_at: T.nilable(Time), + will_auto_issue: T::Boolean + ).void + end + def initialize( + id:, + amount_due:, + auto_collection:, + billing_address:, + created_at:, + credit_notes:, + currency:, + customer:, + customer_balance_transactions:, + customer_tax_id:, + discount:, + discounts:, + due_date:, + eligible_to_issue_at:, + hosted_invoice_url:, + invoice_number:, + invoice_pdf:, + invoice_source:, + issue_failed_at:, + issued_at:, + line_items:, + maximum:, + maximum_amount:, + memo:, + metadata:, + minimum:, + minimum_amount:, + paid_at:, + payment_attempts:, + payment_failed_at:, + payment_started_at:, + scheduled_issue_at:, + shipping_address:, + status:, + subscription:, + subtotal:, + sync_failed_at:, + target_date:, + total:, + voided_at:, + will_auto_issue: + ); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::Shape) } + def to_h; end + + class AutoCollection < Orb::BaseModel + Shape = T.type_alias do + { + enabled: T.nilable(T::Boolean), + next_attempt_at: T.nilable(Time), + num_attempts: T.nilable(Integer), + previously_attempted_at: T.nilable(Time) + } + end + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :enabled + + sig { returns(T.nilable(Time)) } + attr_accessor :next_attempt_at + + sig { returns(T.nilable(Integer)) } + attr_accessor :num_attempts + + sig { returns(T.nilable(Time)) } + attr_accessor :previously_attempted_at + + sig do + params( + enabled: T.nilable(T::Boolean), + next_attempt_at: T.nilable(Time), + num_attempts: T.nilable(Integer), + previously_attempted_at: T.nilable(Time) + ).void + end + def initialize(enabled:, next_attempt_at:, num_attempts:, previously_attempted_at:); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::AutoCollection::Shape) } + def to_h; end + end + + class BillingAddress < Orb::BaseModel + Shape = T.type_alias do + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + sig { returns(T.nilable(String)) } + attr_accessor :country + + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + sig { returns(T.nilable(String)) } + attr_accessor :state + + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).void + end + def initialize(city:, country:, line1:, line2:, postal_code:, state:); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::BillingAddress::Shape) } + def to_h; end + end + + class CreditNote < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + credit_note_number: String, + memo: T.nilable(String), + reason: String, + total: String, + type: String, + voided_at: T.nilable(Time) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :credit_note_number + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(String) } + attr_accessor :reason + + sig { returns(String) } + attr_accessor :total + + sig { returns(String) } + attr_accessor :type + + sig { returns(T.nilable(Time)) } + attr_accessor :voided_at + + sig do + params( + id: String, + credit_note_number: String, + memo: T.nilable(String), + reason: String, + total: String, + type: String, + voided_at: T.nilable(Time) + ).void + end + def initialize(id:, credit_note_number:, memo:, reason:, total:, type:, voided_at:); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::CreditNote::Shape) } + def to_h; end + end + + class Customer < Orb::BaseModel + Shape = T.type_alias { {id: String, external_customer_id: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::Customer::Shape) } + def to_h; end + end + + class CustomerBalanceTransaction < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + action: Symbol, + amount: String, + created_at: Time, + credit_note: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::CreditNote), + description: T.nilable(String), + ending_balance: String, + invoice: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Invoice), + starting_balance: String, + type: Symbol + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :action + + sig { returns(String) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns(T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::CreditNote)) + end + attr_accessor :credit_note + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(String) } + attr_accessor :ending_balance + + sig do + returns(T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Invoice)) + end + attr_accessor :invoice + + sig { returns(String) } + attr_accessor :starting_balance + + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + id: String, + action: Symbol, + amount: String, + created_at: Time, + credit_note: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::CreditNote), + description: T.nilable(String), + ending_balance: String, + invoice: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Invoice), + starting_balance: String, + type: Symbol + ).void + end + def initialize( + id:, + action:, + amount:, + created_at:, + credit_note:, + description:, + ending_balance:, + invoice:, + starting_balance:, + type: + ); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Shape) } + def to_h; end + + class Action < Orb::Enum + abstract! + + APPLIED_TO_INVOICE = :applied_to_invoice + MANUAL_ADJUSTMENT = :manual_adjustment + PRORATED_REFUND = :prorated_refund + REVERT_PRORATED_REFUND = :revert_prorated_refund + RETURN_FROM_VOIDING = :return_from_voiding + CREDIT_NOTE_APPLIED = :credit_note_applied + CREDIT_NOTE_VOIDED = :credit_note_voided + OVERPAYMENT_REFUND = :overpayment_refund + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditNote < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::CreditNote::Shape) + end + def to_h; end + end + + class Invoice < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Invoice::Shape) + end + def to_h; end + end + + class Type < Orb::Enum + abstract! + + INCREMENT = :increment + DECREMENT = :decrement + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class CustomerTaxID < Orb::BaseModel + Shape = T.type_alias { {country: Symbol, type: Symbol, value: String} } + + sig { returns(Symbol) } + attr_accessor :country + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(String) } + attr_accessor :value + + sig { params(country: Symbol, type: Symbol, value: String).void } + def initialize(country:, type:, value:); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::Shape) } + def to_h; end + + class Country < Orb::Enum + abstract! + + AD = :AD + AE = :AE + AR = :AR + AT = :AT + AU = :AU + BE = :BE + BG = :BG + BH = :BH + BO = :BO + BR = :BR + CA = :CA + CH = :CH + CL = :CL + CN = :CN + CO = :CO + CR = :CR + CY = :CY + CZ = :CZ + DE = :DE + DK = :DK + EE = :EE + DO = :DO + EC = :EC + EG = :EG + ES = :ES + EU = :EU + FI = :FI + FR = :FR + GB = :GB + GE = :GE + GR = :GR + HK = :HK + HR = :HR + HU = :HU + ID = :ID + IE = :IE + IL = :IL + IN = :IN + IS = :IS + IT = :IT + JP = :JP + KE = :KE + KR = :KR + KZ = :KZ + LI = :LI + LT = :LT + LU = :LU + LV = :LV + MT = :MT + MX = :MX + MY = :MY + NG = :NG + NL = :NL + NO = :NO + NZ = :NZ + OM = :OM + PE = :PE + PH = :PH + PL = :PL + PT = :PT + RO = :RO + RS = :RS + RU = :RU + SA = :SA + SE = :SE + SG = :SG + SI = :SI + SK = :SK + SV = :SV + TH = :TH + TR = :TR + TW = :TW + UA = :UA + US = :US + UY = :UY + VE = :VE + VN = :VN + ZA = :ZA + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class Type < Orb::Enum + abstract! + + AD_NRT = :ad_nrt + AE_TRN = :ae_trn + AR_CUIT = :ar_cuit + EU_VAT = :eu_vat + AU_ABN = :au_abn + AU_ARN = :au_arn + BG_UIC = :bg_uic + BH_VAT = :bh_vat + BO_TIN = :bo_tin + BR_CNPJ = :br_cnpj + BR_CPF = :br_cpf + CA_BN = :ca_bn + CA_GST_HST = :ca_gst_hst + CA_PST_BC = :ca_pst_bc + CA_PST_MB = :ca_pst_mb + CA_PST_SK = :ca_pst_sk + CA_QST = :ca_qst + CH_VAT = :ch_vat + CL_TIN = :cl_tin + CN_TIN = :cn_tin + CO_NIT = :co_nit + CR_TIN = :cr_tin + DO_RCN = :do_rcn + EC_RUC = :ec_ruc + EG_TIN = :eg_tin + ES_CIF = :es_cif + EU_OSS_VAT = :eu_oss_vat + GB_VAT = :gb_vat + GE_VAT = :ge_vat + HK_BR = :hk_br + HU_TIN = :hu_tin + ID_NPWP = :id_npwp + IL_VAT = :il_vat + IN_GST = :in_gst + IS_VAT = :is_vat + JP_CN = :jp_cn + JP_RN = :jp_rn + JP_TRN = :jp_trn + KE_PIN = :ke_pin + KR_BRN = :kr_brn + KZ_BIN = :kz_bin + LI_UID = :li_uid + MX_RFC = :mx_rfc + MY_FRP = :my_frp + MY_ITN = :my_itn + MY_SST = :my_sst + NG_TIN = :ng_tin + NO_VAT = :no_vat + NO_VOEC = :no_voec + NZ_GST = :nz_gst + OM_VAT = :om_vat + PE_RUC = :pe_ruc + PH_TIN = :ph_tin + RO_TIN = :ro_tin + RS_PIB = :rs_pib + RU_INN = :ru_inn + RU_KPP = :ru_kpp + SA_VAT = :sa_vat + SG_GST = :sg_gst + SG_UEN = :sg_uen + SI_TIN = :si_tin + SV_NIT = :sv_nit + TH_VAT = :th_vat + TR_TIN = :tr_tin + TW_VAT = :tw_vat + UA_VAT = :ua_vat + US_EIN = :us_ein + UY_RUC = :uy_ruc + VE_RIF = :ve_rif + VN_TIN = :vn_tin + ZA_VAT = :za_vat + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoiceSource < Orb::Enum + abstract! + + SUBSCRIPTION = :subscription + PARTIAL = :partial + ONE_OFF = :one_off + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class LineItem < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjusted_subtotal: String, + adjustments: T::Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::Variants], + amount: String, + credits_applied: String, + discount: T.nilable(Orb::Models::Discount::Variants), + end_date: Time, + grouping: T.nilable(String), + maximum: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Maximum), + maximum_amount: T.nilable(String), + minimum: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Minimum), + minimum_amount: T.nilable(String), + name: String, + partially_invoiced_amount: String, + price: T.nilable(Orb::Models::Price::Variants), + quantity: Float, + start_date: Time, + sub_line_items: T::Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::Variants], + subtotal: String, + tax_amounts: T::Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::TaxAmount] + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :adjusted_subtotal + + sig { returns(T::Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::Variants]) } + attr_accessor :adjustments + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :credits_applied + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(Time) } + attr_accessor :end_date + + sig { returns(T.nilable(String)) } + attr_accessor :grouping + + sig { returns(T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(String) } + attr_accessor :name + + sig { returns(String) } + attr_accessor :partially_invoiced_amount + + sig { returns(T.nilable(Orb::Models::Price::Variants)) } + attr_accessor :price + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(T::Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::Variants]) } + attr_accessor :sub_line_items + + sig { returns(String) } + attr_accessor :subtotal + + sig { returns(T::Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::TaxAmount]) } + attr_accessor :tax_amounts + + sig do + params( + id: String, + adjusted_subtotal: String, + adjustments: T::Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::Variants], + amount: String, + credits_applied: String, + discount: T.nilable(Orb::Models::Discount::Variants), + end_date: Time, + grouping: T.nilable(String), + maximum: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Maximum), + maximum_amount: T.nilable(String), + minimum: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Minimum), + minimum_amount: T.nilable(String), + name: String, + partially_invoiced_amount: String, + price: T.nilable(Orb::Models::Price::Variants), + quantity: Float, + start_date: Time, + sub_line_items: T::Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::Variants], + subtotal: String, + tax_amounts: T::Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::TaxAmount] + ).void + end + def initialize( + id:, + adjusted_subtotal:, + adjustments:, + amount:, + credits_applied:, + discount:, + end_date:, + grouping:, + maximum:, + maximum_amount:, + minimum:, + minimum_amount:, + name:, + partially_invoiced_amount:, + price:, + quantity:, + start_date:, + sub_line_items:, + subtotal:, + tax_amounts: + ); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::AmountDiscountAdjustment, + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::PercentageDiscountAdjustment, + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::UsageDiscountAdjustment, + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::MinimumAdjustment, + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::MaximumAdjustment + ) + end + + class AmountDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + amount_discount:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + adjustment_type: :amount_discount + ); end + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::AmountDiscountAdjustment::Shape) + end + def to_h; end + end + + class PercentageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + percentage_discount:, + plan_phase_order:, + reason:, + adjustment_type: :percentage_discount + ); end + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::PercentageDiscountAdjustment::Shape) + end + def to_h; end + end + + class UsageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float, + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + usage_discount:, + adjustment_type: :usage_discount + ); end + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::UsageDiscountAdjustment::Shape) + end + def to_h; end + end + + class MinimumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + item_id:, + minimum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :minimum + ); end + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::MinimumAdjustment::Shape) + end + def to_h; end + end + + class MaximumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + maximum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :maximum + ); end + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::MaximumAdjustment::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::AmountDiscountAdjustment + ], + [ + Symbol, + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::PercentageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::UsageDiscountAdjustment + ], + [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::MinimumAdjustment], + [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::MaximumAdjustment] + ] + ) + end + private_class_method def self.variants; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Minimum::Shape) } + def to_h; end + end + + class SubLineItem < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem, + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem, + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem + ) + end + + class MatrixSubLineItem < Orb::BaseModel + Shape = T.type_alias do + { + amount: String, + grouping: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::Grouping), + matrix_config: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig, + name: String, + quantity: Float, + type: Symbol + } + end + + sig { returns(String) } + attr_accessor :amount + + sig do + returns(T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::Grouping)) + end + attr_accessor :grouping + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig) + end + attr_accessor :matrix_config + + sig { returns(String) } + attr_accessor :name + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + amount: String, + grouping: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::Grouping), + matrix_config: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig, + name: String, + quantity: Float, + type: Symbol + ).void + end + def initialize(amount:, grouping:, matrix_config:, name:, quantity:, type: :matrix); end + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::Shape) + end + def to_h; end + + class Grouping < Orb::BaseModel + Shape = T.type_alias { {key: String, value: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :key + + sig { returns(T.nilable(String)) } + attr_accessor :value + + sig { params(key: String, value: T.nilable(String)).void } + def initialize(key:, value:); end + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::Grouping::Shape) + end + def to_h; end + end + + class MatrixConfig < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[T.nilable(String)]} } + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimension_values + + sig { params(dimension_values: T::Array[T.nilable(String)]).void } + def initialize(dimension_values:); end + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig::Shape) + end + def to_h; end + end + end + + class TierSubLineItem < Orb::BaseModel + Shape = T.type_alias do + { + amount: String, + grouping: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::Grouping), + name: String, + quantity: Float, + tier_config: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::TierConfig, + type: Symbol + } + end + + sig { returns(String) } + attr_accessor :amount + + sig do + returns(T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::Grouping)) + end + attr_accessor :grouping + + sig { returns(String) } + attr_accessor :name + + sig { returns(Float) } + attr_accessor :quantity + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::TierConfig) + end + attr_accessor :tier_config + + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + amount: String, + grouping: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::Grouping), + name: String, + quantity: Float, + tier_config: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::TierConfig, + type: Symbol + ).void + end + def initialize(amount:, grouping:, name:, quantity:, tier_config:, type: :tier); end + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::Shape) + end + def to_h; end + + class Grouping < Orb::BaseModel + Shape = T.type_alias { {key: String, value: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :key + + sig { returns(T.nilable(String)) } + attr_accessor :value + + sig { params(key: String, value: T.nilable(String)).void } + def initialize(key:, value:); end + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::Grouping::Shape) + end + def to_h; end + end + + class TierConfig < Orb::BaseModel + Shape = T.type_alias { {first_unit: Float, last_unit: T.nilable(Float), unit_amount: String} } + + sig { returns(Float) } + attr_accessor :first_unit + + sig { returns(T.nilable(Float)) } + attr_accessor :last_unit + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(first_unit: Float, last_unit: T.nilable(Float), unit_amount: String).void } + def initialize(first_unit:, last_unit:, unit_amount:); end + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::TierConfig::Shape) + end + def to_h; end + end + end + + class OtherSubLineItem < Orb::BaseModel + Shape = T.type_alias do + { + amount: String, + grouping: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem::Grouping), + name: String, + quantity: Float, + type: Symbol + } + end + + sig { returns(String) } + attr_accessor :amount + + sig do + returns(T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem::Grouping)) + end + attr_accessor :grouping + + sig { returns(String) } + attr_accessor :name + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + amount: String, + grouping: T.nilable(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem::Grouping), + name: String, + quantity: Float, + type: Symbol + ).void + end + def initialize(amount:, grouping:, name:, quantity:, type: :"'null'"); end + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem::Shape) + end + def to_h; end + + class Grouping < Orb::BaseModel + Shape = T.type_alias { {key: String, value: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :key + + sig { returns(T.nilable(String)) } + attr_accessor :value + + sig { params(key: String, value: T.nilable(String)).void } + def initialize(key:, value:); end + + sig do + returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem::Grouping::Shape) + end + def to_h; end + end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem + ], + [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem], + [Symbol, Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem] + ] + ) + end + private_class_method def self.variants; end + end + + class TaxAmount < Orb::BaseModel + Shape = T.type_alias do + {amount: String, tax_rate_description: String, tax_rate_percentage: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :tax_rate_description + + sig { returns(T.nilable(String)) } + attr_accessor :tax_rate_percentage + + sig do + params(amount: String, tax_rate_description: String, tax_rate_percentage: T.nilable(String)).void + end + def initialize(amount:, tax_rate_description:, tax_rate_percentage:); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::LineItem::TaxAmount::Shape) } + def to_h; end + end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::Minimum::Shape) } + def to_h; end + end + + class PaymentAttempt < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + amount: String, + created_at: Time, + payment_provider: T.nilable(Symbol), + payment_provider_id: T.nilable(String), + succeeded: T::Boolean + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Symbol)) } + attr_accessor :payment_provider + + sig { returns(T.nilable(String)) } + attr_accessor :payment_provider_id + + sig { returns(T::Boolean) } + attr_accessor :succeeded + + sig do + params( + id: String, + amount: String, + created_at: Time, + payment_provider: T.nilable(Symbol), + payment_provider_id: T.nilable(String), + succeeded: T::Boolean + ).void + end + def initialize(id:, amount:, created_at:, payment_provider:, payment_provider_id:, succeeded:); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt::Shape) } + def to_h; end + + class PaymentProvider < Orb::Enum + abstract! + + STRIPE = T.let(:stripe, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class ShippingAddress < Orb::BaseModel + Shape = T.type_alias do + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + end + + sig { returns(T.nilable(String)) } + attr_accessor :city + + sig { returns(T.nilable(String)) } + attr_accessor :country + + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + sig { returns(T.nilable(String)) } + attr_accessor :state + + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).void + end + def initialize(city:, country:, line1:, line2:, postal_code:, state:); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::ShippingAddress::Shape) } + def to_h; end + end + + class Status < Orb::Enum + abstract! + + ISSUED = :issued + PAID = :paid + SYNCED = :synced + VOID = :void + DRAFT = :draft + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class Subscription < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::InvoiceFetchUpcomingResponse::Subscription::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/invoice_issue_params.rbi b/rbi/lib/orb/models/invoice_issue_params.rbi new file mode 100644 index 00000000..085c3824 --- /dev/null +++ b/rbi/lib/orb/models/invoice_issue_params.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Orb + module Models + class InvoiceIssueParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({synchronous: T::Boolean}, Orb::RequestParameters::Shape) } + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :synchronous + + sig { params(synchronous: T::Boolean).void } + attr_writer :synchronous + + sig { params(synchronous: T::Boolean, request_options: Orb::RequestOpts).void } + def initialize(synchronous: nil, request_options: {}); end + + sig { returns(Orb::Models::InvoiceIssueParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/invoice_level_discount.rbi b/rbi/lib/orb/models/invoice_level_discount.rbi new file mode 100644 index 00000000..7437baf9 --- /dev/null +++ b/rbi/lib/orb/models/invoice_level_discount.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Orb + module Models + class InvoiceLevelDiscount < Orb::Union + abstract! + + Variants = T.type_alias do + T.any(Orb::Models::PercentageDiscount, Orb::Models::AmountDiscount, Orb::Models::TrialDiscount) + end + + sig do + override.returns( + [ + [Symbol, Orb::Models::PercentageDiscount], + [Symbol, Orb::Models::AmountDiscount], + [Symbol, Orb::Models::TrialDiscount] + ] + ) + end + private_class_method def self.variants; end + end + end +end diff --git a/rbi/lib/orb/models/invoice_line_item_create_params.rbi b/rbi/lib/orb/models/invoice_line_item_create_params.rbi new file mode 100644 index 00000000..69d5eac7 --- /dev/null +++ b/rbi/lib/orb/models/invoice_line_item_create_params.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Orb + module Models + class InvoiceLineItemCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + amount: String, + end_date: Date, + invoice_id: String, + name: String, + quantity: Float, + start_date: Date + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(String) } + attr_accessor :amount + + sig { returns(Date) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :invoice_id + + sig { returns(String) } + attr_accessor :name + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Date) } + attr_accessor :start_date + + sig do + params( + amount: String, + end_date: Date, + invoice_id: String, + name: String, + quantity: Float, + start_date: Date, + request_options: Orb::RequestOpts + ).void + end + def initialize(amount:, end_date:, invoice_id:, name:, quantity:, start_date:, request_options: {}); end + + sig { returns(Orb::Models::InvoiceLineItemCreateParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/invoice_line_item_create_response.rbi b/rbi/lib/orb/models/invoice_line_item_create_response.rbi new file mode 100644 index 00000000..3811c747 --- /dev/null +++ b/rbi/lib/orb/models/invoice_line_item_create_response.rbi @@ -0,0 +1,790 @@ +# typed: strong + +module Orb + module Models + class InvoiceLineItemCreateResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjusted_subtotal: String, + adjustments: T::Array[Orb::Models::InvoiceLineItemCreateResponse::Adjustment::Variants], + amount: String, + credits_applied: String, + discount: T.nilable(Orb::Models::Discount::Variants), + end_date: Time, + grouping: T.nilable(String), + maximum: T.nilable(Orb::Models::InvoiceLineItemCreateResponse::Maximum), + maximum_amount: T.nilable(String), + minimum: T.nilable(Orb::Models::InvoiceLineItemCreateResponse::Minimum), + minimum_amount: T.nilable(String), + name: String, + partially_invoiced_amount: String, + price: T.nilable(Orb::Models::Price::Variants), + quantity: Float, + start_date: Time, + sub_line_items: T::Array[Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::Variants], + subtotal: String, + tax_amounts: T::Array[Orb::Models::InvoiceLineItemCreateResponse::TaxAmount] + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :adjusted_subtotal + + sig { returns(T::Array[Orb::Models::InvoiceLineItemCreateResponse::Adjustment::Variants]) } + attr_accessor :adjustments + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :credits_applied + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(Time) } + attr_accessor :end_date + + sig { returns(T.nilable(String)) } + attr_accessor :grouping + + sig { returns(T.nilable(Orb::Models::InvoiceLineItemCreateResponse::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Orb::Models::InvoiceLineItemCreateResponse::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(String) } + attr_accessor :name + + sig { returns(String) } + attr_accessor :partially_invoiced_amount + + sig { returns(T.nilable(Orb::Models::Price::Variants)) } + attr_accessor :price + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(T::Array[Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::Variants]) } + attr_accessor :sub_line_items + + sig { returns(String) } + attr_accessor :subtotal + + sig { returns(T::Array[Orb::Models::InvoiceLineItemCreateResponse::TaxAmount]) } + attr_accessor :tax_amounts + + sig do + params( + id: String, + adjusted_subtotal: String, + adjustments: T::Array[Orb::Models::InvoiceLineItemCreateResponse::Adjustment::Variants], + amount: String, + credits_applied: String, + discount: T.nilable(Orb::Models::Discount::Variants), + end_date: Time, + grouping: T.nilable(String), + maximum: T.nilable(Orb::Models::InvoiceLineItemCreateResponse::Maximum), + maximum_amount: T.nilable(String), + minimum: T.nilable(Orb::Models::InvoiceLineItemCreateResponse::Minimum), + minimum_amount: T.nilable(String), + name: String, + partially_invoiced_amount: String, + price: T.nilable(Orb::Models::Price::Variants), + quantity: Float, + start_date: Time, + sub_line_items: T::Array[Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::Variants], + subtotal: String, + tax_amounts: T::Array[Orb::Models::InvoiceLineItemCreateResponse::TaxAmount] + ).void + end + def initialize( + id:, + adjusted_subtotal:, + adjustments:, + amount:, + credits_applied:, + discount:, + end_date:, + grouping:, + maximum:, + maximum_amount:, + minimum:, + minimum_amount:, + name:, + partially_invoiced_amount:, + price:, + quantity:, + start_date:, + sub_line_items:, + subtotal:, + tax_amounts: + ); end + + sig { returns(Orb::Models::InvoiceLineItemCreateResponse::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::InvoiceLineItemCreateResponse::Adjustment::AmountDiscountAdjustment, + Orb::Models::InvoiceLineItemCreateResponse::Adjustment::PercentageDiscountAdjustment, + Orb::Models::InvoiceLineItemCreateResponse::Adjustment::UsageDiscountAdjustment, + Orb::Models::InvoiceLineItemCreateResponse::Adjustment::MinimumAdjustment, + Orb::Models::InvoiceLineItemCreateResponse::Adjustment::MaximumAdjustment + ) + end + + class AmountDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + amount_discount:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + adjustment_type: :amount_discount + ); end + + sig do + returns(Orb::Models::InvoiceLineItemCreateResponse::Adjustment::AmountDiscountAdjustment::Shape) + end + def to_h; end + end + + class PercentageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + percentage_discount:, + plan_phase_order:, + reason:, + adjustment_type: :percentage_discount + ); end + + sig do + returns(Orb::Models::InvoiceLineItemCreateResponse::Adjustment::PercentageDiscountAdjustment::Shape) + end + def to_h; end + end + + class UsageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float, + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + usage_discount:, + adjustment_type: :usage_discount + ); end + + sig do + returns(Orb::Models::InvoiceLineItemCreateResponse::Adjustment::UsageDiscountAdjustment::Shape) + end + def to_h; end + end + + class MinimumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + item_id:, + minimum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :minimum + ); end + + sig { returns(Orb::Models::InvoiceLineItemCreateResponse::Adjustment::MinimumAdjustment::Shape) } + def to_h; end + end + + class MaximumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + maximum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :maximum + ); end + + sig { returns(Orb::Models::InvoiceLineItemCreateResponse::Adjustment::MaximumAdjustment::Shape) } + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::InvoiceLineItemCreateResponse::Adjustment::AmountDiscountAdjustment + ], + [Symbol, Orb::Models::InvoiceLineItemCreateResponse::Adjustment::PercentageDiscountAdjustment], + [Symbol, Orb::Models::InvoiceLineItemCreateResponse::Adjustment::UsageDiscountAdjustment], + [Symbol, Orb::Models::InvoiceLineItemCreateResponse::Adjustment::MinimumAdjustment], + [Symbol, Orb::Models::InvoiceLineItemCreateResponse::Adjustment::MaximumAdjustment] + ] + ) + end + private_class_method def self.variants; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::InvoiceLineItemCreateResponse::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::InvoiceLineItemCreateResponse::Minimum::Shape) } + def to_h; end + end + + class SubLineItem < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem, + Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem, + Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem + ) + end + + class MatrixSubLineItem < Orb::BaseModel + Shape = T.type_alias do + { + amount: String, + grouping: T.nilable(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::Grouping), + matrix_config: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::MatrixConfig, + name: String, + quantity: Float, + type: Symbol + } + end + + sig { returns(String) } + attr_accessor :amount + + sig do + returns(T.nilable(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::Grouping)) + end + attr_accessor :grouping + + sig do + returns(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::MatrixConfig) + end + attr_accessor :matrix_config + + sig { returns(String) } + attr_accessor :name + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + amount: String, + grouping: T.nilable(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::Grouping), + matrix_config: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::MatrixConfig, + name: String, + quantity: Float, + type: Symbol + ).void + end + def initialize(amount:, grouping:, matrix_config:, name:, quantity:, type: :matrix); end + + sig { returns(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::Shape) } + def to_h; end + + class Grouping < Orb::BaseModel + Shape = T.type_alias { {key: String, value: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :key + + sig { returns(T.nilable(String)) } + attr_accessor :value + + sig { params(key: String, value: T.nilable(String)).void } + def initialize(key:, value:); end + + sig do + returns(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::Grouping::Shape) + end + def to_h; end + end + + class MatrixConfig < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[T.nilable(String)]} } + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimension_values + + sig { params(dimension_values: T::Array[T.nilable(String)]).void } + def initialize(dimension_values:); end + + sig do + returns(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::MatrixConfig::Shape) + end + def to_h; end + end + end + + class TierSubLineItem < Orb::BaseModel + Shape = T.type_alias do + { + amount: String, + grouping: T.nilable(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::Grouping), + name: String, + quantity: Float, + tier_config: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::TierConfig, + type: Symbol + } + end + + sig { returns(String) } + attr_accessor :amount + + sig do + returns(T.nilable(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::Grouping)) + end + attr_accessor :grouping + + sig { returns(String) } + attr_accessor :name + + sig { returns(Float) } + attr_accessor :quantity + + sig do + returns(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::TierConfig) + end + attr_accessor :tier_config + + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + amount: String, + grouping: T.nilable(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::Grouping), + name: String, + quantity: Float, + tier_config: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::TierConfig, + type: Symbol + ).void + end + def initialize(amount:, grouping:, name:, quantity:, tier_config:, type: :tier); end + + sig { returns(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::Shape) } + def to_h; end + + class Grouping < Orb::BaseModel + Shape = T.type_alias { {key: String, value: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :key + + sig { returns(T.nilable(String)) } + attr_accessor :value + + sig { params(key: String, value: T.nilable(String)).void } + def initialize(key:, value:); end + + sig do + returns(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::Grouping::Shape) + end + def to_h; end + end + + class TierConfig < Orb::BaseModel + Shape = T.type_alias { {first_unit: Float, last_unit: T.nilable(Float), unit_amount: String} } + + sig { returns(Float) } + attr_accessor :first_unit + + sig { returns(T.nilable(Float)) } + attr_accessor :last_unit + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(first_unit: Float, last_unit: T.nilable(Float), unit_amount: String).void } + def initialize(first_unit:, last_unit:, unit_amount:); end + + sig do + returns(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::TierConfig::Shape) + end + def to_h; end + end + end + + class OtherSubLineItem < Orb::BaseModel + Shape = T.type_alias do + { + amount: String, + grouping: T.nilable(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem::Grouping), + name: String, + quantity: Float, + type: Symbol + } + end + + sig { returns(String) } + attr_accessor :amount + + sig do + returns(T.nilable(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem::Grouping)) + end + attr_accessor :grouping + + sig { returns(String) } + attr_accessor :name + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + amount: String, + grouping: T.nilable(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem::Grouping), + name: String, + quantity: Float, + type: Symbol + ).void + end + def initialize(amount:, grouping:, name:, quantity:, type: :"'null'"); end + + sig { returns(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem::Shape) } + def to_h; end + + class Grouping < Orb::BaseModel + Shape = T.type_alias { {key: String, value: T.nilable(String)} } + + sig { returns(String) } + attr_accessor :key + + sig { returns(T.nilable(String)) } + attr_accessor :value + + sig { params(key: String, value: T.nilable(String)).void } + def initialize(key:, value:); end + + sig do + returns(Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem::Grouping::Shape) + end + def to_h; end + end + end + + sig do + override.returns( + [ + [Symbol, Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem], + [Symbol, Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem], + [Symbol, Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem] + ] + ) + end + private_class_method def self.variants; end + end + + class TaxAmount < Orb::BaseModel + Shape = T.type_alias do + {amount: String, tax_rate_description: String, tax_rate_percentage: T.nilable(String)} + end + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :tax_rate_description + + sig { returns(T.nilable(String)) } + attr_accessor :tax_rate_percentage + + sig do + params(amount: String, tax_rate_description: String, tax_rate_percentage: T.nilable(String)).void + end + def initialize(amount:, tax_rate_description:, tax_rate_percentage:); end + + sig { returns(Orb::Models::InvoiceLineItemCreateResponse::TaxAmount::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/invoice_list_params.rbi b/rbi/lib/orb/models/invoice_list_params.rbi new file mode 100644 index 00000000..d298c37b --- /dev/null +++ b/rbi/lib/orb/models/invoice_list_params.rbi @@ -0,0 +1,170 @@ +# typed: strong + +module Orb + module Models + class InvoiceListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + amount: T.nilable(String), + amount_gt: T.nilable(String), + amount_lt: T.nilable(String), + cursor: T.nilable(String), + customer_id: T.nilable(String), + date_type: T.nilable(Symbol), + due_date: T.nilable(Date), + due_date_window: T.nilable(String), + due_date_gt: T.nilable(Date), + due_date_lt: T.nilable(Date), + external_customer_id: T.nilable(String), + invoice_date_gt: T.nilable(Time), + invoice_date_gte: T.nilable(Time), + invoice_date_lt: T.nilable(Time), + invoice_date_lte: T.nilable(Time), + is_recurring: T.nilable(T::Boolean), + limit: Integer, + status: T.nilable(T::Array[Symbol]), + subscription_id: T.nilable(String) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :amount + + sig { returns(T.nilable(String)) } + attr_accessor :amount_gt + + sig { returns(T.nilable(String)) } + attr_accessor :amount_lt + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(String)) } + attr_accessor :customer_id + + sig { returns(T.nilable(Symbol)) } + attr_accessor :date_type + + sig { returns(T.nilable(Date)) } + attr_accessor :due_date + + sig { returns(T.nilable(String)) } + attr_accessor :due_date_window + + sig { returns(T.nilable(Date)) } + attr_accessor :due_date_gt + + sig { returns(T.nilable(Date)) } + attr_accessor :due_date_lt + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { returns(T.nilable(Time)) } + attr_accessor :invoice_date_gt + + sig { returns(T.nilable(Time)) } + attr_accessor :invoice_date_gte + + sig { returns(T.nilable(Time)) } + attr_accessor :invoice_date_lt + + sig { returns(T.nilable(Time)) } + attr_accessor :invoice_date_lte + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :is_recurring + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { returns(T.nilable(T::Array[Symbol])) } + attr_accessor :status + + sig { returns(T.nilable(String)) } + attr_accessor :subscription_id + + sig do + params( + amount: T.nilable(String), + amount_gt: T.nilable(String), + amount_lt: T.nilable(String), + cursor: T.nilable(String), + customer_id: T.nilable(String), + date_type: T.nilable(Symbol), + due_date: T.nilable(Date), + due_date_window: T.nilable(String), + due_date_gt: T.nilable(Date), + due_date_lt: T.nilable(Date), + external_customer_id: T.nilable(String), + invoice_date_gt: T.nilable(Time), + invoice_date_gte: T.nilable(Time), + invoice_date_lt: T.nilable(Time), + invoice_date_lte: T.nilable(Time), + is_recurring: T.nilable(T::Boolean), + limit: Integer, + status: T.nilable(T::Array[Symbol]), + subscription_id: T.nilable(String), + request_options: Orb::RequestOpts + ).void + end + def initialize( + amount: nil, + amount_gt: nil, + amount_lt: nil, + cursor: nil, + customer_id: nil, + date_type: nil, + due_date: nil, + due_date_window: nil, + due_date_gt: nil, + due_date_lt: nil, + external_customer_id: nil, + invoice_date_gt: nil, + invoice_date_gte: nil, + invoice_date_lt: nil, + invoice_date_lte: nil, + is_recurring: nil, + limit: nil, + status: nil, + subscription_id: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::InvoiceListParams::Shape) } + def to_h; end + + class DateType < Orb::Enum + abstract! + + DUE_DATE = T.let(:due_date, T.nilable(Symbol)) + INVOICE_DATE = T.let(:invoice_date, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class Status < Orb::Enum + abstract! + + DRAFT = :draft + ISSUED = :issued + PAID = :paid + SYNCED = :synced + VOID = :void + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end +end diff --git a/rbi/lib/orb/models/invoice_mark_paid_params.rbi b/rbi/lib/orb/models/invoice_mark_paid_params.rbi new file mode 100644 index 00000000..9686b62e --- /dev/null +++ b/rbi/lib/orb/models/invoice_mark_paid_params.rbi @@ -0,0 +1,39 @@ +# typed: strong + +module Orb + module Models + class InvoiceMarkPaidParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + {payment_received_date: Date, external_id: T.nilable(String), notes: T.nilable(String)}, + Orb::RequestParameters::Shape + ) + end + + sig { returns(Date) } + attr_accessor :payment_received_date + + sig { returns(T.nilable(String)) } + attr_accessor :external_id + + sig { returns(T.nilable(String)) } + attr_accessor :notes + + sig do + params( + payment_received_date: Date, + external_id: T.nilable(String), + notes: T.nilable(String), + request_options: Orb::RequestOpts + ).void + end + def initialize(payment_received_date:, external_id: nil, notes: nil, request_options: {}); end + + sig { returns(Orb::Models::InvoiceMarkPaidParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/invoice_pay_params.rbi b/rbi/lib/orb/models/invoice_pay_params.rbi new file mode 100644 index 00000000..809a0cbe --- /dev/null +++ b/rbi/lib/orb/models/invoice_pay_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class InvoicePayParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::InvoicePayParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/invoice_update_params.rbi b/rbi/lib/orb/models/invoice_update_params.rbi new file mode 100644 index 00000000..430dd4ef --- /dev/null +++ b/rbi/lib/orb/models/invoice_update_params.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Orb + module Models + class InvoiceUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all({metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])}, Orb::RequestParameters::Shape) + end + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).void + end + def initialize(metadata: nil, request_options: {}); end + + sig { returns(Orb::Models::InvoiceUpdateParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/invoice_void_params.rbi b/rbi/lib/orb/models/invoice_void_params.rbi new file mode 100644 index 00000000..10f53ba0 --- /dev/null +++ b/rbi/lib/orb/models/invoice_void_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class InvoiceVoidParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::InvoiceVoidParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/item.rbi b/rbi/lib/orb/models/item.rbi new file mode 100644 index 00000000..855105d4 --- /dev/null +++ b/rbi/lib/orb/models/item.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module Orb + module Models + class Item < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + created_at: Time, + external_connections: T::Array[Orb::Models::Item::ExternalConnection], + name: String + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T::Array[Orb::Models::Item::ExternalConnection]) } + attr_accessor :external_connections + + sig { returns(String) } + attr_accessor :name + + sig do + params( + id: String, + created_at: Time, + external_connections: T::Array[Orb::Models::Item::ExternalConnection], + name: String + ).void + end + def initialize(id:, created_at:, external_connections:, name:); end + + sig { returns(Orb::Models::Item::Shape) } + def to_h; end + + class ExternalConnection < Orb::BaseModel + Shape = T.type_alias { {external_connection_name: Symbol, external_entity_id: String} } + + sig { returns(Symbol) } + attr_accessor :external_connection_name + + sig { returns(String) } + attr_accessor :external_entity_id + + sig { params(external_connection_name: Symbol, external_entity_id: String).void } + def initialize(external_connection_name:, external_entity_id:); end + + sig { returns(Orb::Models::Item::ExternalConnection::Shape) } + def to_h; end + + class ExternalConnectionName < Orb::Enum + abstract! + + STRIPE = :stripe + QUICKBOOKS = :quickbooks + BILL_COM = :"bill.com" + NETSUITE = :netsuite + TAXJAR = :taxjar + AVALARA = :avalara + ANROK = :anrok + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/item_create_params.rbi b/rbi/lib/orb/models/item_create_params.rbi new file mode 100644 index 00000000..32bea588 --- /dev/null +++ b/rbi/lib/orb/models/item_create_params.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Orb + module Models + class ItemCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({name: String}, Orb::RequestParameters::Shape) } + + sig { returns(String) } + attr_accessor :name + + sig { params(name: String, request_options: Orb::RequestOpts).void } + def initialize(name:, request_options: {}); end + + sig { returns(Orb::Models::ItemCreateParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/item_fetch_params.rbi b/rbi/lib/orb/models/item_fetch_params.rbi new file mode 100644 index 00000000..ed066929 --- /dev/null +++ b/rbi/lib/orb/models/item_fetch_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class ItemFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::ItemFetchParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/item_list_params.rbi b/rbi/lib/orb/models/item_list_params.rbi new file mode 100644 index 00000000..9a19eede --- /dev/null +++ b/rbi/lib/orb/models/item_list_params.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Orb + module Models + class ItemListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all({cursor: T.nilable(String), limit: Integer}, Orb::RequestParameters::Shape) + end + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { params(cursor: T.nilable(String), limit: Integer, request_options: Orb::RequestOpts).void } + def initialize(cursor: nil, limit: nil, request_options: {}); end + + sig { returns(Orb::Models::ItemListParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/item_update_params.rbi b/rbi/lib/orb/models/item_update_params.rbi new file mode 100644 index 00000000..2a9e845b --- /dev/null +++ b/rbi/lib/orb/models/item_update_params.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Orb + module Models + class ItemUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + external_connections: T.nilable(T::Array[Orb::Models::ItemUpdateParams::ExternalConnection]), + name: T.nilable(String) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(T::Array[Orb::Models::ItemUpdateParams::ExternalConnection])) } + attr_accessor :external_connections + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig do + params( + external_connections: T.nilable(T::Array[Orb::Models::ItemUpdateParams::ExternalConnection]), + name: T.nilable(String), + request_options: Orb::RequestOpts + ).void + end + def initialize(external_connections: nil, name: nil, request_options: {}); end + + sig { returns(Orb::Models::ItemUpdateParams::Shape) } + def to_h; end + + class ExternalConnection < Orb::BaseModel + Shape = T.type_alias { {external_connection_name: Symbol, external_entity_id: String} } + + sig { returns(Symbol) } + attr_accessor :external_connection_name + + sig { returns(String) } + attr_accessor :external_entity_id + + sig { params(external_connection_name: Symbol, external_entity_id: String).void } + def initialize(external_connection_name:, external_entity_id:); end + + sig { returns(Orb::Models::ItemUpdateParams::ExternalConnection::Shape) } + def to_h; end + + class ExternalConnectionName < Orb::Enum + abstract! + + STRIPE = :stripe + QUICKBOOKS = :quickbooks + BILL_COM = :"bill.com" + NETSUITE = :netsuite + TAXJAR = :taxjar + AVALARA = :avalara + ANROK = :anrok + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/metric_create_params.rbi b/rbi/lib/orb/models/metric_create_params.rbi new file mode 100644 index 00000000..3a3e4816 --- /dev/null +++ b/rbi/lib/orb/models/metric_create_params.rbi @@ -0,0 +1,53 @@ +# typed: strong + +module Orb + module Models + class MetricCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + description: T.nilable(String), + item_id: String, + name: String, + sql: String, + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :name + + sig { returns(String) } + attr_accessor :sql + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + description: T.nilable(String), + item_id: String, + name: String, + sql: String, + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).void + end + def initialize(description:, item_id:, name:, sql:, metadata: nil, request_options: {}); end + + sig { returns(Orb::Models::MetricCreateParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/metric_fetch_params.rbi b/rbi/lib/orb/models/metric_fetch_params.rbi new file mode 100644 index 00000000..531c7fb0 --- /dev/null +++ b/rbi/lib/orb/models/metric_fetch_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class MetricFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::MetricFetchParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/metric_list_params.rbi b/rbi/lib/orb/models/metric_list_params.rbi new file mode 100644 index 00000000..fd36599a --- /dev/null +++ b/rbi/lib/orb/models/metric_list_params.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Orb + module Models + class MetricListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + cursor: T.nilable(String), + limit: Integer + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_gt + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_gte + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_lt + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_lte + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig do + params( + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + cursor: T.nilable(String), + limit: Integer, + request_options: Orb::RequestOpts + ).void + end + def initialize( + created_at_gt: nil, + created_at_gte: nil, + created_at_lt: nil, + created_at_lte: nil, + cursor: nil, + limit: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::MetricListParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/metric_update_params.rbi b/rbi/lib/orb/models/metric_update_params.rbi new file mode 100644 index 00000000..6c3aa551 --- /dev/null +++ b/rbi/lib/orb/models/metric_update_params.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Orb + module Models + class MetricUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all({metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])}, Orb::RequestParameters::Shape) + end + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).void + end + def initialize(metadata: nil, request_options: {}); end + + sig { returns(Orb::Models::MetricUpdateParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/pagination_metadata.rbi b/rbi/lib/orb/models/pagination_metadata.rbi new file mode 100644 index 00000000..168b5097 --- /dev/null +++ b/rbi/lib/orb/models/pagination_metadata.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Orb + module Models + class PaginationMetadata < Orb::BaseModel + Shape = T.type_alias { {has_more: T::Boolean, next_cursor: T.nilable(String)} } + + sig { returns(T::Boolean) } + attr_accessor :has_more + + sig { returns(T.nilable(String)) } + attr_accessor :next_cursor + + sig { params(has_more: T::Boolean, next_cursor: T.nilable(String)).void } + def initialize(has_more:, next_cursor:); end + + sig { returns(Orb::Models::PaginationMetadata::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/percentage_discount.rbi b/rbi/lib/orb/models/percentage_discount.rbi new file mode 100644 index 00000000..a9147317 --- /dev/null +++ b/rbi/lib/orb/models/percentage_discount.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Orb + module Models + class PercentageDiscount < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + discount_type: Symbol, + percentage_discount: Float, + reason: T.nilable(String) + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + applies_to_price_ids: T::Array[String], + discount_type: Symbol, + percentage_discount: Float, + reason: T.nilable(String) + ).void + end + def initialize(applies_to_price_ids:, discount_type:, percentage_discount:, reason: nil); end + + sig { returns(Orb::Models::PercentageDiscount::Shape) } + def to_h; end + + class DiscountType < Orb::Enum + abstract! + + PERCENTAGE = :percentage + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end +end diff --git a/rbi/lib/orb/models/plan.rbi b/rbi/lib/orb/models/plan.rbi new file mode 100644 index 00000000..2859a0d1 --- /dev/null +++ b/rbi/lib/orb/models/plan.rbi @@ -0,0 +1,732 @@ +# typed: strong + +module Orb + module Models + class Plan < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustments: T::Array[Orb::Models::Plan::Adjustment::Variants], + base_plan: T.nilable(Orb::Models::Plan::BasePlan), + base_plan_id: T.nilable(String), + created_at: Time, + currency: String, + default_invoice_memo: T.nilable(String), + description: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_plan_id: T.nilable(String), + invoicing_currency: String, + maximum: T.nilable(Orb::Models::Plan::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Plan::Minimum), + minimum_amount: T.nilable(String), + name: String, + net_terms: T.nilable(Integer), + plan_phases: T.nilable(T::Array[Orb::Models::Plan::PlanPhase]), + prices: T::Array[Orb::Models::Price::Variants], + product: Orb::Models::Plan::Product, + status: Symbol, + trial_config: Orb::Models::Plan::TrialConfig, + version: Integer + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T::Array[Orb::Models::Plan::Adjustment::Variants]) } + attr_accessor :adjustments + + sig { returns(T.nilable(Orb::Models::Plan::BasePlan)) } + attr_accessor :base_plan + + sig { returns(T.nilable(String)) } + attr_accessor :base_plan_id + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :default_invoice_memo + + sig { returns(String) } + attr_accessor :description + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_plan_id + + sig { returns(String) } + attr_accessor :invoicing_currency + + sig { returns(T.nilable(Orb::Models::Plan::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Plan::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :net_terms + + sig { returns(T.nilable(T::Array[Orb::Models::Plan::PlanPhase])) } + attr_accessor :plan_phases + + sig { returns(T::Array[Orb::Models::Price::Variants]) } + attr_accessor :prices + + sig { returns(Orb::Models::Plan::Product) } + attr_accessor :product + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Orb::Models::Plan::TrialConfig) } + attr_accessor :trial_config + + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + id: String, + adjustments: T::Array[Orb::Models::Plan::Adjustment::Variants], + base_plan: T.nilable(Orb::Models::Plan::BasePlan), + base_plan_id: T.nilable(String), + created_at: Time, + currency: String, + default_invoice_memo: T.nilable(String), + description: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_plan_id: T.nilable(String), + invoicing_currency: String, + maximum: T.nilable(Orb::Models::Plan::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Plan::Minimum), + minimum_amount: T.nilable(String), + name: String, + net_terms: T.nilable(Integer), + plan_phases: T.nilable(T::Array[Orb::Models::Plan::PlanPhase]), + prices: T::Array[Orb::Models::Price::Variants], + product: Orb::Models::Plan::Product, + status: Symbol, + trial_config: Orb::Models::Plan::TrialConfig, + version: Integer + ).void + end + def initialize( + id:, + adjustments:, + base_plan:, + base_plan_id:, + created_at:, + currency:, + default_invoice_memo:, + description:, + discount:, + external_plan_id:, + invoicing_currency:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + net_terms:, + plan_phases:, + prices:, + product:, + status:, + trial_config:, + version: + ); end + + sig { returns(Orb::Models::Plan::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::Plan::Adjustment::AmountDiscountAdjustment, + Orb::Models::Plan::Adjustment::PercentageDiscountAdjustment, + Orb::Models::Plan::Adjustment::UsageDiscountAdjustment, + Orb::Models::Plan::Adjustment::MinimumAdjustment, + Orb::Models::Plan::Adjustment::MaximumAdjustment + ) + end + + class AmountDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + amount_discount:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + adjustment_type: :amount_discount + ); end + + sig { returns(Orb::Models::Plan::Adjustment::AmountDiscountAdjustment::Shape) } + def to_h; end + end + + class PercentageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + percentage_discount:, + plan_phase_order:, + reason:, + adjustment_type: :percentage_discount + ); end + + sig { returns(Orb::Models::Plan::Adjustment::PercentageDiscountAdjustment::Shape) } + def to_h; end + end + + class UsageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float, + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + usage_discount:, + adjustment_type: :usage_discount + ); end + + sig { returns(Orb::Models::Plan::Adjustment::UsageDiscountAdjustment::Shape) } + def to_h; end + end + + class MinimumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + item_id:, + minimum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :minimum + ); end + + sig { returns(Orb::Models::Plan::Adjustment::MinimumAdjustment::Shape) } + def to_h; end + end + + class MaximumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + maximum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :maximum + ); end + + sig { returns(Orb::Models::Plan::Adjustment::MaximumAdjustment::Shape) } + def to_h; end + end + + sig do + override.returns( + [ + [Symbol, Orb::Models::Plan::Adjustment::AmountDiscountAdjustment], + [Symbol, Orb::Models::Plan::Adjustment::PercentageDiscountAdjustment], + [Symbol, Orb::Models::Plan::Adjustment::UsageDiscountAdjustment], + [Symbol, Orb::Models::Plan::Adjustment::MinimumAdjustment], + [Symbol, Orb::Models::Plan::Adjustment::MaximumAdjustment] + ] + ) + end + private_class_method def self.variants; end + end + + class BasePlan < Orb::BaseModel + Shape = T.type_alias do + {id: T.nilable(String), external_plan_id: T.nilable(String), name: T.nilable(String)} + end + + sig { returns(T.nilable(String)) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_plan_id + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig do + params(id: T.nilable(String), external_plan_id: T.nilable(String), name: T.nilable(String)).void + end + def initialize(id:, external_plan_id:, name:); end + + sig { returns(Orb::Models::Plan::BasePlan::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Plan::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Plan::Minimum::Shape) } + def to_h; end + end + + class PlanPhase < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + description: T.nilable(String), + discount: T.nilable(Orb::Models::Discount::Variants), + duration: T.nilable(Integer), + duration_unit: T.nilable(Symbol), + maximum: T.nilable(Orb::Models::Plan::PlanPhase::Maximum), + maximum_amount: T.nilable(String), + minimum: T.nilable(Orb::Models::Plan::PlanPhase::Minimum), + minimum_amount: T.nilable(String), + name: String, + order: Integer + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :duration + + sig { returns(T.nilable(Symbol)) } + attr_accessor :duration_unit + + sig { returns(T.nilable(Orb::Models::Plan::PlanPhase::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Orb::Models::Plan::PlanPhase::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(String) } + attr_accessor :name + + sig { returns(Integer) } + attr_accessor :order + + sig do + params( + id: String, + description: T.nilable(String), + discount: T.nilable(Orb::Models::Discount::Variants), + duration: T.nilable(Integer), + duration_unit: T.nilable(Symbol), + maximum: T.nilable(Orb::Models::Plan::PlanPhase::Maximum), + maximum_amount: T.nilable(String), + minimum: T.nilable(Orb::Models::Plan::PlanPhase::Minimum), + minimum_amount: T.nilable(String), + name: String, + order: Integer + ).void + end + def initialize( + id:, + description:, + discount:, + duration:, + duration_unit:, + maximum:, + maximum_amount:, + minimum:, + minimum_amount:, + name:, + order: + ); end + + sig { returns(Orb::Models::Plan::PlanPhase::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAILY = T.let(:daily, T.nilable(Symbol)) + MONTHLY = T.let(:monthly, T.nilable(Symbol)) + QUARTERLY = T.let(:quarterly, T.nilable(Symbol)) + SEMI_ANNUAL = T.let(:semi_annual, T.nilable(Symbol)) + ANNUAL = T.let(:annual, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Plan::PlanPhase::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Plan::PlanPhase::Minimum::Shape) } + def to_h; end + end + end + + class Product < Orb::BaseModel + Shape = T.type_alias { {id: String, created_at: Time, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, created_at: Time, name: String).void } + def initialize(id:, created_at:, name:); end + + sig { returns(Orb::Models::Plan::Product::Shape) } + def to_h; end + end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + ARCHIVED = :archived + DRAFT = :draft + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TrialConfig < Orb::BaseModel + Shape = T.type_alias { {trial_period: T.nilable(Integer), trial_period_unit: Symbol} } + + sig { returns(T.nilable(Integer)) } + attr_accessor :trial_period + + sig { returns(Symbol) } + attr_accessor :trial_period_unit + + sig { params(trial_period: T.nilable(Integer), trial_period_unit: Symbol).void } + def initialize(trial_period:, trial_period_unit:); end + + sig { returns(Orb::Models::Plan::TrialConfig::Shape) } + def to_h; end + + class TrialPeriodUnit < Orb::Enum + abstract! + + DAYS = :days + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/plan_create_params.rbi b/rbi/lib/orb/models/plan_create_params.rbi new file mode 100644 index 00000000..628c62ba --- /dev/null +++ b/rbi/lib/orb/models/plan_create_params.rbi @@ -0,0 +1,4784 @@ +# typed: strong + +module Orb + module Models + class PlanCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + currency: String, + name: String, + prices: T::Array[Orb::Models::PlanCreateParams::Price::Variants], + default_invoice_memo: T.nilable(String), + external_plan_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + net_terms: T.nilable(Integer), + status: Symbol + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Array[Orb::Models::PlanCreateParams::Price::Variants]) } + attr_accessor :prices + + sig { returns(T.nilable(String)) } + attr_accessor :default_invoice_memo + + sig { returns(T.nilable(String)) } + attr_accessor :external_plan_id + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(Integer)) } + attr_accessor :net_terms + + sig { returns(T.nilable(Symbol)) } + attr_reader :status + + sig { params(status: Symbol).void } + attr_writer :status + + sig do + params( + currency: String, + name: String, + prices: T::Array[Orb::Models::PlanCreateParams::Price::Variants], + default_invoice_memo: T.nilable(String), + external_plan_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + net_terms: T.nilable(Integer), + status: Symbol, + request_options: Orb::RequestOpts + ).void + end + def initialize( + currency:, + name:, + prices:, + default_invoice_memo: nil, + external_plan_id: nil, + metadata: nil, + net_terms: nil, + status: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::PlanCreateParams::Shape) } + def to_h; end + + class Price < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice, + Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice, + Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice, + Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice, + Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice, + Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice, + Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice, + Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice, + Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice, + Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice, + Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice, + Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice, + Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice, + Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice, + Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice, + Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice, + Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice, + Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice, + Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice, + Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice, + Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice, + Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice, + Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice, + Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice + ) + end + + class NewPlanUnitPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + unit_config: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::UnitConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::UnitConfig) } + attr_accessor :unit_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + unit_config: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::UnitConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + unit_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :unit + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class UnitConfig < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(unit_amount: String).void } + def initialize(unit_amount:); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::UnitConfig::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + package_config: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::PackageConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::PackageConfig) } + attr_accessor :package_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + package_config: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::PackageConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + package_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :package + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class PackageConfig < Orb::BaseModel + Shape = T.type_alias { {package_amount: String, package_size: Integer} } + + sig { returns(String) } + attr_accessor :package_amount + + sig { returns(Integer) } + attr_accessor :package_size + + sig { params(package_amount: String, package_size: Integer).void } + def initialize(package_amount:, package_size:); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::PackageConfig::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanMatrixPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + matrix_config: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig) } + attr_accessor :matrix_config + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + item_id: String, + matrix_config: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + matrix_config:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :matrix + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class MatrixConfig < Orb::BaseModel + Shape = T.type_alias do + { + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig::MatrixValue] + } + end + + sig { returns(String) } + attr_accessor :default_unit_amount + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimensions + + sig do + returns(T::Array[Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig::MatrixValue]) + end + attr_accessor :matrix_values + + sig do + params( + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig::MatrixValue] + ).void + end + def initialize(default_unit_amount:, dimensions:, matrix_values:); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig::Shape) } + def to_h; end + + class MatrixValue < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[T.nilable(String)], unit_amount: String} } + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(dimension_values: T::Array[T.nilable(String)], unit_amount: String).void } + def initialize(dimension_values:, unit_amount:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig::MatrixValue::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanTieredPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_config: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig) } + attr_accessor :tiered_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_config: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :tiered + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TieredConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig::Tier]) + end + attr_accessor :tiers + + sig do + params(tiers: T::Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig::Tier]).void + end + def initialize(tiers:); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig::Shape) } + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias { {first_unit: Float, unit_amount: String, last_unit: T.nilable(Float)} } + + sig { returns(Float) } + attr_accessor :first_unit + + sig { returns(String) } + attr_accessor :unit_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :last_unit + + sig { params(first_unit: Float, unit_amount: String, last_unit: T.nilable(Float)).void } + def initialize(first_unit:, unit_amount:, last_unit: nil); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig::Tier::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanTieredBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_bps_config: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig) } + attr_accessor :tiered_bps_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_bps_config: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_bps_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :tiered_bps + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TieredBpsConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias do + { + bps: Float, + minimum_amount: String, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + } + end + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig do + params( + bps: Float, + minimum_amount: String, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + ).void + end + def initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig::Tier::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + bps_config: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BpsConfig, + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BpsConfig) } + attr_accessor :bps_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + bps_config: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BpsConfig, + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + bps_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :bps + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::Shape) } + def to_h; end + + class BpsConfig < Orb::BaseModel + Shape = T.type_alias { {bps: Float, per_unit_maximum: T.nilable(String)} } + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig { params(bps: Float, per_unit_maximum: T.nilable(String)).void } + def initialize(bps:, per_unit_maximum: nil); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BpsConfig::Shape) } + def to_h; end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanBulkBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_bps_config: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig, + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig) } + attr_accessor :bulk_bps_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + bulk_bps_config: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig, + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + bulk_bps_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :bulk_bps + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::Shape) } + def to_h; end + + class BulkBpsConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig::Tier]) + end + attr_accessor :tiers + + sig do + params(tiers: T::Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig::Tier]).void + end + def initialize(tiers:); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig::Shape) } + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias do + {bps: Float, maximum_amount: T.nilable(String), per_unit_maximum: T.nilable(String)} + end + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig do + params( + bps: Float, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + ).void + end + def initialize(bps:, maximum_amount: nil, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig::Tier::Shape) + end + def to_h; end + end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanBulkPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_config: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig, + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig) } + attr_accessor :bulk_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + bulk_config: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig, + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + bulk_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :bulk + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::Shape) } + def to_h; end + + class BulkConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig::Tier]) + end + attr_accessor :tiers + + sig do + params(tiers: T::Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig::Tier]).void + end + def initialize(tiers:); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig::Shape) } + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String, maximum_units: T.nilable(Float)} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :maximum_units + + sig { params(unit_amount: String, maximum_units: T.nilable(Float)).void } + def initialize(unit_amount:, maximum_units: nil); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig::Tier::Shape) } + def to_h; end + end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanThresholdTotalAmountPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :threshold_total_amount_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + threshold_total_amount_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :threshold_total_amount + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanTieredPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_package_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_package_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_package_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_package_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :tiered_package + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanTieredWithMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_with_minimum_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_with_minimum_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :tiered_with_minimum + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanUnitWithPercentPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + unit_with_percent_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :unit_with_percent_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + unit_with_percent_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + unit_with_percent_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :unit_with_percent + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanPackageWithAllocationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + package_with_allocation_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :package_with_allocation_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + package_with_allocation_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + package_with_allocation_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :package_with_allocation + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanTierWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_with_proration_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_with_proration_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :tiered_with_proration + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanUnitWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + unit_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :unit_with_proration_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + unit_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + unit_with_proration_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :unit_with_proration + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanGroupedAllocationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + grouped_allocation_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_allocation_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + grouped_allocation_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + grouped_allocation_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :grouped_allocation + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanGroupedWithProratedMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_with_prorated_minimum_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + grouped_with_prorated_minimum_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :grouped_with_prorated_minimum + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanGroupedWithMeteredMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_with_metered_minimum_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + grouped_with_metered_minimum_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :grouped_with_metered_minimum + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanMatrixWithDisplayNamePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + matrix_with_display_name_config: T::Hash[Symbol, T.anything], + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :matrix_with_display_name_config + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + item_id: String, + matrix_with_display_name_config: T::Hash[Symbol, T.anything], + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + matrix_with_display_name_config:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :matrix_with_display_name + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanBulkWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_with_proration_config: T::Hash[Symbol, T.anything], + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :bulk_with_proration_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + bulk_with_proration_config: T::Hash[Symbol, T.anything], + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + bulk_with_proration_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :bulk_with_proration + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanGroupedTieredPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + grouped_tiered_package_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_tiered_package_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + grouped_tiered_package_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + grouped_tiered_package_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :grouped_tiered_package + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanMaxGroupTieredPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + max_group_tiered_package_config: T::Hash[Symbol, T.anything], + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :max_group_tiered_package_config + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + item_id: String, + max_group_tiered_package_config: T::Hash[Symbol, T.anything], + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + max_group_tiered_package_config:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :max_group_tiered_package + ); end + + sig { returns(Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanScalableMatrixWithUnitPricingPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + scalable_matrix_with_unit_pricing_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :scalable_matrix_with_unit_pricing_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + scalable_matrix_with_unit_pricing_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + scalable_matrix_with_unit_pricing_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :scalable_matrix_with_unit_pricing + ); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewPlanScalableMatrixWithTieredPricingPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + scalable_matrix_with_tiered_pricing_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :scalable_matrix_with_tiered_pricing_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + scalable_matrix_with_tiered_pricing_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + scalable_matrix_with_tiered_pricing_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :scalable_matrix_with_tiered_pricing + ); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + sig do + override.returns( + [ + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice], + [Symbol, Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice] + ] + ) + end + private_class_method def self.variants; end + end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + DRAFT = :draft + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end +end diff --git a/rbi/lib/orb/models/plan_fetch_params.rbi b/rbi/lib/orb/models/plan_fetch_params.rbi new file mode 100644 index 00000000..68d9efd5 --- /dev/null +++ b/rbi/lib/orb/models/plan_fetch_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class PlanFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::PlanFetchParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/plan_list_params.rbi b/rbi/lib/orb/models/plan_list_params.rbi new file mode 100644 index 00000000..57acfa7b --- /dev/null +++ b/rbi/lib/orb/models/plan_list_params.rbi @@ -0,0 +1,89 @@ +# typed: strong + +module Orb + module Models + class PlanListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + cursor: T.nilable(String), + limit: Integer, + status: Symbol + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_gt + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_gte + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_lt + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_lte + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { returns(T.nilable(Symbol)) } + attr_reader :status + + sig { params(status: Symbol).void } + attr_writer :status + + sig do + params( + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + cursor: T.nilable(String), + limit: Integer, + status: Symbol, + request_options: Orb::RequestOpts + ).void + end + def initialize( + created_at_gt: nil, + created_at_gte: nil, + created_at_lt: nil, + created_at_lte: nil, + cursor: nil, + limit: nil, + status: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::PlanListParams::Shape) } + def to_h; end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + ARCHIVED = :archived + DRAFT = :draft + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end +end diff --git a/rbi/lib/orb/models/plan_update_params.rbi b/rbi/lib/orb/models/plan_update_params.rbi new file mode 100644 index 00000000..add2e870 --- /dev/null +++ b/rbi/lib/orb/models/plan_update_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Orb + module Models + class PlanUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + {external_plan_id: T.nilable(String), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])}, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :external_plan_id + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + external_plan_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).void + end + def initialize(external_plan_id: nil, metadata: nil, request_options: {}); end + + sig { returns(Orb::Models::PlanUpdateParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/plans/external_plan_id_fetch_params.rbi b/rbi/lib/orb/models/plans/external_plan_id_fetch_params.rbi new file mode 100644 index 00000000..da176875 --- /dev/null +++ b/rbi/lib/orb/models/plans/external_plan_id_fetch_params.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module Orb + module Models + module Plans + class ExternalPlanIDFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::Plans::ExternalPlanIDFetchParams::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/plans/external_plan_id_update_params.rbi b/rbi/lib/orb/models/plans/external_plan_id_update_params.rbi new file mode 100644 index 00000000..67230fb5 --- /dev/null +++ b/rbi/lib/orb/models/plans/external_plan_id_update_params.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Orb + module Models + module Plans + class ExternalPlanIDUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + {external_plan_id: T.nilable(String), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])}, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :external_plan_id + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + external_plan_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).void + end + def initialize(external_plan_id: nil, metadata: nil, request_options: {}); end + + sig { returns(Orb::Models::Plans::ExternalPlanIDUpdateParams::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/price.rbi b/rbi/lib/orb/models/price.rbi new file mode 100644 index 00000000..8bab54c9 --- /dev/null +++ b/rbi/lib/orb/models/price.rbi @@ -0,0 +1,9356 @@ +# typed: strong + +module Orb + module Models + class Price < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::Price::UnitPrice, + Orb::Models::Price::PackagePrice, + Orb::Models::Price::MatrixPrice, + Orb::Models::Price::TieredPrice, + Orb::Models::Price::TieredBpsPrice, + Orb::Models::Price::BpsPrice, + Orb::Models::Price::BulkBpsPrice, + Orb::Models::Price::BulkPrice, + Orb::Models::Price::ThresholdTotalAmountPrice, + Orb::Models::Price::TieredPackagePrice, + Orb::Models::Price::GroupedTieredPrice, + Orb::Models::Price::TieredWithMinimumPrice, + Orb::Models::Price::TieredPackageWithMinimumPrice, + Orb::Models::Price::PackageWithAllocationPrice, + Orb::Models::Price::UnitWithPercentPrice, + Orb::Models::Price::MatrixWithAllocationPrice, + Orb::Models::Price::TieredWithProrationPrice, + Orb::Models::Price::UnitWithProrationPrice, + Orb::Models::Price::GroupedAllocationPrice, + Orb::Models::Price::GroupedWithProratedMinimumPrice, + Orb::Models::Price::GroupedWithMeteredMinimumPrice, + Orb::Models::Price::MatrixWithDisplayNamePrice, + Orb::Models::Price::BulkWithProrationPrice, + Orb::Models::Price::GroupedTieredPackagePrice, + Orb::Models::Price::MaxGroupTieredPackagePrice, + Orb::Models::Price::ScalableMatrixWithUnitPricingPrice, + Orb::Models::Price::ScalableMatrixWithTieredPricingPrice + ) + end + + class UnitPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::UnitPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::UnitPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::UnitPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::UnitPrice::Item, + maximum: T.nilable(Orb::Models::Price::UnitPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::UnitPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + unit_config: Orb::Models::Price::UnitPrice::UnitConfig, + dimensional_price_configuration: T.nilable(Orb::Models::Price::UnitPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::UnitPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::UnitPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::UnitPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::UnitPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::UnitPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::UnitPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(Orb::Models::Price::UnitPrice::UnitConfig) } + attr_accessor :unit_config + + sig { returns(T.nilable(Orb::Models::Price::UnitPrice::DimensionalPriceConfiguration)) } + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::UnitPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::UnitPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::UnitPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::UnitPrice::Item, + maximum: T.nilable(Orb::Models::Price::UnitPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::UnitPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + unit_config: Orb::Models::Price::UnitPrice::UnitConfig, + dimensional_price_configuration: T.nilable(Orb::Models::Price::UnitPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + unit_config:, + dimensional_price_configuration: nil, + model_type: :unit + ); end + + sig { returns(Orb::Models::Price::UnitPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::UnitPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::UnitPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::UnitPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::UnitPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::UnitPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::UnitPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class UnitConfig < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(unit_amount: String).void } + def initialize(unit_amount:); end + + sig { returns(Orb::Models::Price::UnitPrice::UnitConfig::Shape) } + def to_h; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::UnitPrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class PackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::PackagePrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::PackagePrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::PackagePrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::PackagePrice::Item, + maximum: T.nilable(Orb::Models::Price::PackagePrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::PackagePrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + package_config: Orb::Models::Price::PackagePrice::PackageConfig, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::PackagePrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::PackagePrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::PackagePrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::PackagePrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::PackagePrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::PackagePrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::PackagePrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(Orb::Models::Price::PackagePrice::PackageConfig) } + attr_accessor :package_config + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T.nilable(Orb::Models::Price::PackagePrice::DimensionalPriceConfiguration)) } + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::PackagePrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::PackagePrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::PackagePrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::PackagePrice::Item, + maximum: T.nilable(Orb::Models::Price::PackagePrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::PackagePrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + package_config: Orb::Models::Price::PackagePrice::PackageConfig, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::PackagePrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + package_config:, + plan_phase_order:, + price_type:, + dimensional_price_configuration: nil, + model_type: :package + ); end + + sig { returns(Orb::Models::Price::PackagePrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::PackagePrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::PackagePrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::PackagePrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::PackagePrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::PackagePrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::PackagePrice::Minimum::Shape) } + def to_h; end + end + + class PackageConfig < Orb::BaseModel + Shape = T.type_alias { {package_amount: String, package_size: Integer} } + + sig { returns(String) } + attr_accessor :package_amount + + sig { returns(Integer) } + attr_accessor :package_size + + sig { params(package_amount: String, package_size: Integer).void } + def initialize(package_amount:, package_size:); end + + sig { returns(Orb::Models::Price::PackagePrice::PackageConfig::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::PackagePrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class MatrixPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::MatrixPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::MatrixPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::MatrixPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::MatrixPrice::Item, + matrix_config: Orb::Models::Price::MatrixPrice::MatrixConfig, + maximum: T.nilable(Orb::Models::Price::MatrixPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::MatrixPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::MatrixPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::MatrixPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::MatrixPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::MatrixPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::MatrixPrice::Item) } + attr_accessor :item + + sig { returns(Orb::Models::Price::MatrixPrice::MatrixConfig) } + attr_accessor :matrix_config + + sig { returns(T.nilable(Orb::Models::Price::MatrixPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::MatrixPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T.nilable(Orb::Models::Price::MatrixPrice::DimensionalPriceConfiguration)) } + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::MatrixPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::MatrixPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::MatrixPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::MatrixPrice::Item, + matrix_config: Orb::Models::Price::MatrixPrice::MatrixConfig, + maximum: T.nilable(Orb::Models::Price::MatrixPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::MatrixPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::MatrixPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + matrix_config:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + dimensional_price_configuration: nil, + model_type: :matrix + ); end + + sig { returns(Orb::Models::Price::MatrixPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::MatrixPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::MatrixPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::MatrixPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::MatrixPrice::Item::Shape) } + def to_h; end + end + + class MatrixConfig < Orb::BaseModel + Shape = T.type_alias do + { + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::Price::MatrixPrice::MatrixConfig::MatrixValue] + } + end + + sig { returns(String) } + attr_accessor :default_unit_amount + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimensions + + sig { returns(T::Array[Orb::Models::Price::MatrixPrice::MatrixConfig::MatrixValue]) } + attr_accessor :matrix_values + + sig do + params( + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::Price::MatrixPrice::MatrixConfig::MatrixValue] + ).void + end + def initialize(default_unit_amount:, dimensions:, matrix_values:); end + + sig { returns(Orb::Models::Price::MatrixPrice::MatrixConfig::Shape) } + def to_h; end + + class MatrixValue < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[T.nilable(String)], unit_amount: String} } + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(dimension_values: T::Array[T.nilable(String)], unit_amount: String).void } + def initialize(dimension_values:, unit_amount:); end + + sig { returns(Orb::Models::Price::MatrixPrice::MatrixConfig::MatrixValue::Shape) } + def to_h; end + end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::MatrixPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::MatrixPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::MatrixPrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class TieredPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::TieredPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::TieredPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::TieredPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::TieredPrice::Item, + maximum: T.nilable(Orb::Models::Price::TieredPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::TieredPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + tiered_config: Orb::Models::Price::TieredPrice::TieredConfig, + dimensional_price_configuration: T.nilable(Orb::Models::Price::TieredPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::TieredPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::TieredPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::TieredPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::TieredPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::TieredPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::TieredPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(Orb::Models::Price::TieredPrice::TieredConfig) } + attr_accessor :tiered_config + + sig { returns(T.nilable(Orb::Models::Price::TieredPrice::DimensionalPriceConfiguration)) } + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::TieredPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::TieredPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::TieredPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::TieredPrice::Item, + maximum: T.nilable(Orb::Models::Price::TieredPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::TieredPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + tiered_config: Orb::Models::Price::TieredPrice::TieredConfig, + dimensional_price_configuration: T.nilable(Orb::Models::Price::TieredPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + tiered_config:, + dimensional_price_configuration: nil, + model_type: :tiered + ); end + + sig { returns(Orb::Models::Price::TieredPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::TieredPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::TieredPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::TieredPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::TieredPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::TieredPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::TieredPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TieredConfig < Orb::BaseModel + Shape = T.type_alias { {tiers: T::Array[Orb::Models::Price::TieredPrice::TieredConfig::Tier]} } + + sig { returns(T::Array[Orb::Models::Price::TieredPrice::TieredConfig::Tier]) } + attr_accessor :tiers + + sig { params(tiers: T::Array[Orb::Models::Price::TieredPrice::TieredConfig::Tier]).void } + def initialize(tiers:); end + + sig { returns(Orb::Models::Price::TieredPrice::TieredConfig::Shape) } + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias { {first_unit: Float, unit_amount: String, last_unit: T.nilable(Float)} } + + sig { returns(Float) } + attr_accessor :first_unit + + sig { returns(String) } + attr_accessor :unit_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :last_unit + + sig { params(first_unit: Float, unit_amount: String, last_unit: T.nilable(Float)).void } + def initialize(first_unit:, unit_amount:, last_unit: nil); end + + sig { returns(Orb::Models::Price::TieredPrice::TieredConfig::Tier::Shape) } + def to_h; end + end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::TieredPrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class TieredBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::TieredBpsPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::TieredBpsPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::TieredBpsPrice::Item, + maximum: T.nilable(Orb::Models::Price::TieredBpsPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::TieredBpsPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + tiered_bps_config: Orb::Models::Price::TieredBpsPrice::TieredBpsConfig, + dimensional_price_configuration: T.nilable(Orb::Models::Price::TieredBpsPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::TieredBpsPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::TieredBpsPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::TieredBpsPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::TieredBpsPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::TieredBpsPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(Orb::Models::Price::TieredBpsPrice::TieredBpsConfig) } + attr_accessor :tiered_bps_config + + sig { returns(T.nilable(Orb::Models::Price::TieredBpsPrice::DimensionalPriceConfiguration)) } + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::TieredBpsPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::TieredBpsPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::TieredBpsPrice::Item, + maximum: T.nilable(Orb::Models::Price::TieredBpsPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::TieredBpsPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + tiered_bps_config: Orb::Models::Price::TieredBpsPrice::TieredBpsConfig, + dimensional_price_configuration: T.nilable(Orb::Models::Price::TieredBpsPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + tiered_bps_config:, + dimensional_price_configuration: nil, + model_type: :tiered_bps + ); end + + sig { returns(Orb::Models::Price::TieredBpsPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::TieredBpsPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::TieredBpsPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::TieredBpsPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::TieredBpsPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::TieredBpsPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TieredBpsConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::Price::TieredBpsPrice::TieredBpsConfig::Tier]} + end + + sig { returns(T::Array[Orb::Models::Price::TieredBpsPrice::TieredBpsConfig::Tier]) } + attr_accessor :tiers + + sig { params(tiers: T::Array[Orb::Models::Price::TieredBpsPrice::TieredBpsConfig::Tier]).void } + def initialize(tiers:); end + + sig { returns(Orb::Models::Price::TieredBpsPrice::TieredBpsConfig::Shape) } + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias do + { + bps: Float, + minimum_amount: String, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + } + end + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig do + params( + bps: Float, + minimum_amount: String, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + ).void + end + def initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil); end + + sig { returns(Orb::Models::Price::TieredBpsPrice::TieredBpsConfig::Tier::Shape) } + def to_h; end + end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::TieredBpsPrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class BpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::BpsPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::BpsPrice::BillingCycleConfiguration, + bps_config: Orb::Models::Price::BpsPrice::BpsConfig, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::BpsPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::BpsPrice::Item, + maximum: T.nilable(Orb::Models::Price::BpsPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::BpsPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::BpsPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::BpsPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::BpsPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Orb::Models::Price::BpsPrice::BpsConfig) } + attr_accessor :bps_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::BpsPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::BpsPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::BpsPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::BpsPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T.nilable(Orb::Models::Price::BpsPrice::DimensionalPriceConfiguration)) } + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::BpsPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::BpsPrice::BillingCycleConfiguration, + bps_config: Orb::Models::Price::BpsPrice::BpsConfig, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::BpsPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::BpsPrice::Item, + maximum: T.nilable(Orb::Models::Price::BpsPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::BpsPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::BpsPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + bps_config:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + dimensional_price_configuration: nil, + model_type: :bps + ); end + + sig { returns(Orb::Models::Price::BpsPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::BpsPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::BpsPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class BpsConfig < Orb::BaseModel + Shape = T.type_alias { {bps: Float, per_unit_maximum: T.nilable(String)} } + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig { params(bps: Float, per_unit_maximum: T.nilable(String)).void } + def initialize(bps:, per_unit_maximum: nil); end + + sig { returns(Orb::Models::Price::BpsPrice::BpsConfig::Shape) } + def to_h; end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::BpsPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::BpsPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::BpsPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::BpsPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::BpsPrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class BulkBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::BulkBpsPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration, + bulk_bps_config: Orb::Models::Price::BulkBpsPrice::BulkBpsConfig, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::BulkBpsPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::BulkBpsPrice::Item, + maximum: T.nilable(Orb::Models::Price::BulkBpsPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::BulkBpsPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::BulkBpsPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::BulkBpsPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Orb::Models::Price::BulkBpsPrice::BulkBpsConfig) } + attr_accessor :bulk_bps_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::BulkBpsPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::BulkBpsPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::BulkBpsPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::BulkBpsPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T.nilable(Orb::Models::Price::BulkBpsPrice::DimensionalPriceConfiguration)) } + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::BulkBpsPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration, + bulk_bps_config: Orb::Models::Price::BulkBpsPrice::BulkBpsConfig, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::BulkBpsPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::BulkBpsPrice::Item, + maximum: T.nilable(Orb::Models::Price::BulkBpsPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::BulkBpsPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::BulkBpsPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + bulk_bps_config:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + dimensional_price_configuration: nil, + model_type: :bulk_bps + ); end + + sig { returns(Orb::Models::Price::BulkBpsPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::BulkBpsPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class BulkBpsConfig < Orb::BaseModel + Shape = T.type_alias { {tiers: T::Array[Orb::Models::Price::BulkBpsPrice::BulkBpsConfig::Tier]} } + + sig { returns(T::Array[Orb::Models::Price::BulkBpsPrice::BulkBpsConfig::Tier]) } + attr_accessor :tiers + + sig { params(tiers: T::Array[Orb::Models::Price::BulkBpsPrice::BulkBpsConfig::Tier]).void } + def initialize(tiers:); end + + sig { returns(Orb::Models::Price::BulkBpsPrice::BulkBpsConfig::Shape) } + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias do + {bps: Float, maximum_amount: T.nilable(String), per_unit_maximum: T.nilable(String)} + end + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig do + params(bps: Float, maximum_amount: T.nilable(String), per_unit_maximum: T.nilable(String)).void + end + def initialize(bps:, maximum_amount: nil, per_unit_maximum: nil); end + + sig { returns(Orb::Models::Price::BulkBpsPrice::BulkBpsConfig::Tier::Shape) } + def to_h; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::BulkBpsPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::BulkBpsPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::BulkBpsPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::BulkBpsPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::BulkBpsPrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class BulkPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::BulkPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::BulkPrice::BillingCycleConfiguration, + bulk_config: Orb::Models::Price::BulkPrice::BulkConfig, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::BulkPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::BulkPrice::Item, + maximum: T.nilable(Orb::Models::Price::BulkPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::BulkPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::BulkPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::BulkPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::BulkPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Orb::Models::Price::BulkPrice::BulkConfig) } + attr_accessor :bulk_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::BulkPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::BulkPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::BulkPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::BulkPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T.nilable(Orb::Models::Price::BulkPrice::DimensionalPriceConfiguration)) } + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::BulkPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::BulkPrice::BillingCycleConfiguration, + bulk_config: Orb::Models::Price::BulkPrice::BulkConfig, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::BulkPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::BulkPrice::Item, + maximum: T.nilable(Orb::Models::Price::BulkPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::BulkPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::BulkPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + bulk_config:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + dimensional_price_configuration: nil, + model_type: :bulk + ); end + + sig { returns(Orb::Models::Price::BulkPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::BulkPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::BulkPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class BulkConfig < Orb::BaseModel + Shape = T.type_alias { {tiers: T::Array[Orb::Models::Price::BulkPrice::BulkConfig::Tier]} } + + sig { returns(T::Array[Orb::Models::Price::BulkPrice::BulkConfig::Tier]) } + attr_accessor :tiers + + sig { params(tiers: T::Array[Orb::Models::Price::BulkPrice::BulkConfig::Tier]).void } + def initialize(tiers:); end + + sig { returns(Orb::Models::Price::BulkPrice::BulkConfig::Shape) } + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String, maximum_units: T.nilable(Float)} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :maximum_units + + sig { params(unit_amount: String, maximum_units: T.nilable(Float)).void } + def initialize(unit_amount:, maximum_units: nil); end + + sig { returns(Orb::Models::Price::BulkPrice::BulkConfig::Tier::Shape) } + def to_h; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::BulkPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::BulkPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::BulkPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::BulkPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::BulkPrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class ThresholdTotalAmountPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::ThresholdTotalAmountPrice::Item, + maximum: T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::ThresholdTotalAmountPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :threshold_total_amount_config + + sig do + returns(T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::DimensionalPriceConfiguration)) + end + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::ThresholdTotalAmountPrice::Item, + maximum: T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::ThresholdTotalAmountPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + threshold_total_amount_config:, + dimensional_price_configuration: nil, + model_type: :threshold_total_amount + ); end + + sig { returns(Orb::Models::Price::ThresholdTotalAmountPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::ThresholdTotalAmountPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::ThresholdTotalAmountPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::ThresholdTotalAmountPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::ThresholdTotalAmountPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::ThresholdTotalAmountPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::ThresholdTotalAmountPrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class TieredPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::TieredPackagePrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::TieredPackagePrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::TieredPackagePrice::Item, + maximum: T.nilable(Orb::Models::Price::TieredPackagePrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::TieredPackagePrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + tiered_package_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::TieredPackagePrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::TieredPackagePrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::TieredPackagePrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::TieredPackagePrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::TieredPackagePrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::TieredPackagePrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_package_config + + sig { returns(T.nilable(Orb::Models::Price::TieredPackagePrice::DimensionalPriceConfiguration)) } + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::TieredPackagePrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::TieredPackagePrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::TieredPackagePrice::Item, + maximum: T.nilable(Orb::Models::Price::TieredPackagePrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::TieredPackagePrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + tiered_package_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::TieredPackagePrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + tiered_package_config:, + dimensional_price_configuration: nil, + model_type: :tiered_package + ); end + + sig { returns(Orb::Models::Price::TieredPackagePrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::TieredPackagePrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::TieredPackagePrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::TieredPackagePrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::TieredPackagePrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::TieredPackagePrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::TieredPackagePrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class GroupedTieredPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::GroupedTieredPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::GroupedTieredPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + grouped_tiered_config: T::Hash[Symbol, T.anything], + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::GroupedTieredPrice::Item, + maximum: T.nilable(Orb::Models::Price::GroupedTieredPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::GroupedTieredPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::GroupedTieredPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::GroupedTieredPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::GroupedTieredPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_tiered_config + + sig { returns(T.nilable(Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::GroupedTieredPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::GroupedTieredPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::GroupedTieredPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T.nilable(Orb::Models::Price::GroupedTieredPrice::DimensionalPriceConfiguration)) } + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::GroupedTieredPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::GroupedTieredPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + grouped_tiered_config: T::Hash[Symbol, T.anything], + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::GroupedTieredPrice::Item, + maximum: T.nilable(Orb::Models::Price::GroupedTieredPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::GroupedTieredPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::GroupedTieredPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + grouped_tiered_config:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + dimensional_price_configuration: nil, + model_type: :grouped_tiered + ); end + + sig { returns(Orb::Models::Price::GroupedTieredPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::GroupedTieredPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::GroupedTieredPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::GroupedTieredPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::GroupedTieredPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::GroupedTieredPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::GroupedTieredPrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class TieredWithMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::TieredWithMinimumPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::TieredWithMinimumPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::TieredWithMinimumPrice::Item, + maximum: T.nilable(Orb::Models::Price::TieredWithMinimumPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::TieredWithMinimumPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::TieredWithMinimumPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::TieredWithMinimumPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::TieredWithMinimumPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::TieredWithMinimumPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::TieredWithMinimumPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::TieredWithMinimumPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_with_minimum_config + + sig { returns(T.nilable(Orb::Models::Price::TieredWithMinimumPrice::DimensionalPriceConfiguration)) } + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::TieredWithMinimumPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::TieredWithMinimumPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::TieredWithMinimumPrice::Item, + maximum: T.nilable(Orb::Models::Price::TieredWithMinimumPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::TieredWithMinimumPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::TieredWithMinimumPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + tiered_with_minimum_config:, + dimensional_price_configuration: nil, + model_type: :tiered_with_minimum + ); end + + sig { returns(Orb::Models::Price::TieredWithMinimumPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::TieredWithMinimumPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::TieredWithMinimumPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::TieredWithMinimumPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::TieredWithMinimumPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::TieredWithMinimumPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::TieredWithMinimumPrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class TieredPackageWithMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::TieredPackageWithMinimumPrice::Item, + maximum: T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig do + returns(T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::TieredPackageWithMinimumPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_package_with_minimum_config + + sig do + returns(T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::DimensionalPriceConfiguration)) + end + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::TieredPackageWithMinimumPrice::Item, + maximum: T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::TieredPackageWithMinimumPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + tiered_package_with_minimum_config:, + dimensional_price_configuration: nil, + model_type: :tiered_package_with_minimum + ); end + + sig { returns(Orb::Models::Price::TieredPackageWithMinimumPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::TieredPackageWithMinimumPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::TieredPackageWithMinimumPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::TieredPackageWithMinimumPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::TieredPackageWithMinimumPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::TieredPackageWithMinimumPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig do + returns(Orb::Models::Price::TieredPackageWithMinimumPrice::DimensionalPriceConfiguration::Shape) + end + def to_h; end + end + end + + class PackageWithAllocationPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::PackageWithAllocationPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::PackageWithAllocationPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::PackageWithAllocationPrice::Item, + maximum: T.nilable(Orb::Models::Price::PackageWithAllocationPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::PackageWithAllocationPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + package_with_allocation_config: T::Hash[Symbol, T.anything], + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::PackageWithAllocationPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::PackageWithAllocationPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::PackageWithAllocationPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig do + returns(T.nilable(Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::PackageWithAllocationPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::PackageWithAllocationPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::PackageWithAllocationPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :package_with_allocation_config + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig do + returns(T.nilable(Orb::Models::Price::PackageWithAllocationPrice::DimensionalPriceConfiguration)) + end + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::PackageWithAllocationPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::PackageWithAllocationPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::PackageWithAllocationPrice::Item, + maximum: T.nilable(Orb::Models::Price::PackageWithAllocationPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::PackageWithAllocationPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + package_with_allocation_config: T::Hash[Symbol, T.anything], + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::PackageWithAllocationPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + package_with_allocation_config:, + plan_phase_order:, + price_type:, + dimensional_price_configuration: nil, + model_type: :package_with_allocation + ); end + + sig { returns(Orb::Models::Price::PackageWithAllocationPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::PackageWithAllocationPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::PackageWithAllocationPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::PackageWithAllocationPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::PackageWithAllocationPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::PackageWithAllocationPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig do + returns(Orb::Models::Price::PackageWithAllocationPrice::DimensionalPriceConfiguration::Shape) + end + def to_h; end + end + end + + class UnitWithPercentPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::UnitWithPercentPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::UnitWithPercentPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::UnitWithPercentPrice::Item, + maximum: T.nilable(Orb::Models::Price::UnitWithPercentPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::UnitWithPercentPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + unit_with_percent_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::UnitWithPercentPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::UnitWithPercentPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::UnitWithPercentPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::UnitWithPercentPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::UnitWithPercentPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::UnitWithPercentPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :unit_with_percent_config + + sig { returns(T.nilable(Orb::Models::Price::UnitWithPercentPrice::DimensionalPriceConfiguration)) } + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::UnitWithPercentPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::UnitWithPercentPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::UnitWithPercentPrice::Item, + maximum: T.nilable(Orb::Models::Price::UnitWithPercentPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::UnitWithPercentPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + unit_with_percent_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::UnitWithPercentPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + unit_with_percent_config:, + dimensional_price_configuration: nil, + model_type: :unit_with_percent + ); end + + sig { returns(Orb::Models::Price::UnitWithPercentPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::UnitWithPercentPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::UnitWithPercentPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::UnitWithPercentPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::UnitWithPercentPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::UnitWithPercentPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::UnitWithPercentPrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class MatrixWithAllocationPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::MatrixWithAllocationPrice::Item, + matrix_with_allocation_config: Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig, + maximum: T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::MatrixWithAllocationPrice::Item) } + attr_accessor :item + + sig { returns(Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig) } + attr_accessor :matrix_with_allocation_config + + sig { returns(T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig do + returns(T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::DimensionalPriceConfiguration)) + end + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::MatrixWithAllocationPrice::Item, + matrix_with_allocation_config: Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig, + maximum: T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::MatrixWithAllocationPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + matrix_with_allocation_config:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + dimensional_price_configuration: nil, + model_type: :matrix_with_allocation + ); end + + sig { returns(Orb::Models::Price::MatrixWithAllocationPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::MatrixWithAllocationPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::MatrixWithAllocationPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::MatrixWithAllocationPrice::Item::Shape) } + def to_h; end + end + + class MatrixWithAllocationConfig < Orb::BaseModel + Shape = T.type_alias do + { + allocation: Float, + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue] + } + end + + sig { returns(Float) } + attr_accessor :allocation + + sig { returns(String) } + attr_accessor :default_unit_amount + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimensions + + sig do + returns(T::Array[Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue]) + end + attr_accessor :matrix_values + + sig do + params( + allocation: Float, + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue] + ).void + end + def initialize(allocation:, default_unit_amount:, dimensions:, matrix_values:); end + + sig { returns(Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig::Shape) } + def to_h; end + + class MatrixValue < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[T.nilable(String)], unit_amount: String} } + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(dimension_values: T::Array[T.nilable(String)], unit_amount: String).void } + def initialize(dimension_values:, unit_amount:); end + + sig do + returns(Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue::Shape) + end + def to_h; end + end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::MatrixWithAllocationPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::MatrixWithAllocationPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::MatrixWithAllocationPrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class TieredWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::TieredWithProrationPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::TieredWithProrationPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::TieredWithProrationPrice::Item, + maximum: T.nilable(Orb::Models::Price::TieredWithProrationPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::TieredWithProrationPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + tiered_with_proration_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::TieredWithProrationPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::TieredWithProrationPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::TieredWithProrationPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::TieredWithProrationPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::TieredWithProrationPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::TieredWithProrationPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_with_proration_config + + sig do + returns(T.nilable(Orb::Models::Price::TieredWithProrationPrice::DimensionalPriceConfiguration)) + end + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::TieredWithProrationPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::TieredWithProrationPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::TieredWithProrationPrice::Item, + maximum: T.nilable(Orb::Models::Price::TieredWithProrationPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::TieredWithProrationPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + tiered_with_proration_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::TieredWithProrationPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + tiered_with_proration_config:, + dimensional_price_configuration: nil, + model_type: :tiered_with_proration + ); end + + sig { returns(Orb::Models::Price::TieredWithProrationPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::TieredWithProrationPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::TieredWithProrationPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::TieredWithProrationPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::TieredWithProrationPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::TieredWithProrationPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::TieredWithProrationPrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class UnitWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::UnitWithProrationPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::UnitWithProrationPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::UnitWithProrationPrice::Item, + maximum: T.nilable(Orb::Models::Price::UnitWithProrationPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::UnitWithProrationPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + unit_with_proration_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::UnitWithProrationPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::UnitWithProrationPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::UnitWithProrationPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::UnitWithProrationPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::UnitWithProrationPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::UnitWithProrationPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :unit_with_proration_config + + sig { returns(T.nilable(Orb::Models::Price::UnitWithProrationPrice::DimensionalPriceConfiguration)) } + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::UnitWithProrationPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::UnitWithProrationPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::UnitWithProrationPrice::Item, + maximum: T.nilable(Orb::Models::Price::UnitWithProrationPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::UnitWithProrationPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + unit_with_proration_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::UnitWithProrationPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + unit_with_proration_config:, + dimensional_price_configuration: nil, + model_type: :unit_with_proration + ); end + + sig { returns(Orb::Models::Price::UnitWithProrationPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::UnitWithProrationPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::UnitWithProrationPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::UnitWithProrationPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::UnitWithProrationPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::UnitWithProrationPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::UnitWithProrationPrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class GroupedAllocationPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::GroupedAllocationPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::GroupedAllocationPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + grouped_allocation_config: T::Hash[Symbol, T.anything], + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::GroupedAllocationPrice::Item, + maximum: T.nilable(Orb::Models::Price::GroupedAllocationPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::GroupedAllocationPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::GroupedAllocationPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::GroupedAllocationPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::GroupedAllocationPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_allocation_config + + sig { returns(T.nilable(Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::GroupedAllocationPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::GroupedAllocationPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::GroupedAllocationPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T.nilable(Orb::Models::Price::GroupedAllocationPrice::DimensionalPriceConfiguration)) } + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::GroupedAllocationPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::GroupedAllocationPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + grouped_allocation_config: T::Hash[Symbol, T.anything], + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::GroupedAllocationPrice::Item, + maximum: T.nilable(Orb::Models::Price::GroupedAllocationPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::GroupedAllocationPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::GroupedAllocationPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + grouped_allocation_config:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + dimensional_price_configuration: nil, + model_type: :grouped_allocation + ); end + + sig { returns(Orb::Models::Price::GroupedAllocationPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::GroupedAllocationPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::GroupedAllocationPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::GroupedAllocationPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::GroupedAllocationPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::GroupedAllocationPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::GroupedAllocationPrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class GroupedWithProratedMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::GroupedWithProratedMinimumPrice::Item, + maximum: T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_with_prorated_minimum_config + + sig do + returns(T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::GroupedWithProratedMinimumPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig do + returns(T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::DimensionalPriceConfiguration)) + end + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::GroupedWithProratedMinimumPrice::Item, + maximum: T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::GroupedWithProratedMinimumPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + grouped_with_prorated_minimum_config:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + dimensional_price_configuration: nil, + model_type: :grouped_with_prorated_minimum + ); end + + sig { returns(Orb::Models::Price::GroupedWithProratedMinimumPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::GroupedWithProratedMinimumPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::GroupedWithProratedMinimumPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::GroupedWithProratedMinimumPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::GroupedWithProratedMinimumPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::GroupedWithProratedMinimumPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig do + returns(Orb::Models::Price::GroupedWithProratedMinimumPrice::DimensionalPriceConfiguration::Shape) + end + def to_h; end + end + end + + class GroupedWithMeteredMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::GroupedWithMeteredMinimumPrice::Item, + maximum: T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_with_metered_minimum_config + + sig do + returns(T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::GroupedWithMeteredMinimumPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig do + returns(T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::DimensionalPriceConfiguration)) + end + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::GroupedWithMeteredMinimumPrice::Item, + maximum: T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::GroupedWithMeteredMinimumPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + grouped_with_metered_minimum_config:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + dimensional_price_configuration: nil, + model_type: :grouped_with_metered_minimum + ); end + + sig { returns(Orb::Models::Price::GroupedWithMeteredMinimumPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::GroupedWithMeteredMinimumPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::GroupedWithMeteredMinimumPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::GroupedWithMeteredMinimumPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::GroupedWithMeteredMinimumPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig do + returns(Orb::Models::Price::GroupedWithMeteredMinimumPrice::DimensionalPriceConfiguration::Shape) + end + def to_h; end + end + end + + class MatrixWithDisplayNamePrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::MatrixWithDisplayNamePrice::Item, + matrix_with_display_name_config: T::Hash[Symbol, T.anything], + maximum: T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig do + returns(T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::MatrixWithDisplayNamePrice::Item) } + attr_accessor :item + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :matrix_with_display_name_config + + sig { returns(T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig do + returns(T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::DimensionalPriceConfiguration)) + end + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::MatrixWithDisplayNamePrice::Item, + matrix_with_display_name_config: T::Hash[Symbol, T.anything], + maximum: T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::MatrixWithDisplayNamePrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + matrix_with_display_name_config:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + dimensional_price_configuration: nil, + model_type: :matrix_with_display_name + ); end + + sig { returns(Orb::Models::Price::MatrixWithDisplayNamePrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::MatrixWithDisplayNamePrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::MatrixWithDisplayNamePrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::MatrixWithDisplayNamePrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::MatrixWithDisplayNamePrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::MatrixWithDisplayNamePrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig do + returns(Orb::Models::Price::MatrixWithDisplayNamePrice::DimensionalPriceConfiguration::Shape) + end + def to_h; end + end + end + + class BulkWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::BulkWithProrationPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration, + bulk_with_proration_config: T::Hash[Symbol, T.anything], + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::BulkWithProrationPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::BulkWithProrationPrice::Item, + maximum: T.nilable(Orb::Models::Price::BulkWithProrationPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::BulkWithProrationPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::BulkWithProrationPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::BulkWithProrationPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :bulk_with_proration_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::BulkWithProrationPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::BulkWithProrationPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::BulkWithProrationPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::BulkWithProrationPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T.nilable(Orb::Models::Price::BulkWithProrationPrice::DimensionalPriceConfiguration)) } + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::BulkWithProrationPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration, + bulk_with_proration_config: T::Hash[Symbol, T.anything], + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::BulkWithProrationPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::BulkWithProrationPrice::Item, + maximum: T.nilable(Orb::Models::Price::BulkWithProrationPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::BulkWithProrationPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::BulkWithProrationPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + bulk_with_proration_config:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + dimensional_price_configuration: nil, + model_type: :bulk_with_proration + ); end + + sig { returns(Orb::Models::Price::BulkWithProrationPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::BulkWithProrationPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::BulkWithProrationPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::BulkWithProrationPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::BulkWithProrationPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::BulkWithProrationPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::BulkWithProrationPrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class GroupedTieredPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + grouped_tiered_package_config: T::Hash[Symbol, T.anything], + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::GroupedTieredPackagePrice::Item, + maximum: T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_tiered_package_config + + sig { returns(T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::GroupedTieredPackagePrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig do + returns(T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::DimensionalPriceConfiguration)) + end + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + grouped_tiered_package_config: T::Hash[Symbol, T.anything], + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::GroupedTieredPackagePrice::Item, + maximum: T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::GroupedTieredPackagePrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + grouped_tiered_package_config:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + dimensional_price_configuration: nil, + model_type: :grouped_tiered_package + ); end + + sig { returns(Orb::Models::Price::GroupedTieredPackagePrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::GroupedTieredPackagePrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::GroupedTieredPackagePrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::GroupedTieredPackagePrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::GroupedTieredPackagePrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::GroupedTieredPackagePrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig { returns(Orb::Models::Price::GroupedTieredPackagePrice::DimensionalPriceConfiguration::Shape) } + def to_h; end + end + end + + class MaxGroupTieredPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::MaxGroupTieredPackagePrice::Item, + max_group_tiered_package_config: T::Hash[Symbol, T.anything], + maximum: T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig do + returns(T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::MaxGroupTieredPackagePrice::Item) } + attr_accessor :item + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :max_group_tiered_package_config + + sig { returns(T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig do + returns(T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::DimensionalPriceConfiguration)) + end + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::MaxGroupTieredPackagePrice::Item, + max_group_tiered_package_config: T::Hash[Symbol, T.anything], + maximum: T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + dimensional_price_configuration: T.nilable(Orb::Models::Price::MaxGroupTieredPackagePrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + max_group_tiered_package_config:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + dimensional_price_configuration: nil, + model_type: :max_group_tiered_package + ); end + + sig { returns(Orb::Models::Price::MaxGroupTieredPackagePrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::MaxGroupTieredPackagePrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::MaxGroupTieredPackagePrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::MaxGroupTieredPackagePrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::MaxGroupTieredPackagePrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::MaxGroupTieredPackagePrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig do + returns(Orb::Models::Price::MaxGroupTieredPackagePrice::DimensionalPriceConfiguration::Shape) + end + def to_h; end + end + end + + class ScalableMatrixWithUnitPricingPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Item, + maximum: T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + scalable_matrix_with_unit_pricing_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig do + returns(T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :scalable_matrix_with_unit_pricing_config + + sig do + returns(T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::DimensionalPriceConfiguration)) + end + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Item, + maximum: T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + scalable_matrix_with_unit_pricing_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + scalable_matrix_with_unit_pricing_config:, + dimensional_price_configuration: nil, + model_type: :scalable_matrix_with_unit_pricing + ); end + + sig { returns(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig do + returns(Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::DimensionalPriceConfiguration::Shape) + end + def to_h; end + end + end + + class ScalableMatrixWithTieredPricingPrice < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billable_metric: T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Item, + maximum: T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Minimum), + minimum_amount: T.nilable(String), + model_type: Symbol, + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + scalable_matrix_with_tiered_pricing_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::DimensionalPriceConfiguration) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillableMetric)) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration) } + attr_accessor :billing_cycle_configuration + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::CreditAllocation)) } + attr_accessor :credit_allocation + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T.nilable(Orb::Models::Discount::Variants)) } + attr_accessor :discount + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig do + returns(T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Item) } + attr_accessor :item + + sig { returns(T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Maximum)) } + attr_accessor :maximum + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Minimum)) } + attr_accessor :minimum + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(Symbol) } + attr_accessor :price_type + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :scalable_matrix_with_tiered_pricing_config + + sig do + returns(T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::DimensionalPriceConfiguration)) + end + attr_accessor :dimensional_price_configuration + + sig do + params( + id: String, + billable_metric: T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillableMetric), + billing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration, + cadence: Symbol, + conversion_rate: T.nilable(Float), + created_at: Time, + credit_allocation: T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::CreditAllocation), + currency: String, + discount: T.nilable(Orb::Models::Discount::Variants), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoicing_cycle_configuration: T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration), + item: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Item, + maximum: T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Maximum), + maximum_amount: T.nilable(String), + metadata: T::Hash[Symbol, String], + minimum: T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Minimum), + minimum_amount: T.nilable(String), + name: String, + plan_phase_order: T.nilable(Integer), + price_type: Symbol, + scalable_matrix_with_tiered_pricing_config: T::Hash[Symbol, T.anything], + dimensional_price_configuration: T.nilable(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::DimensionalPriceConfiguration), + model_type: Symbol + ).void + end + def initialize( + id:, + billable_metric:, + billing_cycle_configuration:, + cadence:, + conversion_rate:, + created_at:, + credit_allocation:, + currency:, + discount:, + external_price_id:, + fixed_price_quantity:, + invoicing_cycle_configuration:, + item:, + maximum:, + maximum_amount:, + metadata:, + minimum:, + minimum_amount:, + name:, + plan_phase_order:, + price_type:, + scalable_matrix_with_tiered_pricing_config:, + dimensional_price_configuration: nil, + model_type: :scalable_matrix_with_tiered_pricing + ); end + + sig { returns(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String} } + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).void } + def initialize(id:); end + + sig { returns(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillableMetric::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class CreditAllocation < Orb::BaseModel + Shape = T.type_alias { {allows_rollover: T::Boolean, currency: String} } + + sig { returns(T::Boolean) } + attr_accessor :allows_rollover + + sig { returns(String) } + attr_accessor :currency + + sig { params(allows_rollover: T::Boolean, currency: String).void } + def initialize(allows_rollover:, currency:); end + + sig { returns(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::CreditAllocation::Shape) } + def to_h; end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Item < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig { returns(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Item::Shape) } + def to_h; end + end + + class Maximum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], maximum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { params(applies_to_price_ids: T::Array[String], maximum_amount: String).void } + def initialize(applies_to_price_ids:, maximum_amount:); end + + sig { returns(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Maximum::Shape) } + def to_h; end + end + + class Minimum < Orb::BaseModel + Shape = T.type_alias { {applies_to_price_ids: T::Array[String], minimum_amount: String} } + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { params(applies_to_price_ids: T::Array[String], minimum_amount: String).void } + def initialize(applies_to_price_ids:, minimum_amount:); end + + sig { returns(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Minimum::Shape) } + def to_h; end + end + + class PriceType < Orb::Enum + abstract! + + USAGE_PRICE = :usage_price + FIXED_PRICE = :fixed_price + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class DimensionalPriceConfiguration < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[String], dimensional_price_group_id: String} } + + sig { returns(T::Array[String]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :dimensional_price_group_id + + sig { params(dimension_values: T::Array[String], dimensional_price_group_id: String).void } + def initialize(dimension_values:, dimensional_price_group_id:); end + + sig do + returns(Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::DimensionalPriceConfiguration::Shape) + end + def to_h; end + end + end + + sig do + override.returns( + [ + [Symbol, Orb::Models::Price::UnitPrice], + [Symbol, Orb::Models::Price::PackagePrice], + [Symbol, Orb::Models::Price::MatrixPrice], + [Symbol, Orb::Models::Price::TieredPrice], + [Symbol, Orb::Models::Price::TieredBpsPrice], + [Symbol, Orb::Models::Price::BpsPrice], + [Symbol, Orb::Models::Price::BulkBpsPrice], + [Symbol, Orb::Models::Price::BulkPrice], + [Symbol, Orb::Models::Price::ThresholdTotalAmountPrice], + [Symbol, Orb::Models::Price::TieredPackagePrice], + [Symbol, Orb::Models::Price::GroupedTieredPrice], + [Symbol, Orb::Models::Price::TieredWithMinimumPrice], + [Symbol, Orb::Models::Price::TieredPackageWithMinimumPrice], + [Symbol, Orb::Models::Price::PackageWithAllocationPrice], + [Symbol, Orb::Models::Price::UnitWithPercentPrice], + [Symbol, Orb::Models::Price::MatrixWithAllocationPrice], + [Symbol, Orb::Models::Price::TieredWithProrationPrice], + [Symbol, Orb::Models::Price::UnitWithProrationPrice], + [Symbol, Orb::Models::Price::GroupedAllocationPrice], + [Symbol, Orb::Models::Price::GroupedWithProratedMinimumPrice], + [Symbol, Orb::Models::Price::GroupedWithMeteredMinimumPrice], + [Symbol, Orb::Models::Price::MatrixWithDisplayNamePrice], + [Symbol, Orb::Models::Price::BulkWithProrationPrice], + [Symbol, Orb::Models::Price::GroupedTieredPackagePrice], + [Symbol, Orb::Models::Price::MaxGroupTieredPackagePrice], + [Symbol, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice], + [Symbol, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice] + ] + ) + end + private_class_method def self.variants; end + end + end +end diff --git a/rbi/lib/orb/models/price_create_params.rbi b/rbi/lib/orb/models/price_create_params.rbi new file mode 100644 index 00000000..c40247c3 --- /dev/null +++ b/rbi/lib/orb/models/price_create_params.rbi @@ -0,0 +1,641 @@ +# typed: strong + +module Orb + module Models + class PriceCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + unit_config: Orb::Models::PriceCreateParams::UnitConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PriceCreateParams::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PriceCreateParams::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + package_config: Orb::Models::PriceCreateParams::PackageConfig, + matrix_config: Orb::Models::PriceCreateParams::MatrixConfig, + matrix_with_allocation_config: Orb::Models::PriceCreateParams::MatrixWithAllocationConfig, + tiered_config: Orb::Models::PriceCreateParams::TieredConfig, + tiered_bps_config: Orb::Models::PriceCreateParams::TieredBpsConfig, + bps_config: Orb::Models::PriceCreateParams::BpsConfig, + bulk_bps_config: Orb::Models::PriceCreateParams::BulkBpsConfig, + bulk_config: Orb::Models::PriceCreateParams::BulkConfig, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + tiered_package_config: T::Hash[Symbol, T.anything], + grouped_tiered_config: T::Hash[Symbol, T.anything], + max_group_tiered_package_config: T::Hash[Symbol, T.anything], + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + package_with_allocation_config: T::Hash[Symbol, T.anything], + tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], + unit_with_percent_config: T::Hash[Symbol, T.anything], + tiered_with_proration_config: T::Hash[Symbol, T.anything], + unit_with_proration_config: T::Hash[Symbol, T.anything], + grouped_allocation_config: T::Hash[Symbol, T.anything], + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], + matrix_with_display_name_config: T::Hash[Symbol, T.anything], + bulk_with_proration_config: T::Hash[Symbol, T.anything], + grouped_tiered_package_config: T::Hash[Symbol, T.anything], + scalable_matrix_with_unit_pricing_config: T::Hash[Symbol, T.anything], + scalable_matrix_with_tiered_pricing_config: T::Hash[Symbol, T.anything] + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(Orb::Models::PriceCreateParams::UnitConfig) } + attr_accessor :unit_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig { returns(T.nilable(Orb::Models::PriceCreateParams::BillingCycleConfiguration)) } + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig { returns(T.nilable(Orb::Models::PriceCreateParams::InvoicingCycleConfiguration)) } + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(Orb::Models::PriceCreateParams::PackageConfig) } + attr_accessor :package_config + + sig { returns(Orb::Models::PriceCreateParams::MatrixConfig) } + attr_accessor :matrix_config + + sig { returns(Orb::Models::PriceCreateParams::MatrixWithAllocationConfig) } + attr_accessor :matrix_with_allocation_config + + sig { returns(Orb::Models::PriceCreateParams::TieredConfig) } + attr_accessor :tiered_config + + sig { returns(Orb::Models::PriceCreateParams::TieredBpsConfig) } + attr_accessor :tiered_bps_config + + sig { returns(Orb::Models::PriceCreateParams::BpsConfig) } + attr_accessor :bps_config + + sig { returns(Orb::Models::PriceCreateParams::BulkBpsConfig) } + attr_accessor :bulk_bps_config + + sig { returns(Orb::Models::PriceCreateParams::BulkConfig) } + attr_accessor :bulk_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :threshold_total_amount_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_package_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_tiered_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :max_group_tiered_package_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_with_minimum_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :package_with_allocation_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_package_with_minimum_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :unit_with_percent_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_with_proration_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :unit_with_proration_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_allocation_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_with_prorated_minimum_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_with_metered_minimum_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :matrix_with_display_name_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :bulk_with_proration_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_tiered_package_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :scalable_matrix_with_unit_pricing_config + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :scalable_matrix_with_tiered_pricing_config + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + unit_config: Orb::Models::PriceCreateParams::UnitConfig, + package_config: Orb::Models::PriceCreateParams::PackageConfig, + matrix_config: Orb::Models::PriceCreateParams::MatrixConfig, + matrix_with_allocation_config: Orb::Models::PriceCreateParams::MatrixWithAllocationConfig, + tiered_config: Orb::Models::PriceCreateParams::TieredConfig, + tiered_bps_config: Orb::Models::PriceCreateParams::TieredBpsConfig, + bps_config: Orb::Models::PriceCreateParams::BpsConfig, + bulk_bps_config: Orb::Models::PriceCreateParams::BulkBpsConfig, + bulk_config: Orb::Models::PriceCreateParams::BulkConfig, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + tiered_package_config: T::Hash[Symbol, T.anything], + grouped_tiered_config: T::Hash[Symbol, T.anything], + max_group_tiered_package_config: T::Hash[Symbol, T.anything], + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + package_with_allocation_config: T::Hash[Symbol, T.anything], + tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], + unit_with_percent_config: T::Hash[Symbol, T.anything], + tiered_with_proration_config: T::Hash[Symbol, T.anything], + unit_with_proration_config: T::Hash[Symbol, T.anything], + grouped_allocation_config: T::Hash[Symbol, T.anything], + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], + matrix_with_display_name_config: T::Hash[Symbol, T.anything], + bulk_with_proration_config: T::Hash[Symbol, T.anything], + grouped_tiered_package_config: T::Hash[Symbol, T.anything], + scalable_matrix_with_unit_pricing_config: T::Hash[Symbol, T.anything], + scalable_matrix_with_tiered_pricing_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PriceCreateParams::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PriceCreateParams::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + model_type:, + name:, + unit_config:, + package_config:, + matrix_config:, + matrix_with_allocation_config:, + tiered_config:, + tiered_bps_config:, + bps_config:, + bulk_bps_config:, + bulk_config:, + threshold_total_amount_config:, + tiered_package_config:, + grouped_tiered_config:, + max_group_tiered_package_config:, + tiered_with_minimum_config:, + package_with_allocation_config:, + tiered_package_with_minimum_config:, + unit_with_percent_config:, + tiered_with_proration_config:, + unit_with_proration_config:, + grouped_allocation_config:, + grouped_with_prorated_minimum_config:, + grouped_with_metered_minimum_config:, + matrix_with_display_name_config:, + bulk_with_proration_config:, + grouped_tiered_package_config:, + scalable_matrix_with_unit_pricing_config:, + scalable_matrix_with_tiered_pricing_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::PriceCreateParams::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class ModelType < Orb::Enum + abstract! + + SCALABLE_MATRIX_WITH_TIERED_PRICING = :scalable_matrix_with_tiered_pricing + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class UnitConfig < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(unit_amount: String).void } + def initialize(unit_amount:); end + + sig { returns(Orb::Models::PriceCreateParams::UnitConfig::Shape) } + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::PriceCreateParams::BillingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig { returns(Orb::Models::PriceCreateParams::InvoicingCycleConfiguration::Shape) } + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class PackageConfig < Orb::BaseModel + Shape = T.type_alias { {package_amount: String, package_size: Integer} } + + sig { returns(String) } + attr_accessor :package_amount + + sig { returns(Integer) } + attr_accessor :package_size + + sig { params(package_amount: String, package_size: Integer).void } + def initialize(package_amount:, package_size:); end + + sig { returns(Orb::Models::PriceCreateParams::PackageConfig::Shape) } + def to_h; end + end + + class MatrixConfig < Orb::BaseModel + Shape = T.type_alias do + { + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::PriceCreateParams::MatrixConfig::MatrixValue] + } + end + + sig { returns(String) } + attr_accessor :default_unit_amount + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimensions + + sig { returns(T::Array[Orb::Models::PriceCreateParams::MatrixConfig::MatrixValue]) } + attr_accessor :matrix_values + + sig do + params( + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::PriceCreateParams::MatrixConfig::MatrixValue] + ).void + end + def initialize(default_unit_amount:, dimensions:, matrix_values:); end + + sig { returns(Orb::Models::PriceCreateParams::MatrixConfig::Shape) } + def to_h; end + + class MatrixValue < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[T.nilable(String)], unit_amount: String} } + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(dimension_values: T::Array[T.nilable(String)], unit_amount: String).void } + def initialize(dimension_values:, unit_amount:); end + + sig { returns(Orb::Models::PriceCreateParams::MatrixConfig::MatrixValue::Shape) } + def to_h; end + end + end + + class MatrixWithAllocationConfig < Orb::BaseModel + Shape = T.type_alias do + { + allocation: Float, + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::PriceCreateParams::MatrixWithAllocationConfig::MatrixValue] + } + end + + sig { returns(Float) } + attr_accessor :allocation + + sig { returns(String) } + attr_accessor :default_unit_amount + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimensions + + sig { returns(T::Array[Orb::Models::PriceCreateParams::MatrixWithAllocationConfig::MatrixValue]) } + attr_accessor :matrix_values + + sig do + params( + allocation: Float, + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::PriceCreateParams::MatrixWithAllocationConfig::MatrixValue] + ).void + end + def initialize(allocation:, default_unit_amount:, dimensions:, matrix_values:); end + + sig { returns(Orb::Models::PriceCreateParams::MatrixWithAllocationConfig::Shape) } + def to_h; end + + class MatrixValue < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[T.nilable(String)], unit_amount: String} } + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(dimension_values: T::Array[T.nilable(String)], unit_amount: String).void } + def initialize(dimension_values:, unit_amount:); end + + sig { returns(Orb::Models::PriceCreateParams::MatrixWithAllocationConfig::MatrixValue::Shape) } + def to_h; end + end + end + + class TieredConfig < Orb::BaseModel + Shape = T.type_alias { {tiers: T::Array[Orb::Models::PriceCreateParams::TieredConfig::Tier]} } + + sig { returns(T::Array[Orb::Models::PriceCreateParams::TieredConfig::Tier]) } + attr_accessor :tiers + + sig { params(tiers: T::Array[Orb::Models::PriceCreateParams::TieredConfig::Tier]).void } + def initialize(tiers:); end + + sig { returns(Orb::Models::PriceCreateParams::TieredConfig::Shape) } + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias { {first_unit: Float, unit_amount: String, last_unit: T.nilable(Float)} } + + sig { returns(Float) } + attr_accessor :first_unit + + sig { returns(String) } + attr_accessor :unit_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :last_unit + + sig { params(first_unit: Float, unit_amount: String, last_unit: T.nilable(Float)).void } + def initialize(first_unit:, unit_amount:, last_unit: nil); end + + sig { returns(Orb::Models::PriceCreateParams::TieredConfig::Tier::Shape) } + def to_h; end + end + end + + class TieredBpsConfig < Orb::BaseModel + Shape = T.type_alias { {tiers: T::Array[Orb::Models::PriceCreateParams::TieredBpsConfig::Tier]} } + + sig { returns(T::Array[Orb::Models::PriceCreateParams::TieredBpsConfig::Tier]) } + attr_accessor :tiers + + sig { params(tiers: T::Array[Orb::Models::PriceCreateParams::TieredBpsConfig::Tier]).void } + def initialize(tiers:); end + + sig { returns(Orb::Models::PriceCreateParams::TieredBpsConfig::Shape) } + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias do + { + bps: Float, + minimum_amount: String, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + } + end + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig do + params( + bps: Float, + minimum_amount: String, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + ).void + end + def initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil); end + + sig { returns(Orb::Models::PriceCreateParams::TieredBpsConfig::Tier::Shape) } + def to_h; end + end + end + + class BpsConfig < Orb::BaseModel + Shape = T.type_alias { {bps: Float, per_unit_maximum: T.nilable(String)} } + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig { params(bps: Float, per_unit_maximum: T.nilable(String)).void } + def initialize(bps:, per_unit_maximum: nil); end + + sig { returns(Orb::Models::PriceCreateParams::BpsConfig::Shape) } + def to_h; end + end + + class BulkBpsConfig < Orb::BaseModel + Shape = T.type_alias { {tiers: T::Array[Orb::Models::PriceCreateParams::BulkBpsConfig::Tier]} } + + sig { returns(T::Array[Orb::Models::PriceCreateParams::BulkBpsConfig::Tier]) } + attr_accessor :tiers + + sig { params(tiers: T::Array[Orb::Models::PriceCreateParams::BulkBpsConfig::Tier]).void } + def initialize(tiers:); end + + sig { returns(Orb::Models::PriceCreateParams::BulkBpsConfig::Shape) } + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias do + {bps: Float, maximum_amount: T.nilable(String), per_unit_maximum: T.nilable(String)} + end + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig do + params(bps: Float, maximum_amount: T.nilable(String), per_unit_maximum: T.nilable(String)).void + end + def initialize(bps:, maximum_amount: nil, per_unit_maximum: nil); end + + sig { returns(Orb::Models::PriceCreateParams::BulkBpsConfig::Tier::Shape) } + def to_h; end + end + end + + class BulkConfig < Orb::BaseModel + Shape = T.type_alias { {tiers: T::Array[Orb::Models::PriceCreateParams::BulkConfig::Tier]} } + + sig { returns(T::Array[Orb::Models::PriceCreateParams::BulkConfig::Tier]) } + attr_accessor :tiers + + sig { params(tiers: T::Array[Orb::Models::PriceCreateParams::BulkConfig::Tier]).void } + def initialize(tiers:); end + + sig { returns(Orb::Models::PriceCreateParams::BulkConfig::Shape) } + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String, maximum_units: T.nilable(Float)} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :maximum_units + + sig { params(unit_amount: String, maximum_units: T.nilable(Float)).void } + def initialize(unit_amount:, maximum_units: nil); end + + sig { returns(Orb::Models::PriceCreateParams::BulkConfig::Tier::Shape) } + def to_h; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/price_evaluate_params.rbi b/rbi/lib/orb/models/price_evaluate_params.rbi new file mode 100644 index 00000000..edeca41f --- /dev/null +++ b/rbi/lib/orb/models/price_evaluate_params.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Orb + module Models + class PriceEvaluateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + timeframe_end: Time, + timeframe_start: Time, + customer_id: T.nilable(String), + external_customer_id: T.nilable(String), + filter: T.nilable(String), + grouping_keys: T::Array[String] + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(Time) } + attr_accessor :timeframe_end + + sig { returns(Time) } + attr_accessor :timeframe_start + + sig { returns(T.nilable(String)) } + attr_accessor :customer_id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { returns(T.nilable(String)) } + attr_accessor :filter + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :grouping_keys + + sig { params(grouping_keys: T::Array[String]).void } + attr_writer :grouping_keys + + sig do + params( + timeframe_end: Time, + timeframe_start: Time, + customer_id: T.nilable(String), + external_customer_id: T.nilable(String), + filter: T.nilable(String), + grouping_keys: T::Array[String], + request_options: Orb::RequestOpts + ).void + end + def initialize( + timeframe_end:, + timeframe_start:, + customer_id: nil, + external_customer_id: nil, + filter: nil, + grouping_keys: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::PriceEvaluateParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/price_evaluate_response.rbi b/rbi/lib/orb/models/price_evaluate_response.rbi new file mode 100644 index 00000000..51279746 --- /dev/null +++ b/rbi/lib/orb/models/price_evaluate_response.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class PriceEvaluateResponse < Orb::BaseModel + Shape = T.type_alias { {data: T::Array[Orb::Models::EvaluatePriceGroup]} } + + sig { returns(T::Array[Orb::Models::EvaluatePriceGroup]) } + attr_accessor :data + + sig { params(data: T::Array[Orb::Models::EvaluatePriceGroup]).void } + def initialize(data:); end + + sig { returns(Orb::Models::PriceEvaluateResponse::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/price_fetch_params.rbi b/rbi/lib/orb/models/price_fetch_params.rbi new file mode 100644 index 00000000..a517280b --- /dev/null +++ b/rbi/lib/orb/models/price_fetch_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class PriceFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::PriceFetchParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/price_list_params.rbi b/rbi/lib/orb/models/price_list_params.rbi new file mode 100644 index 00000000..2e173cf1 --- /dev/null +++ b/rbi/lib/orb/models/price_list_params.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Orb + module Models + class PriceListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all({cursor: T.nilable(String), limit: Integer}, Orb::RequestParameters::Shape) + end + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { params(cursor: T.nilable(String), limit: Integer, request_options: Orb::RequestOpts).void } + def initialize(cursor: nil, limit: nil, request_options: {}); end + + sig { returns(Orb::Models::PriceListParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/price_update_params.rbi b/rbi/lib/orb/models/price_update_params.rbi new file mode 100644 index 00000000..1ae28e48 --- /dev/null +++ b/rbi/lib/orb/models/price_update_params.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Orb + module Models + class PriceUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all({metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])}, Orb::RequestParameters::Shape) + end + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).void + end + def initialize(metadata: nil, request_options: {}); end + + sig { returns(Orb::Models::PriceUpdateParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/prices/external_price_id_fetch_params.rbi b/rbi/lib/orb/models/prices/external_price_id_fetch_params.rbi new file mode 100644 index 00000000..15a4b6dd --- /dev/null +++ b/rbi/lib/orb/models/prices/external_price_id_fetch_params.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module Orb + module Models + module Prices + class ExternalPriceIDFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::Prices::ExternalPriceIDFetchParams::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/prices/external_price_id_update_params.rbi b/rbi/lib/orb/models/prices/external_price_id_update_params.rbi new file mode 100644 index 00000000..76cc7a84 --- /dev/null +++ b/rbi/lib/orb/models/prices/external_price_id_update_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Orb + module Models + module Prices + class ExternalPriceIDUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all({metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])}, Orb::RequestParameters::Shape) + end + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).void + end + def initialize(metadata: nil, request_options: {}); end + + sig { returns(Orb::Models::Prices::ExternalPriceIDUpdateParams::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription.rbi b/rbi/lib/orb/models/subscription.rbi new file mode 100644 index 00000000..a332ef5c --- /dev/null +++ b/rbi/lib/orb/models/subscription.rbi @@ -0,0 +1,1007 @@ +# typed: strong + +module Orb + module Models + class Subscription < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::Subscription::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::Subscription::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::Subscription::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::Subscription::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::Subscription::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::Subscription::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::Subscription::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::Subscription::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::Subscription::TrialInfo + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Integer)) } + attr_accessor :active_plan_phase_order + + sig { returns(T::Array[Orb::Models::Subscription::AdjustmentInterval]) } + attr_accessor :adjustment_intervals + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig { returns(Orb::Models::Subscription::BillingCycleAnchorConfiguration) } + attr_accessor :billing_cycle_anchor_configuration + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(Orb::Models::Customer) } + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :default_invoice_memo + + sig { returns(T::Array[Orb::Models::Subscription::DiscountInterval::Variants]) } + attr_accessor :discount_intervals + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(T::Array[Orb::Models::Subscription::FixedFeeQuantitySchedule]) } + attr_accessor :fixed_fee_quantity_schedule + + sig { returns(T.nilable(String)) } + attr_accessor :invoicing_threshold + + sig { returns(T::Array[Orb::Models::Subscription::MaximumInterval]) } + attr_accessor :maximum_intervals + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T::Array[Orb::Models::Subscription::MinimumInterval]) } + attr_accessor :minimum_intervals + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(Orb::Models::Plan) } + attr_accessor :plan + + sig { returns(T::Array[Orb::Models::Subscription::PriceInterval]) } + attr_accessor :price_intervals + + sig { returns(T.nilable(Orb::Models::Subscription::RedeemedCoupon)) } + attr_accessor :redeemed_coupon + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Orb::Models::Subscription::TrialInfo) } + attr_accessor :trial_info + + sig do + params( + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::Subscription::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::Subscription::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::Subscription::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::Subscription::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::Subscription::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::Subscription::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::Subscription::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::Subscription::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::Subscription::TrialInfo + ).void + end + def initialize( + id:, + active_plan_phase_order:, + adjustment_intervals:, + auto_collection:, + billing_cycle_anchor_configuration:, + billing_cycle_day:, + created_at:, + current_billing_period_end_date:, + current_billing_period_start_date:, + customer:, + default_invoice_memo:, + discount_intervals:, + end_date:, + fixed_fee_quantity_schedule:, + invoicing_threshold:, + maximum_intervals:, + metadata:, + minimum_intervals:, + net_terms:, + plan:, + price_intervals:, + redeemed_coupon:, + start_date:, + status:, + trial_info: + ); end + + sig { returns(Orb::Models::Subscription::Shape) } + def to_h; end + + class AdjustmentInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment: Orb::Models::Subscription::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Orb::Models::Subscription::AdjustmentInterval::Adjustment::Variants) } + attr_accessor :adjustment + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + adjustment: Orb::Models::Subscription::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + ).void + end + def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:); end + + sig { returns(Orb::Models::Subscription::AdjustmentInterval::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, + Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, + Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, + Orb::Models::Subscription::AdjustmentInterval::Adjustment::MinimumAdjustment, + Orb::Models::Subscription::AdjustmentInterval::Adjustment::MaximumAdjustment + ) + end + + class AmountDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + amount_discount:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + adjustment_type: :amount_discount + ); end + + sig do + returns(Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscountAdjustment::Shape) + end + def to_h; end + end + + class PercentageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + percentage_discount:, + plan_phase_order:, + reason:, + adjustment_type: :percentage_discount + ); end + + sig do + returns(Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment::Shape) + end + def to_h; end + end + + class UsageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float, + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + usage_discount:, + adjustment_type: :usage_discount + ); end + + sig do + returns(Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscountAdjustment::Shape) + end + def to_h; end + end + + class MinimumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + item_id:, + minimum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :minimum + ); end + + sig do + returns(Orb::Models::Subscription::AdjustmentInterval::Adjustment::MinimumAdjustment::Shape) + end + def to_h; end + end + + class MaximumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + maximum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :maximum + ); end + + sig do + returns(Orb::Models::Subscription::AdjustmentInterval::Adjustment::MaximumAdjustment::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + ], + [ + Symbol, + Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + ], + [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscountAdjustment], + [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::MinimumAdjustment], + [Symbol, Orb::Models::Subscription::AdjustmentInterval::Adjustment::MaximumAdjustment] + ] + ) + end + private_class_method def self.variants; end + end + end + + class BillingCycleAnchorConfiguration < Orb::BaseModel + Shape = T.type_alias { {day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)} } + + sig { returns(Integer) } + attr_accessor :day + + sig { returns(T.nilable(Integer)) } + attr_accessor :month + + sig { returns(T.nilable(Integer)) } + attr_accessor :year + + sig { params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).void } + def initialize(day:, month: nil, year: nil); end + + sig { returns(Orb::Models::Subscription::BillingCycleAnchorConfiguration::Shape) } + def to_h; end + end + + class DiscountInterval < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::Subscription::DiscountInterval::AmountDiscountInterval, + Orb::Models::Subscription::DiscountInterval::PercentageDiscountInterval, + Orb::Models::Subscription::DiscountInterval::UsageDiscountInterval + ) + end + + class AmountDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + amount_discount:, + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + discount_type: :amount + ); end + + sig { returns(Orb::Models::Subscription::DiscountInterval::AmountDiscountInterval::Shape) } + def to_h; end + end + + class PercentageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + percentage_discount:, + start_date:, + discount_type: :percentage + ); end + + sig { returns(Orb::Models::Subscription::DiscountInterval::PercentageDiscountInterval::Shape) } + def to_h; end + end + + class UsageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + usage_discount:, + discount_type: :usage + ); end + + sig { returns(Orb::Models::Subscription::DiscountInterval::UsageDiscountInterval::Shape) } + def to_h; end + end + + sig do + override.returns( + [ + [Symbol, Orb::Models::Subscription::DiscountInterval::AmountDiscountInterval], + [Symbol, Orb::Models::Subscription::DiscountInterval::PercentageDiscountInterval], + [Symbol, Orb::Models::Subscription::DiscountInterval::UsageDiscountInterval] + ] + ) + end + private_class_method def self.variants; end + end + + class FixedFeeQuantitySchedule < Orb::BaseModel + Shape = T.type_alias do + {end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time} + end + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time).void } + def initialize(end_date:, price_id:, quantity:, start_date:); end + + sig { returns(Orb::Models::Subscription::FixedFeeQuantitySchedule::Shape) } + def to_h; end + end + + class MaximumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + maximum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::Subscription::MaximumInterval::Shape) } + def to_h; end + end + + class MinimumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + minimum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::Subscription::MinimumInterval::Shape) } + def to_h; end + end + + class PriceInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::Subscription::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig do + returns(T.nilable(T::Array[Orb::Models::Subscription::PriceInterval::FixedFeeQuantityTransition])) + end + attr_accessor :fixed_fee_quantity_transitions + + sig { returns(Orb::Models::Price::Variants) } + attr_accessor :price + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::Subscription::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + ).void + end + def initialize( + id:, + billing_cycle_day:, + current_billing_period_end_date:, + current_billing_period_start_date:, + end_date:, + fixed_fee_quantity_transitions:, + price:, + start_date: + ); end + + sig { returns(Orb::Models::Subscription::PriceInterval::Shape) } + def to_h; end + + class FixedFeeQuantityTransition < Orb::BaseModel + Shape = T.type_alias { {effective_date: Time, price_id: String, quantity: Integer} } + + sig { returns(Time) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Integer) } + attr_accessor :quantity + + sig { params(effective_date: Time, price_id: String, quantity: Integer).void } + def initialize(effective_date:, price_id:, quantity:); end + + sig { returns(Orb::Models::Subscription::PriceInterval::FixedFeeQuantityTransition::Shape) } + def to_h; end + end + end + + class RedeemedCoupon < Orb::BaseModel + Shape = T.type_alias { {coupon_id: String, end_date: T.nilable(Time), start_date: Time} } + + sig { returns(String) } + attr_accessor :coupon_id + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(coupon_id: String, end_date: T.nilable(Time), start_date: Time).void } + def initialize(coupon_id:, end_date:, start_date:); end + + sig { returns(Orb::Models::Subscription::RedeemedCoupon::Shape) } + def to_h; end + end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TrialInfo < Orb::BaseModel + Shape = T.type_alias { {end_date: T.nilable(Time)} } + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { params(end_date: T.nilable(Time)).void } + def initialize(end_date:); end + + sig { returns(Orb::Models::Subscription::TrialInfo::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_cancel_params.rbi b/rbi/lib/orb/models/subscription_cancel_params.rbi new file mode 100644 index 00000000..d41bf5c0 --- /dev/null +++ b/rbi/lib/orb/models/subscription_cancel_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Orb + module Models + class SubscriptionCancelParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all({cancel_option: Symbol, cancellation_date: T.nilable(Time)}, Orb::RequestParameters::Shape) + end + + sig { returns(Symbol) } + attr_accessor :cancel_option + + sig { returns(T.nilable(Time)) } + attr_accessor :cancellation_date + + sig do + params( + cancel_option: Symbol, + cancellation_date: T.nilable(Time), + request_options: Orb::RequestOpts + ).void + end + def initialize(cancel_option:, cancellation_date: nil, request_options: {}); end + + sig { returns(Orb::Models::SubscriptionCancelParams::Shape) } + def to_h; end + + class CancelOption < Orb::Enum + abstract! + + END_OF_SUBSCRIPTION_TERM = :end_of_subscription_term + IMMEDIATE = :immediate + REQUESTED_DATE = :requested_date + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_cancel_response.rbi b/rbi/lib/orb/models/subscription_cancel_response.rbi new file mode 100644 index 00000000..3b712e3e --- /dev/null +++ b/rbi/lib/orb/models/subscription_cancel_response.rbi @@ -0,0 +1,1027 @@ +# typed: strong + +module Orb + module Models + class SubscriptionCancelResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionCancelResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionCancelResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionCancelResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionCancelResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionCancelResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionCancelResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionCancelResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionCancelResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionCancelResponse::TrialInfo + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Integer)) } + attr_accessor :active_plan_phase_order + + sig { returns(T::Array[Orb::Models::SubscriptionCancelResponse::AdjustmentInterval]) } + attr_accessor :adjustment_intervals + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig { returns(Orb::Models::SubscriptionCancelResponse::BillingCycleAnchorConfiguration) } + attr_accessor :billing_cycle_anchor_configuration + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(Orb::Models::Customer) } + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :default_invoice_memo + + sig { returns(T::Array[Orb::Models::SubscriptionCancelResponse::DiscountInterval::Variants]) } + attr_accessor :discount_intervals + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(T::Array[Orb::Models::SubscriptionCancelResponse::FixedFeeQuantitySchedule]) } + attr_accessor :fixed_fee_quantity_schedule + + sig { returns(T.nilable(String)) } + attr_accessor :invoicing_threshold + + sig { returns(T::Array[Orb::Models::SubscriptionCancelResponse::MaximumInterval]) } + attr_accessor :maximum_intervals + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T::Array[Orb::Models::SubscriptionCancelResponse::MinimumInterval]) } + attr_accessor :minimum_intervals + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(Orb::Models::Plan) } + attr_accessor :plan + + sig { returns(T::Array[Orb::Models::SubscriptionCancelResponse::PriceInterval]) } + attr_accessor :price_intervals + + sig { returns(T.nilable(Orb::Models::SubscriptionCancelResponse::RedeemedCoupon)) } + attr_accessor :redeemed_coupon + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Orb::Models::SubscriptionCancelResponse::TrialInfo) } + attr_accessor :trial_info + + sig do + params( + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionCancelResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionCancelResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionCancelResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionCancelResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionCancelResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionCancelResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionCancelResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionCancelResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionCancelResponse::TrialInfo + ).void + end + def initialize( + id:, + active_plan_phase_order:, + adjustment_intervals:, + auto_collection:, + billing_cycle_anchor_configuration:, + billing_cycle_day:, + created_at:, + current_billing_period_end_date:, + current_billing_period_start_date:, + customer:, + default_invoice_memo:, + discount_intervals:, + end_date:, + fixed_fee_quantity_schedule:, + invoicing_threshold:, + maximum_intervals:, + metadata:, + minimum_intervals:, + net_terms:, + plan:, + price_intervals:, + redeemed_coupon:, + start_date:, + status:, + trial_info: + ); end + + sig { returns(Orb::Models::SubscriptionCancelResponse::Shape) } + def to_h; end + + class AdjustmentInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment: Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::Variants) } + attr_accessor :adjustment + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + adjustment: Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + ).void + end + def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, + Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, + Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, + Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, + Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ) + end + + class AmountDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + amount_discount:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + adjustment_type: :amount_discount + ); end + + sig do + returns(Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment::Shape) + end + def to_h; end + end + + class PercentageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + percentage_discount:, + plan_phase_order:, + reason:, + adjustment_type: :percentage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment::Shape) + end + def to_h; end + end + + class UsageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float, + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + usage_discount:, + adjustment_type: :usage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment::Shape) + end + def to_h; end + end + + class MinimumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + item_id:, + minimum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :minimum + ); end + + sig do + returns(Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MinimumAdjustment::Shape) + end + def to_h; end + end + + class MaximumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + maximum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :maximum + ); end + + sig do + returns(Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MaximumAdjustment::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ] + ] + ) + end + private_class_method def self.variants; end + end + end + + class BillingCycleAnchorConfiguration < Orb::BaseModel + Shape = T.type_alias { {day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)} } + + sig { returns(Integer) } + attr_accessor :day + + sig { returns(T.nilable(Integer)) } + attr_accessor :month + + sig { returns(T.nilable(Integer)) } + attr_accessor :year + + sig { params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).void } + def initialize(day:, month: nil, year: nil); end + + sig { returns(Orb::Models::SubscriptionCancelResponse::BillingCycleAnchorConfiguration::Shape) } + def to_h; end + end + + class DiscountInterval < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionCancelResponse::DiscountInterval::AmountDiscountInterval, + Orb::Models::SubscriptionCancelResponse::DiscountInterval::PercentageDiscountInterval, + Orb::Models::SubscriptionCancelResponse::DiscountInterval::UsageDiscountInterval + ) + end + + class AmountDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + amount_discount:, + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + discount_type: :amount + ); end + + sig do + returns(Orb::Models::SubscriptionCancelResponse::DiscountInterval::AmountDiscountInterval::Shape) + end + def to_h; end + end + + class PercentageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + percentage_discount:, + start_date:, + discount_type: :percentage + ); end + + sig do + returns(Orb::Models::SubscriptionCancelResponse::DiscountInterval::PercentageDiscountInterval::Shape) + end + def to_h; end + end + + class UsageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + usage_discount:, + discount_type: :usage + ); end + + sig do + returns(Orb::Models::SubscriptionCancelResponse::DiscountInterval::UsageDiscountInterval::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionCancelResponse::DiscountInterval::AmountDiscountInterval + ], + [Symbol, Orb::Models::SubscriptionCancelResponse::DiscountInterval::PercentageDiscountInterval], + [Symbol, Orb::Models::SubscriptionCancelResponse::DiscountInterval::UsageDiscountInterval] + ] + ) + end + private_class_method def self.variants; end + end + + class FixedFeeQuantitySchedule < Orb::BaseModel + Shape = T.type_alias do + {end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time} + end + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time).void } + def initialize(end_date:, price_id:, quantity:, start_date:); end + + sig { returns(Orb::Models::SubscriptionCancelResponse::FixedFeeQuantitySchedule::Shape) } + def to_h; end + end + + class MaximumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + maximum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionCancelResponse::MaximumInterval::Shape) } + def to_h; end + end + + class MinimumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + minimum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionCancelResponse::MinimumInterval::Shape) } + def to_h; end + end + + class PriceInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionCancelResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionCancelResponse::PriceInterval::FixedFeeQuantityTransition])) + end + attr_accessor :fixed_fee_quantity_transitions + + sig { returns(Orb::Models::Price::Variants) } + attr_accessor :price + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionCancelResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + ).void + end + def initialize( + id:, + billing_cycle_day:, + current_billing_period_end_date:, + current_billing_period_start_date:, + end_date:, + fixed_fee_quantity_transitions:, + price:, + start_date: + ); end + + sig { returns(Orb::Models::SubscriptionCancelResponse::PriceInterval::Shape) } + def to_h; end + + class FixedFeeQuantityTransition < Orb::BaseModel + Shape = T.type_alias { {effective_date: Time, price_id: String, quantity: Integer} } + + sig { returns(Time) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Integer) } + attr_accessor :quantity + + sig { params(effective_date: Time, price_id: String, quantity: Integer).void } + def initialize(effective_date:, price_id:, quantity:); end + + sig do + returns(Orb::Models::SubscriptionCancelResponse::PriceInterval::FixedFeeQuantityTransition::Shape) + end + def to_h; end + end + end + + class RedeemedCoupon < Orb::BaseModel + Shape = T.type_alias { {coupon_id: String, end_date: T.nilable(Time), start_date: Time} } + + sig { returns(String) } + attr_accessor :coupon_id + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(coupon_id: String, end_date: T.nilable(Time), start_date: Time).void } + def initialize(coupon_id:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionCancelResponse::RedeemedCoupon::Shape) } + def to_h; end + end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TrialInfo < Orb::BaseModel + Shape = T.type_alias { {end_date: T.nilable(Time)} } + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { params(end_date: T.nilable(Time)).void } + def initialize(end_date:); end + + sig { returns(Orb::Models::SubscriptionCancelResponse::TrialInfo::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_create_params.rbi b/rbi/lib/orb/models/subscription_create_params.rbi new file mode 100644 index 00000000..63e660a9 --- /dev/null +++ b/rbi/lib/orb/models/subscription_create_params.rbi @@ -0,0 +1,8756 @@ +# typed: strong + +module Orb + module Models + class SubscriptionCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + add_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::AddAdjustment]), + add_prices: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::AddPrice]), + align_billing_with_subscription_start_date: T::Boolean, + auto_collection: T.nilable(T::Boolean), + aws_region: T.nilable(String), + billing_cycle_anchor_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::BillingCycleAnchorConfiguration), + coupon_redemption_code: T.nilable(String), + credits_overage_rate: T.nilable(Float), + customer_id: T.nilable(String), + default_invoice_memo: T.nilable(String), + end_date: T.nilable(Time), + external_customer_id: T.nilable(String), + external_marketplace: T.nilable(Symbol), + external_marketplace_reporting_id: T.nilable(String), + external_plan_id: T.nilable(String), + filter: T.nilable(String), + initial_phase_order: T.nilable(Integer), + invoicing_threshold: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + net_terms: T.nilable(Integer), + per_credit_overage_amount: T.nilable(Float), + plan_id: T.nilable(String), + plan_version_number: T.nilable(Integer), + price_overrides: T.nilable(T::Array[T.anything]), + remove_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::RemoveAdjustment]), + remove_prices: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::RemovePrice]), + replace_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::ReplaceAdjustment]), + replace_prices: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice]), + start_date: T.nilable(Time), + trial_duration_days: T.nilable(Integer) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::AddAdjustment])) } + attr_accessor :add_adjustments + + sig { returns(T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::AddPrice])) } + attr_accessor :add_prices + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :align_billing_with_subscription_start_date + + sig { params(align_billing_with_subscription_start_date: T::Boolean).void } + attr_writer :align_billing_with_subscription_start_date + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig { returns(T.nilable(String)) } + attr_accessor :aws_region + + sig { returns(T.nilable(Orb::Models::SubscriptionCreateParams::BillingCycleAnchorConfiguration)) } + attr_accessor :billing_cycle_anchor_configuration + + sig { returns(T.nilable(String)) } + attr_accessor :coupon_redemption_code + + sig { returns(T.nilable(Float)) } + attr_accessor :credits_overage_rate + + sig { returns(T.nilable(String)) } + attr_accessor :customer_id + + sig { returns(T.nilable(String)) } + attr_accessor :default_invoice_memo + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { returns(T.nilable(Symbol)) } + attr_accessor :external_marketplace + + sig { returns(T.nilable(String)) } + attr_accessor :external_marketplace_reporting_id + + sig { returns(T.nilable(String)) } + attr_accessor :external_plan_id + + sig { returns(T.nilable(String)) } + attr_accessor :filter + + sig { returns(T.nilable(Integer)) } + attr_accessor :initial_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :invoicing_threshold + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(Integer)) } + attr_accessor :net_terms + + sig { returns(T.nilable(Float)) } + attr_accessor :per_credit_overage_amount + + sig { returns(T.nilable(String)) } + attr_accessor :plan_id + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_version_number + + sig { returns(T.nilable(T::Array[T.anything])) } + attr_accessor :price_overrides + + sig { returns(T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::RemoveAdjustment])) } + attr_accessor :remove_adjustments + + sig { returns(T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::RemovePrice])) } + attr_accessor :remove_prices + + sig { returns(T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::ReplaceAdjustment])) } + attr_accessor :replace_adjustments + + sig { returns(T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice])) } + attr_accessor :replace_prices + + sig { returns(T.nilable(Time)) } + attr_accessor :start_date + + sig { returns(T.nilable(Integer)) } + attr_accessor :trial_duration_days + + sig do + params( + add_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::AddAdjustment]), + add_prices: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::AddPrice]), + align_billing_with_subscription_start_date: T::Boolean, + auto_collection: T.nilable(T::Boolean), + aws_region: T.nilable(String), + billing_cycle_anchor_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::BillingCycleAnchorConfiguration), + coupon_redemption_code: T.nilable(String), + credits_overage_rate: T.nilable(Float), + customer_id: T.nilable(String), + default_invoice_memo: T.nilable(String), + end_date: T.nilable(Time), + external_customer_id: T.nilable(String), + external_marketplace: T.nilable(Symbol), + external_marketplace_reporting_id: T.nilable(String), + external_plan_id: T.nilable(String), + filter: T.nilable(String), + initial_phase_order: T.nilable(Integer), + invoicing_threshold: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + net_terms: T.nilable(Integer), + per_credit_overage_amount: T.nilable(Float), + plan_id: T.nilable(String), + plan_version_number: T.nilable(Integer), + price_overrides: T.nilable(T::Array[T.anything]), + remove_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::RemoveAdjustment]), + remove_prices: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::RemovePrice]), + replace_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::ReplaceAdjustment]), + replace_prices: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice]), + start_date: T.nilable(Time), + trial_duration_days: T.nilable(Integer), + request_options: Orb::RequestOpts + ).void + end + def initialize( + add_adjustments: nil, + add_prices: nil, + align_billing_with_subscription_start_date: nil, + auto_collection: nil, + aws_region: nil, + billing_cycle_anchor_configuration: nil, + coupon_redemption_code: nil, + credits_overage_rate: nil, + customer_id: nil, + default_invoice_memo: nil, + end_date: nil, + external_customer_id: nil, + external_marketplace: nil, + external_marketplace_reporting_id: nil, + external_plan_id: nil, + filter: nil, + initial_phase_order: nil, + invoicing_threshold: nil, + metadata: nil, + net_terms: nil, + per_credit_overage_amount: nil, + plan_id: nil, + plan_version_number: nil, + price_overrides: nil, + remove_adjustments: nil, + remove_prices: nil, + replace_adjustments: nil, + replace_prices: nil, + start_date: nil, + trial_duration_days: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::SubscriptionCreateParams::Shape) } + def to_h; end + + class AddAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + adjustment: Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::Variants, + end_date: T.nilable(Time), + plan_phase_order: T.nilable(Integer), + start_date: T.nilable(Time) + } + end + + sig { returns(Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::Variants) } + attr_accessor :adjustment + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(Time)) } + attr_accessor :start_date + + sig do + params( + adjustment: Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::Variants, + end_date: T.nilable(Time), + plan_phase_order: T.nilable(Integer), + start_date: T.nilable(Time) + ).void + end + def initialize(adjustment:, end_date: nil, plan_phase_order: nil, start_date: nil); end + + sig { returns(Orb::Models::SubscriptionCreateParams::AddAdjustment::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewPercentageDiscount, + Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewUsageDiscount, + Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewAmountDiscount, + Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMinimum, + Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMaximum + ) + end + + class NewPercentageDiscount < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + percentage_discount: Float, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + percentage_discount: Float, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + percentage_discount:, + is_invoice_level: nil, + adjustment_type: :percentage_discount + ) + end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewPercentageDiscount::Shape) + end + def to_h; end + end + + class NewUsageDiscount < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + usage_discount: Float, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(Float) } + attr_accessor :usage_discount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + usage_discount: Float, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + usage_discount:, + is_invoice_level: nil, + adjustment_type: :usage_discount + ) + end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewUsageDiscount::Shape) + end + def to_h; end + end + + class NewAmountDiscount < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + amount_discount:, + applies_to_price_ids:, + is_invoice_level: nil, + adjustment_type: :amount_discount + ) + end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewAmountDiscount::Shape) + end + def to_h; end + end + + class NewMinimum < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + item_id:, + minimum_amount:, + is_invoice_level: nil, + adjustment_type: :minimum + ) + end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMinimum::Shape) + end + def to_h; end + end + + class NewMaximum < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + maximum_amount: String, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + maximum_amount: String, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + maximum_amount:, + is_invoice_level: nil, + adjustment_type: :maximum + ) + end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMaximum::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewPercentageDiscount + ], + [Symbol, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewUsageDiscount], + [Symbol, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewAmountDiscount], + [Symbol, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMinimum], + [Symbol, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMaximum] + ] + ) + end + private_class_method def self.variants; end + end + end + + class AddPrice < Orb::BaseModel + Shape = T.type_alias do + { + discounts: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Discount]), + end_date: T.nilable(Time), + external_price_id: T.nilable(String), + maximum_amount: T.nilable(String), + minimum_amount: T.nilable(String), + plan_phase_order: T.nilable(Integer), + price: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::Variants), + price_id: T.nilable(String), + start_date: T.nilable(Time) + } + end + + sig { returns(T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Discount])) } + attr_accessor :discounts + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::Variants)) } + attr_accessor :price + + sig { returns(T.nilable(String)) } + attr_accessor :price_id + + sig { returns(T.nilable(Time)) } + attr_accessor :start_date + + sig do + params( + discounts: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Discount]), + end_date: T.nilable(Time), + external_price_id: T.nilable(String), + maximum_amount: T.nilable(String), + minimum_amount: T.nilable(String), + plan_phase_order: T.nilable(Integer), + price: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::Variants), + price_id: T.nilable(String), + start_date: T.nilable(Time) + ).void + end + def initialize( + discounts: nil, + end_date: nil, + external_price_id: nil, + maximum_amount: nil, + minimum_amount: nil, + plan_phase_order: nil, + price: nil, + price_id: nil, + start_date: nil + ); end + + sig { returns(Orb::Models::SubscriptionCreateParams::AddPrice::Shape) } + def to_h; end + + class Discount < Orb::BaseModel + Shape = T.type_alias do + { + discount_type: Symbol, + amount_discount: T.nilable(String), + percentage_discount: T.nilable(Float), + usage_discount: T.nilable(Float) + } + end + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(String)) } + attr_accessor :amount_discount + + sig { returns(T.nilable(Float)) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Float)) } + attr_accessor :usage_discount + + sig do + params( + discount_type: Symbol, + amount_discount: T.nilable(String), + percentage_discount: T.nilable(Float), + usage_discount: T.nilable(Float) + ).void + end + def initialize(discount_type:, amount_discount: nil, percentage_discount: nil, usage_discount: nil) + end + + sig { returns(Orb::Models::SubscriptionCreateParams::AddPrice::Discount::Shape) } + def to_h; end + + class DiscountType < Orb::Enum + abstract! + + PERCENTAGE = :percentage + USAGE = :usage + AMOUNT = :amount + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Price < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice + ) + end + + class NewSubscriptionUnitPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + unit_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig) + end + attr_accessor :unit_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + unit_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + unit_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :unit + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class UnitConfig < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(unit_amount: String).void } + def initialize(unit_amount:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig::Shape) + end + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + package_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig) + end + attr_accessor :package_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + package_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + package_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :package + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class PackageConfig < Orb::BaseModel + Shape = T.type_alias { {package_amount: String, package_size: Integer} } + + sig { returns(String) } + attr_accessor :package_amount + + sig { returns(Integer) } + attr_accessor :package_size + + sig { params(package_amount: String, package_size: Integer).void } + def initialize(package_amount:, package_size:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig::Shape) + end + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionMatrixPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + matrix_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig) + end + attr_accessor :matrix_config + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + matrix_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + matrix_config:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :matrix + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class MatrixConfig < Orb::BaseModel + Shape = T.type_alias do + { + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + } + end + + sig { returns(String) } + attr_accessor :default_unit_amount + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimensions + + sig do + returns(T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue]) + end + attr_accessor :matrix_values + + sig do + params( + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + ).void + end + def initialize(default_unit_amount:, dimensions:, matrix_values:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::Shape) + end + def to_h; end + + class MatrixValue < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[T.nilable(String)], unit_amount: String} } + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(dimension_values: T::Array[T.nilable(String)], unit_amount: String).void } + def initialize(dimension_values:, unit_amount:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTieredPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig) + end + attr_accessor :tiered_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TieredConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias { {first_unit: Float, unit_amount: String, last_unit: T.nilable(Float)} } + + sig { returns(Float) } + attr_accessor :first_unit + + sig { returns(String) } + attr_accessor :unit_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :last_unit + + sig { params(first_unit: Float, unit_amount: String, last_unit: T.nilable(Float)).void } + def initialize(first_unit:, unit_amount:, last_unit: nil); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTieredBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig) + end + attr_accessor :tiered_bps_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_bps_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered_bps + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TieredBpsConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias do + { + bps: Float, + minimum_amount: String, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + } + end + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig do + params( + bps: Float, + minimum_amount: String, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + ).void + end + def initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig, + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig) + end + attr_accessor :bps_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig, + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + bps_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :bps + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::Shape) + end + def to_h; end + + class BpsConfig < Orb::BaseModel + Shape = T.type_alias { {bps: Float, per_unit_maximum: T.nilable(String)} } + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig { params(bps: Float, per_unit_maximum: T.nilable(String)).void } + def initialize(bps:, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig::Shape) + end + def to_h; end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionBulkBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable( + T::Hash[Symbol, + T.nilable(String)] + ), + reference_id: T.nilable(String) + } + end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig) + end + attr_accessor :bulk_bps_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + bulk_bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + bulk_bps_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :bulk_bps + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::Shape) + end + def to_h; end + + class BulkBpsConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias do + {bps: Float, maximum_amount: T.nilable(String), per_unit_maximum: T.nilable(String)} + end + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig do + params( + bps: Float, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + ).void + end + def initialize(bps:, maximum_amount: nil, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier::Shape) + end + def to_h; end + end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionBulkPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig, + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig) + end + attr_accessor :bulk_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + bulk_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig, + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + bulk_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :bulk + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::Shape) + end + def to_h; end + + class BulkConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String, maximum_units: T.nilable(Float)} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :maximum_units + + sig { params(unit_amount: String, maximum_units: T.nilable(Float)).void } + def initialize(unit_amount:, maximum_units: nil); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier::Shape) + end + def to_h; end + end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionThresholdTotalAmountPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :threshold_total_amount_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + threshold_total_amount_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :threshold_total_amount + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTieredPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_package_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_package_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_package_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_package_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered_package + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTieredWithMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_with_minimum_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_with_minimum_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered_with_minimum + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionUnitWithPercentPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + unit_with_percent_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :unit_with_percent_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + unit_with_percent_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + unit_with_percent_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :unit_with_percent + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionPackageWithAllocationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + package_with_allocation_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :package_with_allocation_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + package_with_allocation_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + package_with_allocation_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :package_with_allocation + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTierWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_with_proration_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_with_proration_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered_with_proration + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionUnitWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + unit_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :unit_with_proration_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + unit_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + unit_with_proration_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :unit_with_proration + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionGroupedAllocationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + grouped_allocation_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_allocation_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + grouped_allocation_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + grouped_allocation_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :grouped_allocation + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionGroupedWithProratedMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_with_prorated_minimum_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + grouped_with_prorated_minimum_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :grouped_with_prorated_minimum + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionBulkWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_with_proration_config: T::Hash[Symbol, T.anything], + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :bulk_with_proration_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + bulk_with_proration_config: T::Hash[Symbol, T.anything], + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + bulk_with_proration_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :bulk_with_proration + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice + ], + [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice], + [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice], + [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice + ], + [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice], + [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice], + [Symbol, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice + ] + ] + ) + end + private_class_method def self.variants; end + end + end + + class BillingCycleAnchorConfiguration < Orb::BaseModel + Shape = T.type_alias { {day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)} } + + sig { returns(Integer) } + attr_accessor :day + + sig { returns(T.nilable(Integer)) } + attr_accessor :month + + sig { returns(T.nilable(Integer)) } + attr_accessor :year + + sig { params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).void } + def initialize(day:, month: nil, year: nil); end + + sig { returns(Orb::Models::SubscriptionCreateParams::BillingCycleAnchorConfiguration::Shape) } + def to_h; end + end + + class ExternalMarketplace < Orb::Enum + abstract! + + GOOGLE = T.let(:google, T.nilable(Symbol)) + AWS = T.let(:aws, T.nilable(Symbol)) + AZURE = T.let(:azure, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class RemoveAdjustment < Orb::BaseModel + Shape = T.type_alias { {adjustment_id: String} } + + sig { returns(String) } + attr_accessor :adjustment_id + + sig { params(adjustment_id: String).void } + def initialize(adjustment_id:); end + + sig { returns(Orb::Models::SubscriptionCreateParams::RemoveAdjustment::Shape) } + def to_h; end + end + + class RemovePrice < Orb::BaseModel + Shape = T.type_alias { {external_price_id: T.nilable(String), price_id: T.nilable(String)} } + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(String)) } + attr_accessor :price_id + + sig { params(external_price_id: T.nilable(String), price_id: T.nilable(String)).void } + def initialize(external_price_id: nil, price_id: nil); end + + sig { returns(Orb::Models::SubscriptionCreateParams::RemovePrice::Shape) } + def to_h; end + end + + class ReplaceAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + adjustment: Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::Variants, + replaces_adjustment_id: String + } + end + + sig { returns(Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::Variants) } + attr_accessor :adjustment + + sig { returns(String) } + attr_accessor :replaces_adjustment_id + + sig do + params( + adjustment: Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::Variants, + replaces_adjustment_id: String + ).void + end + def initialize(adjustment:, replaces_adjustment_id:); end + + sig { returns(Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount, + Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewUsageDiscount, + Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewAmountDiscount, + Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMinimum, + Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMaximum + ) + end + + class NewPercentageDiscount < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + percentage_discount: Float, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + percentage_discount: Float, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + percentage_discount:, + is_invoice_level: nil, + adjustment_type: :percentage_discount + ) + end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount::Shape) + end + def to_h; end + end + + class NewUsageDiscount < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + usage_discount: Float, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(Float) } + attr_accessor :usage_discount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + usage_discount: Float, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + usage_discount:, + is_invoice_level: nil, + adjustment_type: :usage_discount + ) + end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewUsageDiscount::Shape) + end + def to_h; end + end + + class NewAmountDiscount < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + amount_discount:, + applies_to_price_ids:, + is_invoice_level: nil, + adjustment_type: :amount_discount + ) + end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewAmountDiscount::Shape) + end + def to_h; end + end + + class NewMinimum < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + item_id:, + minimum_amount:, + is_invoice_level: nil, + adjustment_type: :minimum + ) + end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMinimum::Shape) + end + def to_h; end + end + + class NewMaximum < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + maximum_amount: String, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + maximum_amount: String, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + maximum_amount:, + is_invoice_level: nil, + adjustment_type: :maximum + ) + end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMaximum::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewUsageDiscount + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewAmountDiscount + ], + [Symbol, Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMinimum], + [Symbol, Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMaximum] + ] + ) + end + private_class_method def self.variants; end + end + end + + class ReplacePrice < Orb::BaseModel + Shape = T.type_alias do + { + replaces_price_id: String, + discounts: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount]), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + maximum_amount: T.nilable(String), + minimum_amount: T.nilable(String), + price: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Variants), + price_id: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :replaces_price_id + + sig { returns(T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount])) } + attr_accessor :discounts + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Variants)) } + attr_accessor :price + + sig { returns(T.nilable(String)) } + attr_accessor :price_id + + sig do + params( + replaces_price_id: String, + discounts: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount]), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + maximum_amount: T.nilable(String), + minimum_amount: T.nilable(String), + price: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::Variants), + price_id: T.nilable(String) + ).void + end + def initialize( + replaces_price_id:, + discounts: nil, + external_price_id: nil, + fixed_price_quantity: nil, + maximum_amount: nil, + minimum_amount: nil, + price: nil, + price_id: nil + ); end + + sig { returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Shape) } + def to_h; end + + class Discount < Orb::BaseModel + Shape = T.type_alias do + { + discount_type: Symbol, + amount_discount: T.nilable(String), + percentage_discount: T.nilable(Float), + usage_discount: T.nilable(Float) + } + end + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(String)) } + attr_accessor :amount_discount + + sig { returns(T.nilable(Float)) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Float)) } + attr_accessor :usage_discount + + sig do + params( + discount_type: Symbol, + amount_discount: T.nilable(String), + percentage_discount: T.nilable(Float), + usage_discount: T.nilable(Float) + ).void + end + def initialize(discount_type:, amount_discount: nil, percentage_discount: nil, usage_discount: nil) + end + + sig { returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount::Shape) } + def to_h; end + + class DiscountType < Orb::Enum + abstract! + + PERCENTAGE = :percentage + USAGE = :usage + AMOUNT = :amount + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Price < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice + ) + end + + class NewSubscriptionUnitPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + unit_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig) + end + attr_accessor :unit_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + unit_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + unit_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :unit + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class UnitConfig < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(unit_amount: String).void } + def initialize(unit_amount:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig::Shape) + end + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + package_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig) + end + attr_accessor :package_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + package_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + package_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :package + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class PackageConfig < Orb::BaseModel + Shape = T.type_alias { {package_amount: String, package_size: Integer} } + + sig { returns(String) } + attr_accessor :package_amount + + sig { returns(Integer) } + attr_accessor :package_size + + sig { params(package_amount: String, package_size: Integer).void } + def initialize(package_amount:, package_size:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig::Shape) + end + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionMatrixPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + matrix_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig) + end + attr_accessor :matrix_config + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + matrix_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + matrix_config:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :matrix + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class MatrixConfig < Orb::BaseModel + Shape = T.type_alias do + { + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + } + end + + sig { returns(String) } + attr_accessor :default_unit_amount + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimensions + + sig do + returns(T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue]) + end + attr_accessor :matrix_values + + sig do + params( + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + ).void + end + def initialize(default_unit_amount:, dimensions:, matrix_values:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::Shape) + end + def to_h; end + + class MatrixValue < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[T.nilable(String)], unit_amount: String} } + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(dimension_values: T::Array[T.nilable(String)], unit_amount: String).void } + def initialize(dimension_values:, unit_amount:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTieredPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig) + end + attr_accessor :tiered_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TieredConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias { {first_unit: Float, unit_amount: String, last_unit: T.nilable(Float)} } + + sig { returns(Float) } + attr_accessor :first_unit + + sig { returns(String) } + attr_accessor :unit_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :last_unit + + sig { params(first_unit: Float, unit_amount: String, last_unit: T.nilable(Float)).void } + def initialize(first_unit:, unit_amount:, last_unit: nil); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTieredBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig) + end + attr_accessor :tiered_bps_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_bps_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered_bps + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TieredBpsConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias do + { + bps: Float, + minimum_amount: String, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + } + end + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig do + params( + bps: Float, + minimum_amount: String, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + ).void + end + def initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig, + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig) + end + attr_accessor :bps_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig, + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + bps_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :bps + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::Shape) + end + def to_h; end + + class BpsConfig < Orb::BaseModel + Shape = T.type_alias { {bps: Float, per_unit_maximum: T.nilable(String)} } + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig { params(bps: Float, per_unit_maximum: T.nilable(String)).void } + def initialize(bps:, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig::Shape) + end + def to_h; end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionBulkBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable( + T::Hash[Symbol, + T.nilable(String)] + ), + reference_id: T.nilable(String) + } + end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig) + end + attr_accessor :bulk_bps_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + bulk_bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + bulk_bps_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :bulk_bps + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::Shape) + end + def to_h; end + + class BulkBpsConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias do + {bps: Float, maximum_amount: T.nilable(String), per_unit_maximum: T.nilable(String)} + end + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig do + params( + bps: Float, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + ).void + end + def initialize(bps:, maximum_amount: nil, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier::Shape) + end + def to_h; end + end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionBulkPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig, + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration), + metadata: T.nilable( + T::Hash[Symbol, + T.nilable(String)] + ), + reference_id: T.nilable(String) + } + end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig) + end + attr_accessor :bulk_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + bulk_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig, + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + bulk_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :bulk + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::Shape) + end + def to_h; end + + class BulkConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String, maximum_units: T.nilable(Float)} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :maximum_units + + sig { params(unit_amount: String, maximum_units: T.nilable(Float)).void } + def initialize(unit_amount:, maximum_units: nil); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier::Shape) + end + def to_h; end + end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionThresholdTotalAmountPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :threshold_total_amount_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + threshold_total_amount_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :threshold_total_amount + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTieredPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_package_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_package_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_package_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_package_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered_package + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTieredWithMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_with_minimum_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_with_minimum_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered_with_minimum + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionUnitWithPercentPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + unit_with_percent_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :unit_with_percent_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + unit_with_percent_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + unit_with_percent_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :unit_with_percent + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionPackageWithAllocationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + package_with_allocation_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :package_with_allocation_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + package_with_allocation_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + package_with_allocation_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :package_with_allocation + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTierWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_with_proration_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_with_proration_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered_with_proration + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionUnitWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + unit_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :unit_with_proration_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + unit_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + unit_with_proration_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :unit_with_proration + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionGroupedAllocationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + grouped_allocation_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_allocation_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + grouped_allocation_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + grouped_allocation_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :grouped_allocation + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionGroupedWithProratedMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_with_prorated_minimum_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + grouped_with_prorated_minimum_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :grouped_with_prorated_minimum + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionBulkWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_with_proration_config: T::Hash[Symbol, T.anything], + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :bulk_with_proration_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + bulk_with_proration_config: T::Hash[Symbol, T.anything], + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + bulk_with_proration_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :bulk_with_proration + ); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice + ], + [Symbol, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice + ], + [ + Symbol, + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice + ] + ] + ) + end + private_class_method def self.variants; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_create_response.rbi b/rbi/lib/orb/models/subscription_create_response.rbi new file mode 100644 index 00000000..9d2266a8 --- /dev/null +++ b/rbi/lib/orb/models/subscription_create_response.rbi @@ -0,0 +1,1027 @@ +# typed: strong + +module Orb + module Models + class SubscriptionCreateResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionCreateResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionCreateResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionCreateResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionCreateResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionCreateResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionCreateResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionCreateResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionCreateResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionCreateResponse::TrialInfo + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Integer)) } + attr_accessor :active_plan_phase_order + + sig { returns(T::Array[Orb::Models::SubscriptionCreateResponse::AdjustmentInterval]) } + attr_accessor :adjustment_intervals + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig { returns(Orb::Models::SubscriptionCreateResponse::BillingCycleAnchorConfiguration) } + attr_accessor :billing_cycle_anchor_configuration + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(Orb::Models::Customer) } + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :default_invoice_memo + + sig { returns(T::Array[Orb::Models::SubscriptionCreateResponse::DiscountInterval::Variants]) } + attr_accessor :discount_intervals + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(T::Array[Orb::Models::SubscriptionCreateResponse::FixedFeeQuantitySchedule]) } + attr_accessor :fixed_fee_quantity_schedule + + sig { returns(T.nilable(String)) } + attr_accessor :invoicing_threshold + + sig { returns(T::Array[Orb::Models::SubscriptionCreateResponse::MaximumInterval]) } + attr_accessor :maximum_intervals + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T::Array[Orb::Models::SubscriptionCreateResponse::MinimumInterval]) } + attr_accessor :minimum_intervals + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(Orb::Models::Plan) } + attr_accessor :plan + + sig { returns(T::Array[Orb::Models::SubscriptionCreateResponse::PriceInterval]) } + attr_accessor :price_intervals + + sig { returns(T.nilable(Orb::Models::SubscriptionCreateResponse::RedeemedCoupon)) } + attr_accessor :redeemed_coupon + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Orb::Models::SubscriptionCreateResponse::TrialInfo) } + attr_accessor :trial_info + + sig do + params( + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionCreateResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionCreateResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionCreateResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionCreateResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionCreateResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionCreateResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionCreateResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionCreateResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionCreateResponse::TrialInfo + ).void + end + def initialize( + id:, + active_plan_phase_order:, + adjustment_intervals:, + auto_collection:, + billing_cycle_anchor_configuration:, + billing_cycle_day:, + created_at:, + current_billing_period_end_date:, + current_billing_period_start_date:, + customer:, + default_invoice_memo:, + discount_intervals:, + end_date:, + fixed_fee_quantity_schedule:, + invoicing_threshold:, + maximum_intervals:, + metadata:, + minimum_intervals:, + net_terms:, + plan:, + price_intervals:, + redeemed_coupon:, + start_date:, + status:, + trial_info: + ); end + + sig { returns(Orb::Models::SubscriptionCreateResponse::Shape) } + def to_h; end + + class AdjustmentInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment: Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::Variants) } + attr_accessor :adjustment + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + adjustment: Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + ).void + end + def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, + Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, + Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, + Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, + Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ) + end + + class AmountDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + amount_discount:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + adjustment_type: :amount_discount + ); end + + sig do + returns(Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment::Shape) + end + def to_h; end + end + + class PercentageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + percentage_discount:, + plan_phase_order:, + reason:, + adjustment_type: :percentage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment::Shape) + end + def to_h; end + end + + class UsageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float, + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + usage_discount:, + adjustment_type: :usage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment::Shape) + end + def to_h; end + end + + class MinimumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + item_id:, + minimum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :minimum + ); end + + sig do + returns(Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MinimumAdjustment::Shape) + end + def to_h; end + end + + class MaximumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + maximum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :maximum + ); end + + sig do + returns(Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MaximumAdjustment::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ] + ] + ) + end + private_class_method def self.variants; end + end + end + + class BillingCycleAnchorConfiguration < Orb::BaseModel + Shape = T.type_alias { {day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)} } + + sig { returns(Integer) } + attr_accessor :day + + sig { returns(T.nilable(Integer)) } + attr_accessor :month + + sig { returns(T.nilable(Integer)) } + attr_accessor :year + + sig { params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).void } + def initialize(day:, month: nil, year: nil); end + + sig { returns(Orb::Models::SubscriptionCreateResponse::BillingCycleAnchorConfiguration::Shape) } + def to_h; end + end + + class DiscountInterval < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionCreateResponse::DiscountInterval::AmountDiscountInterval, + Orb::Models::SubscriptionCreateResponse::DiscountInterval::PercentageDiscountInterval, + Orb::Models::SubscriptionCreateResponse::DiscountInterval::UsageDiscountInterval + ) + end + + class AmountDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + amount_discount:, + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + discount_type: :amount + ); end + + sig do + returns(Orb::Models::SubscriptionCreateResponse::DiscountInterval::AmountDiscountInterval::Shape) + end + def to_h; end + end + + class PercentageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + percentage_discount:, + start_date:, + discount_type: :percentage + ); end + + sig do + returns(Orb::Models::SubscriptionCreateResponse::DiscountInterval::PercentageDiscountInterval::Shape) + end + def to_h; end + end + + class UsageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + usage_discount:, + discount_type: :usage + ); end + + sig do + returns(Orb::Models::SubscriptionCreateResponse::DiscountInterval::UsageDiscountInterval::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionCreateResponse::DiscountInterval::AmountDiscountInterval + ], + [Symbol, Orb::Models::SubscriptionCreateResponse::DiscountInterval::PercentageDiscountInterval], + [Symbol, Orb::Models::SubscriptionCreateResponse::DiscountInterval::UsageDiscountInterval] + ] + ) + end + private_class_method def self.variants; end + end + + class FixedFeeQuantitySchedule < Orb::BaseModel + Shape = T.type_alias do + {end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time} + end + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time).void } + def initialize(end_date:, price_id:, quantity:, start_date:); end + + sig { returns(Orb::Models::SubscriptionCreateResponse::FixedFeeQuantitySchedule::Shape) } + def to_h; end + end + + class MaximumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + maximum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionCreateResponse::MaximumInterval::Shape) } + def to_h; end + end + + class MinimumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + minimum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionCreateResponse::MinimumInterval::Shape) } + def to_h; end + end + + class PriceInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionCreateResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionCreateResponse::PriceInterval::FixedFeeQuantityTransition])) + end + attr_accessor :fixed_fee_quantity_transitions + + sig { returns(Orb::Models::Price::Variants) } + attr_accessor :price + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionCreateResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + ).void + end + def initialize( + id:, + billing_cycle_day:, + current_billing_period_end_date:, + current_billing_period_start_date:, + end_date:, + fixed_fee_quantity_transitions:, + price:, + start_date: + ); end + + sig { returns(Orb::Models::SubscriptionCreateResponse::PriceInterval::Shape) } + def to_h; end + + class FixedFeeQuantityTransition < Orb::BaseModel + Shape = T.type_alias { {effective_date: Time, price_id: String, quantity: Integer} } + + sig { returns(Time) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Integer) } + attr_accessor :quantity + + sig { params(effective_date: Time, price_id: String, quantity: Integer).void } + def initialize(effective_date:, price_id:, quantity:); end + + sig do + returns(Orb::Models::SubscriptionCreateResponse::PriceInterval::FixedFeeQuantityTransition::Shape) + end + def to_h; end + end + end + + class RedeemedCoupon < Orb::BaseModel + Shape = T.type_alias { {coupon_id: String, end_date: T.nilable(Time), start_date: Time} } + + sig { returns(String) } + attr_accessor :coupon_id + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(coupon_id: String, end_date: T.nilable(Time), start_date: Time).void } + def initialize(coupon_id:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionCreateResponse::RedeemedCoupon::Shape) } + def to_h; end + end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TrialInfo < Orb::BaseModel + Shape = T.type_alias { {end_date: T.nilable(Time)} } + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { params(end_date: T.nilable(Time)).void } + def initialize(end_date:); end + + sig { returns(Orb::Models::SubscriptionCreateResponse::TrialInfo::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_fetch_costs_params.rbi b/rbi/lib/orb/models/subscription_fetch_costs_params.rbi new file mode 100644 index 00000000..2cd87160 --- /dev/null +++ b/rbi/lib/orb/models/subscription_fetch_costs_params.rbi @@ -0,0 +1,65 @@ +# typed: strong + +module Orb + module Models + class SubscriptionFetchCostsParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + currency: T.nilable(String), + timeframe_end: T.nilable(Time), + timeframe_start: T.nilable(Time), + view_mode: T.nilable(Symbol) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(Time)) } + attr_accessor :timeframe_end + + sig { returns(T.nilable(Time)) } + attr_accessor :timeframe_start + + sig { returns(T.nilable(Symbol)) } + attr_accessor :view_mode + + sig do + params( + currency: T.nilable(String), + timeframe_end: T.nilable(Time), + timeframe_start: T.nilable(Time), + view_mode: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).void + end + def initialize( + currency: nil, + timeframe_end: nil, + timeframe_start: nil, + view_mode: nil, + request_options: {} + ) + end + + sig { returns(Orb::Models::SubscriptionFetchCostsParams::Shape) } + def to_h; end + + class ViewMode < Orb::Enum + abstract! + + PERIODIC = T.let(:periodic, T.nilable(Symbol)) + CUMULATIVE = T.let(:cumulative, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_fetch_costs_response.rbi b/rbi/lib/orb/models/subscription_fetch_costs_response.rbi new file mode 100644 index 00000000..064c26a7 --- /dev/null +++ b/rbi/lib/orb/models/subscription_fetch_costs_response.rbi @@ -0,0 +1,90 @@ +# typed: strong + +module Orb + module Models + class SubscriptionFetchCostsResponse < Orb::BaseModel + Shape = T.type_alias { {data: T::Array[Orb::Models::SubscriptionFetchCostsResponse::Data]} } + + sig { returns(T::Array[Orb::Models::SubscriptionFetchCostsResponse::Data]) } + attr_accessor :data + + sig { params(data: T::Array[Orb::Models::SubscriptionFetchCostsResponse::Data]).void } + def initialize(data:); end + + sig { returns(Orb::Models::SubscriptionFetchCostsResponse::Shape) } + def to_h; end + + class Data < Orb::BaseModel + Shape = T.type_alias do + { + per_price_costs: T::Array[Orb::Models::SubscriptionFetchCostsResponse::Data::PerPriceCost], + subtotal: String, + timeframe_end: Time, + timeframe_start: Time, + total: String + } + end + + sig { returns(T::Array[Orb::Models::SubscriptionFetchCostsResponse::Data::PerPriceCost]) } + attr_accessor :per_price_costs + + sig { returns(String) } + attr_accessor :subtotal + + sig { returns(Time) } + attr_accessor :timeframe_end + + sig { returns(Time) } + attr_accessor :timeframe_start + + sig { returns(String) } + attr_accessor :total + + sig do + params( + per_price_costs: T::Array[Orb::Models::SubscriptionFetchCostsResponse::Data::PerPriceCost], + subtotal: String, + timeframe_end: Time, + timeframe_start: Time, + total: String + ).void + end + def initialize(per_price_costs:, subtotal:, timeframe_end:, timeframe_start:, total:); end + + sig { returns(Orb::Models::SubscriptionFetchCostsResponse::Data::Shape) } + def to_h; end + + class PerPriceCost < Orb::BaseModel + Shape = T.type_alias do + {price: Orb::Models::Price::Variants, subtotal: String, total: String, quantity: T.nilable(Float)} + end + + sig { returns(Orb::Models::Price::Variants) } + attr_accessor :price + + sig { returns(String) } + attr_accessor :subtotal + + sig { returns(String) } + attr_accessor :total + + sig { returns(T.nilable(Float)) } + attr_accessor :quantity + + sig do + params( + price: Orb::Models::Price::Variants, + subtotal: String, + total: String, + quantity: T.nilable(Float) + ).void + end + def initialize(price:, subtotal:, total:, quantity: nil); end + + sig { returns(Orb::Models::SubscriptionFetchCostsResponse::Data::PerPriceCost::Shape) } + def to_h; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_fetch_params.rbi b/rbi/lib/orb/models/subscription_fetch_params.rbi new file mode 100644 index 00000000..104d7ff1 --- /dev/null +++ b/rbi/lib/orb/models/subscription_fetch_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class SubscriptionFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::SubscriptionFetchParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/subscription_fetch_schedule_params.rbi b/rbi/lib/orb/models/subscription_fetch_schedule_params.rbi new file mode 100644 index 00000000..8201ae68 --- /dev/null +++ b/rbi/lib/orb/models/subscription_fetch_schedule_params.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Orb + module Models + class SubscriptionFetchScheduleParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + cursor: T.nilable(String), + limit: Integer, + start_date_gt: T.nilable(Time), + start_date_gte: T.nilable(Time), + start_date_lt: T.nilable(Time), + start_date_lte: T.nilable(Time) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { returns(T.nilable(Time)) } + attr_accessor :start_date_gt + + sig { returns(T.nilable(Time)) } + attr_accessor :start_date_gte + + sig { returns(T.nilable(Time)) } + attr_accessor :start_date_lt + + sig { returns(T.nilable(Time)) } + attr_accessor :start_date_lte + + sig do + params( + cursor: T.nilable(String), + limit: Integer, + start_date_gt: T.nilable(Time), + start_date_gte: T.nilable(Time), + start_date_lt: T.nilable(Time), + start_date_lte: T.nilable(Time), + request_options: Orb::RequestOpts + ).void + end + def initialize( + cursor: nil, + limit: nil, + start_date_gt: nil, + start_date_gte: nil, + start_date_lt: nil, + start_date_lte: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::SubscriptionFetchScheduleParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/subscription_fetch_schedule_response.rbi b/rbi/lib/orb/models/subscription_fetch_schedule_response.rbi new file mode 100644 index 00000000..2aad14c2 --- /dev/null +++ b/rbi/lib/orb/models/subscription_fetch_schedule_response.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Orb + module Models + class SubscriptionFetchScheduleResponse < Orb::BaseModel + Shape = T.type_alias do + { + created_at: Time, + end_date: T.nilable(Time), + plan: Orb::Models::SubscriptionFetchScheduleResponse::Plan, + start_date: Time + } + end + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Orb::Models::SubscriptionFetchScheduleResponse::Plan) } + attr_accessor :plan + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + created_at: Time, + end_date: T.nilable(Time), + plan: Orb::Models::SubscriptionFetchScheduleResponse::Plan, + start_date: Time + ).void + end + def initialize(created_at:, end_date:, plan:, start_date:); end + + sig { returns(Orb::Models::SubscriptionFetchScheduleResponse::Shape) } + def to_h; end + + class Plan < Orb::BaseModel + Shape = T.type_alias do + {id: T.nilable(String), external_plan_id: T.nilable(String), name: T.nilable(String)} + end + + sig { returns(T.nilable(String)) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :external_plan_id + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig do + params(id: T.nilable(String), external_plan_id: T.nilable(String), name: T.nilable(String)).void + end + def initialize(id:, external_plan_id:, name:); end + + sig { returns(Orb::Models::SubscriptionFetchScheduleResponse::Plan::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_fetch_usage_params.rbi b/rbi/lib/orb/models/subscription_fetch_usage_params.rbi new file mode 100644 index 00000000..c60b7952 --- /dev/null +++ b/rbi/lib/orb/models/subscription_fetch_usage_params.rbi @@ -0,0 +1,109 @@ +# typed: strong + +module Orb + module Models + class SubscriptionFetchUsageParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + billable_metric_id: T.nilable(String), + first_dimension_key: T.nilable(String), + first_dimension_value: T.nilable(String), + granularity: T.nilable(Symbol), + group_by: T.nilable(String), + second_dimension_key: T.nilable(String), + second_dimension_value: T.nilable(String), + timeframe_end: T.nilable(Time), + timeframe_start: T.nilable(Time), + view_mode: T.nilable(Symbol) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(String)) } + attr_accessor :first_dimension_key + + sig { returns(T.nilable(String)) } + attr_accessor :first_dimension_value + + sig { returns(T.nilable(Symbol)) } + attr_accessor :granularity + + sig { returns(T.nilable(String)) } + attr_accessor :group_by + + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension_key + + sig { returns(T.nilable(String)) } + attr_accessor :second_dimension_value + + sig { returns(T.nilable(Time)) } + attr_accessor :timeframe_end + + sig { returns(T.nilable(Time)) } + attr_accessor :timeframe_start + + sig { returns(T.nilable(Symbol)) } + attr_accessor :view_mode + + sig do + params( + billable_metric_id: T.nilable(String), + first_dimension_key: T.nilable(String), + first_dimension_value: T.nilable(String), + granularity: T.nilable(Symbol), + group_by: T.nilable(String), + second_dimension_key: T.nilable(String), + second_dimension_value: T.nilable(String), + timeframe_end: T.nilable(Time), + timeframe_start: T.nilable(Time), + view_mode: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).void + end + def initialize( + billable_metric_id: nil, + first_dimension_key: nil, + first_dimension_value: nil, + granularity: nil, + group_by: nil, + second_dimension_key: nil, + second_dimension_value: nil, + timeframe_end: nil, + timeframe_start: nil, + view_mode: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::SubscriptionFetchUsageParams::Shape) } + def to_h; end + + class Granularity < Orb::Enum + abstract! + + DAY = T.let(:day, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class ViewMode < Orb::Enum + abstract! + + PERIODIC = T.let(:periodic, T.nilable(Symbol)) + CUMULATIVE = T.let(:cumulative, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_list_params.rbi b/rbi/lib/orb/models/subscription_list_params.rbi new file mode 100644 index 00000000..d4677eb1 --- /dev/null +++ b/rbi/lib/orb/models/subscription_list_params.rbi @@ -0,0 +1,98 @@ +# typed: strong + +module Orb + module Models + class SubscriptionListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + cursor: T.nilable(String), + customer_id: T.nilable(T::Array[String]), + external_customer_id: T.nilable(String), + limit: Integer, + status: T.nilable(Symbol) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_gt + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_gte + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_lt + + sig { returns(T.nilable(Time)) } + attr_accessor :created_at_lte + + sig { returns(T.nilable(String)) } + attr_accessor :cursor + + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :customer_id + + sig { returns(T.nilable(String)) } + attr_accessor :external_customer_id + + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + sig { returns(T.nilable(Symbol)) } + attr_accessor :status + + sig do + params( + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + cursor: T.nilable(String), + customer_id: T.nilable(T::Array[String]), + external_customer_id: T.nilable(String), + limit: Integer, + status: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).void + end + def initialize( + created_at_gt: nil, + created_at_gte: nil, + created_at_lt: nil, + created_at_lte: nil, + cursor: nil, + customer_id: nil, + external_customer_id: nil, + limit: nil, + status: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::SubscriptionListParams::Shape) } + def to_h; end + + class Status < Orb::Enum + abstract! + + ACTIVE = T.let(:active, T.nilable(Symbol)) + ENDED = T.let(:ended, T.nilable(Symbol)) + UPCOMING = T.let(:upcoming, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_price_intervals_params.rbi b/rbi/lib/orb/models/subscription_price_intervals_params.rbi new file mode 100644 index 00000000..ae7e693e --- /dev/null +++ b/rbi/lib/orb/models/subscription_price_intervals_params.rbi @@ -0,0 +1,6248 @@ +# typed: strong + +module Orb + module Models + class SubscriptionPriceIntervalsParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + add: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add], + add_adjustments: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment], + edit: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Edit], + edit_adjustments: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment] + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add])) } + attr_reader :add + + sig { params(add: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add]).void } + attr_writer :add + + sig { returns(T.nilable(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment])) } + attr_reader :add_adjustments + + sig do + params(add_adjustments: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment]).void + end + attr_writer :add_adjustments + + sig { returns(T.nilable(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Edit])) } + attr_reader :edit + + sig { params(edit: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Edit]).void } + attr_writer :edit + + sig { returns(T.nilable(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment])) } + attr_reader :edit_adjustments + + sig do + params(edit_adjustments: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment]).void + end + attr_writer :edit_adjustments + + sig do + params( + add: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add], + add_adjustments: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment], + edit: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Edit], + edit_adjustments: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment], + request_options: Orb::RequestOpts + ).void + end + def initialize(add: nil, add_adjustments: nil, edit: nil, edit_adjustments: nil, request_options: {}) + end + + sig { returns(Orb::Models::SubscriptionPriceIntervalsParams::Shape) } + def to_h; end + + class Add < Orb::BaseModel + Shape = T.type_alias do + { + start_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::StartDate::Variants, + allocation_price: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice), + discounts: T.nilable(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::Variants]), + end_date: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::EndDate::Variants), + external_price_id: T.nilable(String), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::FixedFeeQuantityTransition]), + maximum_amount: T.nilable(Float), + minimum_amount: T.nilable(Float), + price: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Variants), + price_id: T.nilable(String) + } + end + + sig { returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::StartDate::Variants) } + attr_accessor :start_date + + sig { returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice)) } + attr_accessor :allocation_price + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::Variants])) + end + attr_accessor :discounts + + sig { returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::EndDate::Variants)) } + attr_accessor :end_date + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::FixedFeeQuantityTransition])) + end + attr_accessor :fixed_fee_quantity_transitions + + sig { returns(T.nilable(Float)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Variants)) } + attr_accessor :price + + sig { returns(T.nilable(String)) } + attr_accessor :price_id + + sig do + params( + start_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::StartDate::Variants, + allocation_price: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice), + discounts: T.nilable(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::Variants]), + end_date: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::EndDate::Variants), + external_price_id: T.nilable(String), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::FixedFeeQuantityTransition]), + maximum_amount: T.nilable(Float), + minimum_amount: T.nilable(Float), + price: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::Variants), + price_id: T.nilable(String) + ).void + end + def initialize( + start_date:, + allocation_price: nil, + discounts: nil, + end_date: nil, + external_price_id: nil, + fixed_fee_quantity_transitions: nil, + maximum_amount: nil, + minimum_amount: nil, + price: nil, + price_id: nil + ); end + + sig { returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Shape) } + def to_h; end + + class StartDate < Orb::Union + abstract! + + Variants = T.type_alias { T.any(Time, Symbol) } + + sig { override.returns([[NilClass, Time], [NilClass, Symbol]]) } + private_class_method def self.variants; end + end + + class AllocationPrice < Orb::BaseModel + Shape = T.type_alias do + {amount: String, cadence: Symbol, currency: String, expires_at_end_of_cadence: T::Boolean} + end + + sig { returns(String) } + attr_accessor :amount + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T::Boolean) } + attr_accessor :expires_at_end_of_cadence + + sig do + params( + amount: String, + cadence: Symbol, + currency: String, + expires_at_end_of_cadence: T::Boolean + ).void + end + def initialize(amount:, cadence:, currency:, expires_at_end_of_cadence:); end + + sig { returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice::Shape) } + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ONE_TIME = :one_time + MONTHLY = :monthly + QUARTERLY = :quarterly + SEMI_ANNUAL = :semi_annual + ANNUAL = :annual + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Discount < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::AmountDiscountCreationParams, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::PercentageDiscountCreationParams, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::UsageDiscountCreationParams + ) + end + + class AmountDiscountCreationParams < Orb::BaseModel + Shape = T.type_alias { {amount_discount: Float, discount_type: Symbol} } + + sig { returns(Float) } + attr_accessor :amount_discount + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { params(amount_discount: Float, discount_type: Symbol).void } + def initialize(amount_discount:, discount_type: :amount); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::AmountDiscountCreationParams::Shape) + end + def to_h; end + end + + class PercentageDiscountCreationParams < Orb::BaseModel + Shape = T.type_alias { {discount_type: Symbol, percentage_discount: Float} } + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { params(percentage_discount: Float, discount_type: Symbol).void } + def initialize(percentage_discount:, discount_type: :percentage); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::PercentageDiscountCreationParams::Shape) + end + def to_h; end + end + + class UsageDiscountCreationParams < Orb::BaseModel + Shape = T.type_alias { {discount_type: Symbol, usage_discount: Float} } + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(Float) } + attr_accessor :usage_discount + + sig { params(usage_discount: Float, discount_type: Symbol).void } + def initialize(usage_discount:, discount_type: :usage); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::UsageDiscountCreationParams::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::AmountDiscountCreationParams + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::PercentageDiscountCreationParams + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::UsageDiscountCreationParams + ] + ] + ) + end + private_class_method def self.variants; end + end + + class EndDate < Orb::Union + abstract! + + Variants = T.type_alias { T.any(Time, Symbol) } + + sig { override.returns([[NilClass, Time], [NilClass, Symbol]]) } + private_class_method def self.variants; end + end + + class FixedFeeQuantityTransition < Orb::BaseModel + Shape = T.type_alias { {effective_date: Time, quantity: Integer} } + + sig { returns(Time) } + attr_accessor :effective_date + + sig { returns(Integer) } + attr_accessor :quantity + + sig { params(effective_date: Time, quantity: Integer).void } + def initialize(effective_date:, quantity:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::FixedFeeQuantityTransition::Shape) + end + def to_h; end + end + + class Price < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice + ) + end + + class NewFloatingUnitPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + unit_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::UnitConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::UnitConfig) + end + attr_accessor :unit_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + name: String, + unit_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::UnitConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + name:, + unit_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :unit + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class UnitConfig < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(unit_amount: String).void } + def initialize(unit_amount:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::UnitConfig::Shape) + end + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + package_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::PackageConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::PackageConfig) + end + attr_accessor :package_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + name: String, + package_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::PackageConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + name:, + package_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :package + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class PackageConfig < Orb::BaseModel + Shape = T.type_alias { {package_amount: String, package_size: Integer} } + + sig { returns(String) } + attr_accessor :package_amount + + sig { returns(Integer) } + attr_accessor :package_size + + sig { params(package_amount: String, package_size: Integer).void } + def initialize(package_amount:, package_size:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::PackageConfig::Shape) + end + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingMatrixPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + matrix_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig) + end + attr_accessor :matrix_config + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + matrix_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + matrix_config:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :matrix + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class MatrixConfig < Orb::BaseModel + Shape = T.type_alias do + { + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig::MatrixValue] + } + end + + sig { returns(String) } + attr_accessor :default_unit_amount + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimensions + + sig do + returns(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig::MatrixValue]) + end + attr_accessor :matrix_values + + sig do + params( + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig::MatrixValue] + ).void + end + def initialize(default_unit_amount:, dimensions:, matrix_values:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig::Shape) + end + def to_h; end + + class MatrixValue < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[T.nilable(String)], unit_amount: String} } + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(dimension_values: T::Array[T.nilable(String)], unit_amount: String).void } + def initialize(dimension_values:, unit_amount:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig::MatrixValue::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingMatrixWithAllocationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + matrix_with_allocation_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig) + end + attr_accessor :matrix_with_allocation_config + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + matrix_with_allocation_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + matrix_with_allocation_config:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :matrix_with_allocation + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class MatrixWithAllocationConfig < Orb::BaseModel + Shape = T.type_alias do + { + allocation: Float, + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue] + } + end + + sig { returns(Float) } + attr_accessor :allocation + + sig { returns(String) } + attr_accessor :default_unit_amount + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimensions + + sig do + returns(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue]) + end + attr_accessor :matrix_values + + sig do + params( + allocation: Float, + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue] + ).void + end + def initialize(allocation:, default_unit_amount:, dimensions:, matrix_values:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig::Shape) + end + def to_h; end + + class MatrixValue < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[T.nilable(String)], unit_amount: String} } + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(dimension_values: T::Array[T.nilable(String)], unit_amount: String).void } + def initialize(dimension_values:, unit_amount:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingTieredPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + tiered_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig) + end + attr_accessor :tiered_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + name: String, + tiered_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + name:, + tiered_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :tiered + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TieredConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias { {first_unit: Float, unit_amount: String, last_unit: T.nilable(Float)} } + + sig { returns(Float) } + attr_accessor :first_unit + + sig { returns(String) } + attr_accessor :unit_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :last_unit + + sig { params(first_unit: Float, unit_amount: String, last_unit: T.nilable(Float)).void } + def initialize(first_unit:, unit_amount:, last_unit: nil); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig::Tier::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingTieredBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + tiered_bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig) + end + attr_accessor :tiered_bps_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + name: String, + tiered_bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + name:, + tiered_bps_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :tiered_bps + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TieredBpsConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias do + { + bps: Float, + minimum_amount: String, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + } + end + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig do + params( + bps: Float, + minimum_amount: String, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + ).void + end + def initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig::Tier::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BpsConfig, + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BpsConfig) + end + attr_accessor :bps_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BpsConfig, + cadence: Symbol, + currency: String, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + bps_config:, + cadence:, + currency:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :bps + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::Shape) + end + def to_h; end + + class BpsConfig < Orb::BaseModel + Shape = T.type_alias { {bps: Float, per_unit_maximum: T.nilable(String)} } + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig { params(bps: Float, per_unit_maximum: T.nilable(String)).void } + def initialize(bps:, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BpsConfig::Shape) + end + def to_h; end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingBulkBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig, + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable( + T::Hash[Symbol, + T.nilable(String)] + ) + } + end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig) + end + attr_accessor :bulk_bps_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + bulk_bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig, + cadence: Symbol, + currency: String, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + bulk_bps_config:, + cadence:, + currency:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :bulk_bps + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::Shape) + end + def to_h; end + + class BulkBpsConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias do + {bps: Float, maximum_amount: T.nilable(String), per_unit_maximum: T.nilable(String)} + end + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig do + params( + bps: Float, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + ).void + end + def initialize(bps:, maximum_amount: nil, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig::Tier::Shape) + end + def to_h; end + end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingBulkPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig, + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig) + end + attr_accessor :bulk_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + bulk_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig, + cadence: Symbol, + currency: String, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + bulk_config:, + cadence:, + currency:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :bulk + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::Shape) + end + def to_h; end + + class BulkConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String, maximum_units: T.nilable(Float)} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :maximum_units + + sig { params(unit_amount: String, maximum_units: T.nilable(Float)).void } + def initialize(unit_amount:, maximum_units: nil); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig::Tier::Shape) + end + def to_h; end + end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingThresholdTotalAmountPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :threshold_total_amount_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + name: String, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + name:, + threshold_total_amount_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :threshold_total_amount + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingTieredPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + tiered_package_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_package_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + name: String, + tiered_package_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + name:, + tiered_package_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :tiered_package + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingGroupedTieredPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + grouped_tiered_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_tiered_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + grouped_tiered_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + grouped_tiered_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :grouped_tiered + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingMaxGroupTieredPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + max_group_tiered_package_config: T::Hash[Symbol, T.anything], + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :max_group_tiered_package_config + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + max_group_tiered_package_config: T::Hash[Symbol, T.anything], + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + max_group_tiered_package_config:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :max_group_tiered_package + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingTieredWithMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_with_minimum_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + name: String, + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + name:, + tiered_with_minimum_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :tiered_with_minimum + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingPackageWithAllocationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + package_with_allocation_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :package_with_allocation_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + name: String, + package_with_allocation_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + name:, + package_with_allocation_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :package_with_allocation + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingTieredPackageWithMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_package_with_minimum_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + name: String, + tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + name:, + tiered_package_with_minimum_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :tiered_package_with_minimum + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingUnitWithPercentPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + unit_with_percent_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :unit_with_percent_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + name: String, + unit_with_percent_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + name:, + unit_with_percent_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :unit_with_percent + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingTieredWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_with_proration_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + name: String, + tiered_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + name:, + tiered_with_proration_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :tiered_with_proration + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingUnitWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + unit_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :unit_with_proration_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + name: String, + unit_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + name:, + unit_with_proration_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :unit_with_proration + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingGroupedAllocationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + grouped_allocation_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_allocation_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + grouped_allocation_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + grouped_allocation_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :grouped_allocation + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingGroupedWithProratedMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_with_prorated_minimum_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + grouped_with_prorated_minimum_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :grouped_with_prorated_minimum + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingGroupedWithMeteredMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_with_metered_minimum_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + grouped_with_metered_minimum_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :grouped_with_metered_minimum + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingMatrixWithDisplayNamePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + matrix_with_display_name_config: T::Hash[Symbol, T.anything], + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :matrix_with_display_name_config + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + matrix_with_display_name_config: T::Hash[Symbol, T.anything], + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + matrix_with_display_name_config:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :matrix_with_display_name + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingBulkWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_with_proration_config: T::Hash[Symbol, T.anything], + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :bulk_with_proration_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + bulk_with_proration_config: T::Hash[Symbol, T.anything], + cadence: Symbol, + currency: String, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + bulk_with_proration_config:, + cadence:, + currency:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :bulk_with_proration + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingGroupedTieredPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + grouped_tiered_package_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_tiered_package_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + grouped_tiered_package_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + grouped_tiered_package_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :grouped_tiered_package + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingScalableMatrixWithUnitPricingPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + scalable_matrix_with_unit_pricing_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :scalable_matrix_with_unit_pricing_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + name: String, + scalable_matrix_with_unit_pricing_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + name:, + scalable_matrix_with_unit_pricing_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :scalable_matrix_with_unit_pricing + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewFloatingScalableMatrixWithTieredPricingPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + scalable_matrix_with_tiered_pricing_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :scalable_matrix_with_tiered_pricing_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + name: String, + scalable_matrix_with_tiered_pricing_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + model_type: Symbol + ).void + end + def initialize( + cadence:, + currency:, + item_id:, + name:, + scalable_matrix_with_tiered_pricing_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + model_type: :scalable_matrix_with_tiered_pricing + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + sig do + override.returns( + [ + [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice + ], + [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice + ], + [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice + ], + [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice], + [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice], + [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice + ] + ] + ) + end + private_class_method def self.variants; end + end + end + + class AddAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + adjustment: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::Variants, + start_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::StartDate::Variants, + end_date: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::EndDate::Variants) + } + end + + sig { returns(Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::Variants) } + attr_accessor :adjustment + + sig { returns(Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::StartDate::Variants) } + attr_accessor :start_date + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::EndDate::Variants)) + end + attr_accessor :end_date + + sig do + params( + adjustment: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::Variants, + start_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::StartDate::Variants, + end_date: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::EndDate::Variants) + ).void + end + def initialize(adjustment:, start_date:, end_date: nil); end + + sig { returns(Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewPercentageDiscount, + Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewUsageDiscount, + Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewAmountDiscount, + Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMinimum, + Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMaximum + ) + end + + class NewPercentageDiscount < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + percentage_discount: Float, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + percentage_discount: Float, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + percentage_discount:, + is_invoice_level: nil, + adjustment_type: :percentage_discount + ) + end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewPercentageDiscount::Shape) + end + def to_h; end + end + + class NewUsageDiscount < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + usage_discount: Float, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(Float) } + attr_accessor :usage_discount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + usage_discount: Float, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + usage_discount:, + is_invoice_level: nil, + adjustment_type: :usage_discount + ) + end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewUsageDiscount::Shape) + end + def to_h; end + end + + class NewAmountDiscount < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + amount_discount:, + applies_to_price_ids:, + is_invoice_level: nil, + adjustment_type: :amount_discount + ) + end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewAmountDiscount::Shape) + end + def to_h; end + end + + class NewMinimum < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + item_id:, + minimum_amount:, + is_invoice_level: nil, + adjustment_type: :minimum + ) + end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMinimum::Shape) + end + def to_h; end + end + + class NewMaximum < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + maximum_amount: String, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + maximum_amount: String, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + maximum_amount:, + is_invoice_level: nil, + adjustment_type: :maximum + ) + end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMaximum::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewPercentageDiscount + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewUsageDiscount + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewAmountDiscount + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMinimum + ], + [Symbol, Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMaximum] + ] + ) + end + private_class_method def self.variants; end + end + + class StartDate < Orb::Union + abstract! + + Variants = T.type_alias { T.any(Time, Symbol) } + + sig { override.returns([[NilClass, Time], [NilClass, Symbol]]) } + private_class_method def self.variants; end + end + + class EndDate < Orb::Union + abstract! + + Variants = T.type_alias { T.any(Time, Symbol) } + + sig { override.returns([[NilClass, Time], [NilClass, Symbol]]) } + private_class_method def self.variants; end + end + end + + class Edit < Orb::BaseModel + Shape = T.type_alias do + { + price_interval_id: String, + billing_cycle_day: T.nilable(Integer), + end_date: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Edit::EndDate::Variants), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Edit::FixedFeeQuantityTransition]), + start_date: Orb::Models::SubscriptionPriceIntervalsParams::Edit::StartDate::Variants + } + end + + sig { returns(String) } + attr_accessor :price_interval_id + + sig { returns(T.nilable(Integer)) } + attr_accessor :billing_cycle_day + + sig { returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Edit::EndDate::Variants)) } + attr_accessor :end_date + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Edit::FixedFeeQuantityTransition])) + end + attr_accessor :fixed_fee_quantity_transitions + + sig { returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Edit::StartDate::Variants)) } + attr_reader :start_date + + sig do + params(start_date: Orb::Models::SubscriptionPriceIntervalsParams::Edit::StartDate::Variants).void + end + attr_writer :start_date + + sig do + params( + price_interval_id: String, + billing_cycle_day: T.nilable(Integer), + end_date: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::Edit::EndDate::Variants), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Edit::FixedFeeQuantityTransition]), + start_date: Orb::Models::SubscriptionPriceIntervalsParams::Edit::StartDate::Variants + ).void + end + def initialize( + price_interval_id:, + billing_cycle_day: nil, + end_date: nil, + fixed_fee_quantity_transitions: nil, + start_date: nil + ); end + + sig { returns(Orb::Models::SubscriptionPriceIntervalsParams::Edit::Shape) } + def to_h; end + + class EndDate < Orb::Union + abstract! + + Variants = T.type_alias { T.any(Time, Symbol) } + + sig { override.returns([[NilClass, Time], [NilClass, Symbol]]) } + private_class_method def self.variants; end + end + + class FixedFeeQuantityTransition < Orb::BaseModel + Shape = T.type_alias { {effective_date: Time, quantity: Integer} } + + sig { returns(Time) } + attr_accessor :effective_date + + sig { returns(Integer) } + attr_accessor :quantity + + sig { params(effective_date: Time, quantity: Integer).void } + def initialize(effective_date:, quantity:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsParams::Edit::FixedFeeQuantityTransition::Shape) + end + def to_h; end + end + + class StartDate < Orb::Union + abstract! + + Variants = T.type_alias { T.any(Time, Symbol) } + + sig { override.returns([[NilClass, Time], [NilClass, Symbol]]) } + private_class_method def self.variants; end + end + end + + class EditAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_interval_id: String, + end_date: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::EndDate::Variants), + start_date: Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::StartDate::Variants + } + end + + sig { returns(String) } + attr_accessor :adjustment_interval_id + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::EndDate::Variants)) + end + attr_accessor :end_date + + sig do + returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::StartDate::Variants)) + end + attr_reader :start_date + + sig do + params(start_date: Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::StartDate::Variants).void + end + attr_writer :start_date + + sig do + params( + adjustment_interval_id: String, + end_date: T.nilable(Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::EndDate::Variants), + start_date: Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::StartDate::Variants + ).void + end + def initialize(adjustment_interval_id:, end_date: nil, start_date: nil); end + + sig { returns(Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::Shape) } + def to_h; end + + class EndDate < Orb::Union + abstract! + + Variants = T.type_alias { T.any(Time, Symbol) } + + sig { override.returns([[NilClass, Time], [NilClass, Symbol]]) } + private_class_method def self.variants; end + end + + class StartDate < Orb::Union + abstract! + + Variants = T.type_alias { T.any(Time, Symbol) } + + sig { override.returns([[NilClass, Time], [NilClass, Symbol]]) } + private_class_method def self.variants; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_price_intervals_response.rbi b/rbi/lib/orb/models/subscription_price_intervals_response.rbi new file mode 100644 index 00000000..e141a7fb --- /dev/null +++ b/rbi/lib/orb/models/subscription_price_intervals_response.rbi @@ -0,0 +1,1033 @@ +# typed: strong + +module Orb + module Models + class SubscriptionPriceIntervalsResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionPriceIntervalsResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionPriceIntervalsResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionPriceIntervalsResponse::TrialInfo + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Integer)) } + attr_accessor :active_plan_phase_order + + sig { returns(T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval]) } + attr_accessor :adjustment_intervals + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig { returns(Orb::Models::SubscriptionPriceIntervalsResponse::BillingCycleAnchorConfiguration) } + attr_accessor :billing_cycle_anchor_configuration + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(Orb::Models::Customer) } + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :default_invoice_memo + + sig { returns(T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::Variants]) } + attr_accessor :discount_intervals + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::FixedFeeQuantitySchedule]) } + attr_accessor :fixed_fee_quantity_schedule + + sig { returns(T.nilable(String)) } + attr_accessor :invoicing_threshold + + sig { returns(T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::MaximumInterval]) } + attr_accessor :maximum_intervals + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::MinimumInterval]) } + attr_accessor :minimum_intervals + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(Orb::Models::Plan) } + attr_accessor :plan + + sig { returns(T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval]) } + attr_accessor :price_intervals + + sig { returns(T.nilable(Orb::Models::SubscriptionPriceIntervalsResponse::RedeemedCoupon)) } + attr_accessor :redeemed_coupon + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Orb::Models::SubscriptionPriceIntervalsResponse::TrialInfo) } + attr_accessor :trial_info + + sig do + params( + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionPriceIntervalsResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionPriceIntervalsResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionPriceIntervalsResponse::TrialInfo + ).void + end + def initialize( + id:, + active_plan_phase_order:, + adjustment_intervals:, + auto_collection:, + billing_cycle_anchor_configuration:, + billing_cycle_day:, + created_at:, + current_billing_period_end_date:, + current_billing_period_start_date:, + customer:, + default_invoice_memo:, + discount_intervals:, + end_date:, + fixed_fee_quantity_schedule:, + invoicing_threshold:, + maximum_intervals:, + metadata:, + minimum_intervals:, + net_terms:, + plan:, + price_intervals:, + redeemed_coupon:, + start_date:, + status:, + trial_info: + ); end + + sig { returns(Orb::Models::SubscriptionPriceIntervalsResponse::Shape) } + def to_h; end + + class AdjustmentInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment: Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::Variants) + end + attr_accessor :adjustment + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + adjustment: Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + ).void + end + def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ) + end + + class AmountDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + amount_discount:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + adjustment_type: :amount_discount + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment::Shape) + end + def to_h; end + end + + class PercentageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + percentage_discount:, + plan_phase_order:, + reason:, + adjustment_type: :percentage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment::Shape) + end + def to_h; end + end + + class UsageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float, + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + usage_discount:, + adjustment_type: :usage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment::Shape) + end + def to_h; end + end + + class MinimumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + item_id:, + minimum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :minimum + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MinimumAdjustment::Shape) + end + def to_h; end + end + + class MaximumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + maximum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :maximum + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MaximumAdjustment::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ] + ] + ) + end + private_class_method def self.variants; end + end + end + + class BillingCycleAnchorConfiguration < Orb::BaseModel + Shape = T.type_alias { {day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)} } + + sig { returns(Integer) } + attr_accessor :day + + sig { returns(T.nilable(Integer)) } + attr_accessor :month + + sig { returns(T.nilable(Integer)) } + attr_accessor :year + + sig { params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).void } + def initialize(day:, month: nil, year: nil); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsResponse::BillingCycleAnchorConfiguration::Shape) + end + def to_h; end + end + + class DiscountInterval < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::AmountDiscountInterval, + Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::PercentageDiscountInterval, + Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::UsageDiscountInterval + ) + end + + class AmountDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + amount_discount:, + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + discount_type: :amount + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::AmountDiscountInterval::Shape) + end + def to_h; end + end + + class PercentageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + percentage_discount:, + start_date:, + discount_type: :percentage + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::PercentageDiscountInterval::Shape) + end + def to_h; end + end + + class UsageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + usage_discount:, + discount_type: :usage + ); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::UsageDiscountInterval::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::AmountDiscountInterval + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::PercentageDiscountInterval + ], + [ + Symbol, + Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::UsageDiscountInterval + ] + ] + ) + end + private_class_method def self.variants; end + end + + class FixedFeeQuantitySchedule < Orb::BaseModel + Shape = T.type_alias do + {end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time} + end + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time).void } + def initialize(end_date:, price_id:, quantity:, start_date:); end + + sig { returns(Orb::Models::SubscriptionPriceIntervalsResponse::FixedFeeQuantitySchedule::Shape) } + def to_h; end + end + + class MaximumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + maximum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionPriceIntervalsResponse::MaximumInterval::Shape) } + def to_h; end + end + + class MinimumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + minimum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionPriceIntervalsResponse::MinimumInterval::Shape) } + def to_h; end + end + + class PriceInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval::FixedFeeQuantityTransition])) + end + attr_accessor :fixed_fee_quantity_transitions + + sig { returns(Orb::Models::Price::Variants) } + attr_accessor :price + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + ).void + end + def initialize( + id:, + billing_cycle_day:, + current_billing_period_end_date:, + current_billing_period_start_date:, + end_date:, + fixed_fee_quantity_transitions:, + price:, + start_date: + ); end + + sig { returns(Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval::Shape) } + def to_h; end + + class FixedFeeQuantityTransition < Orb::BaseModel + Shape = T.type_alias { {effective_date: Time, price_id: String, quantity: Integer} } + + sig { returns(Time) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Integer) } + attr_accessor :quantity + + sig { params(effective_date: Time, price_id: String, quantity: Integer).void } + def initialize(effective_date:, price_id:, quantity:); end + + sig do + returns(Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval::FixedFeeQuantityTransition::Shape) + end + def to_h; end + end + end + + class RedeemedCoupon < Orb::BaseModel + Shape = T.type_alias { {coupon_id: String, end_date: T.nilable(Time), start_date: Time} } + + sig { returns(String) } + attr_accessor :coupon_id + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(coupon_id: String, end_date: T.nilable(Time), start_date: Time).void } + def initialize(coupon_id:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionPriceIntervalsResponse::RedeemedCoupon::Shape) } + def to_h; end + end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TrialInfo < Orb::BaseModel + Shape = T.type_alias { {end_date: T.nilable(Time)} } + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { params(end_date: T.nilable(Time)).void } + def initialize(end_date:); end + + sig { returns(Orb::Models::SubscriptionPriceIntervalsResponse::TrialInfo::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_schedule_plan_change_params.rbi b/rbi/lib/orb/models/subscription_schedule_plan_change_params.rbi new file mode 100644 index 00000000..5c8b2e63 --- /dev/null +++ b/rbi/lib/orb/models/subscription_schedule_plan_change_params.rbi @@ -0,0 +1,8798 @@ +# typed: strong + +module Orb + module Models + class SubscriptionSchedulePlanChangeParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + change_option: Symbol, + add_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment]), + add_prices: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice]), + align_billing_with_plan_change_date: T.nilable(T::Boolean), + auto_collection: T.nilable(T::Boolean), + billing_cycle_alignment: T.nilable(Symbol), + billing_cycle_anchor_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAnchorConfiguration), + change_date: T.nilable(Time), + coupon_redemption_code: T.nilable(String), + credits_overage_rate: T.nilable(Float), + default_invoice_memo: T.nilable(String), + external_plan_id: T.nilable(String), + filter: T.nilable(String), + initial_phase_order: T.nilable(Integer), + invoicing_threshold: T.nilable(String), + net_terms: T.nilable(Integer), + per_credit_overage_amount: T.nilable(Float), + plan_id: T.nilable(String), + plan_version_number: T.nilable(Integer), + price_overrides: T.nilable(T::Array[T.anything]), + remove_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::RemoveAdjustment]), + remove_prices: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::RemovePrice]), + replace_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment]), + replace_prices: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice]), + trial_duration_days: T.nilable(Integer) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(Symbol) } + attr_accessor :change_option + + sig { returns(T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment])) } + attr_accessor :add_adjustments + + sig { returns(T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice])) } + attr_accessor :add_prices + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :align_billing_with_plan_change_date + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig { returns(T.nilable(Symbol)) } + attr_accessor :billing_cycle_alignment + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAnchorConfiguration)) + end + attr_accessor :billing_cycle_anchor_configuration + + sig { returns(T.nilable(Time)) } + attr_accessor :change_date + + sig { returns(T.nilable(String)) } + attr_accessor :coupon_redemption_code + + sig { returns(T.nilable(Float)) } + attr_accessor :credits_overage_rate + + sig { returns(T.nilable(String)) } + attr_accessor :default_invoice_memo + + sig { returns(T.nilable(String)) } + attr_accessor :external_plan_id + + sig { returns(T.nilable(String)) } + attr_accessor :filter + + sig { returns(T.nilable(Integer)) } + attr_accessor :initial_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :invoicing_threshold + + sig { returns(T.nilable(Integer)) } + attr_accessor :net_terms + + sig { returns(T.nilable(Float)) } + attr_accessor :per_credit_overage_amount + + sig { returns(T.nilable(String)) } + attr_accessor :plan_id + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_version_number + + sig { returns(T.nilable(T::Array[T.anything])) } + attr_accessor :price_overrides + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::RemoveAdjustment])) + end + attr_accessor :remove_adjustments + + sig { returns(T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::RemovePrice])) } + attr_accessor :remove_prices + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment])) + end + attr_accessor :replace_adjustments + + sig { returns(T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice])) } + attr_accessor :replace_prices + + sig { returns(T.nilable(Integer)) } + attr_accessor :trial_duration_days + + sig do + params( + change_option: Symbol, + add_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment]), + add_prices: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice]), + align_billing_with_plan_change_date: T.nilable(T::Boolean), + auto_collection: T.nilable(T::Boolean), + billing_cycle_alignment: T.nilable(Symbol), + billing_cycle_anchor_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAnchorConfiguration), + change_date: T.nilable(Time), + coupon_redemption_code: T.nilable(String), + credits_overage_rate: T.nilable(Float), + default_invoice_memo: T.nilable(String), + external_plan_id: T.nilable(String), + filter: T.nilable(String), + initial_phase_order: T.nilable(Integer), + invoicing_threshold: T.nilable(String), + net_terms: T.nilable(Integer), + per_credit_overage_amount: T.nilable(Float), + plan_id: T.nilable(String), + plan_version_number: T.nilable(Integer), + price_overrides: T.nilable(T::Array[T.anything]), + remove_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::RemoveAdjustment]), + remove_prices: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::RemovePrice]), + replace_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment]), + replace_prices: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice]), + trial_duration_days: T.nilable(Integer), + request_options: Orb::RequestOpts + ).void + end + def initialize( + change_option:, + add_adjustments: nil, + add_prices: nil, + align_billing_with_plan_change_date: nil, + auto_collection: nil, + billing_cycle_alignment: nil, + billing_cycle_anchor_configuration: nil, + change_date: nil, + coupon_redemption_code: nil, + credits_overage_rate: nil, + default_invoice_memo: nil, + external_plan_id: nil, + filter: nil, + initial_phase_order: nil, + invoicing_threshold: nil, + net_terms: nil, + per_credit_overage_amount: nil, + plan_id: nil, + plan_version_number: nil, + price_overrides: nil, + remove_adjustments: nil, + remove_prices: nil, + replace_adjustments: nil, + replace_prices: nil, + trial_duration_days: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeParams::Shape) } + def to_h; end + + class ChangeOption < Orb::Enum + abstract! + + REQUESTED_DATE = :requested_date + END_OF_SUBSCRIPTION_TERM = :end_of_subscription_term + IMMEDIATE = :immediate + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class AddAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + adjustment: Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::Variants, + end_date: T.nilable(Time), + plan_phase_order: T.nilable(Integer), + start_date: T.nilable(Time) + } + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::Variants) + end + attr_accessor :adjustment + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(Time)) } + attr_accessor :start_date + + sig do + params( + adjustment: Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::Variants, + end_date: T.nilable(Time), + plan_phase_order: T.nilable(Integer), + start_date: T.nilable(Time) + ).void + end + def initialize(adjustment:, end_date: nil, plan_phase_order: nil, start_date: nil); end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewPercentageDiscount, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewUsageDiscount, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewAmountDiscount, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMinimum, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMaximum + ) + end + + class NewPercentageDiscount < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + percentage_discount: Float, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + percentage_discount: Float, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + percentage_discount:, + is_invoice_level: nil, + adjustment_type: :percentage_discount + ) + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewPercentageDiscount::Shape) + end + def to_h; end + end + + class NewUsageDiscount < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + usage_discount: Float, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(Float) } + attr_accessor :usage_discount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + usage_discount: Float, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + usage_discount:, + is_invoice_level: nil, + adjustment_type: :usage_discount + ) + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewUsageDiscount::Shape) + end + def to_h; end + end + + class NewAmountDiscount < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + amount_discount:, + applies_to_price_ids:, + is_invoice_level: nil, + adjustment_type: :amount_discount + ) + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewAmountDiscount::Shape) + end + def to_h; end + end + + class NewMinimum < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + item_id:, + minimum_amount:, + is_invoice_level: nil, + adjustment_type: :minimum + ) + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMinimum::Shape) + end + def to_h; end + end + + class NewMaximum < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + maximum_amount: String, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + maximum_amount: String, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + maximum_amount:, + is_invoice_level: nil, + adjustment_type: :maximum + ) + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMaximum::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewPercentageDiscount + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewUsageDiscount + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewAmountDiscount + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMinimum + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMaximum + ] + ] + ) + end + private_class_method def self.variants; end + end + end + + class AddPrice < Orb::BaseModel + Shape = T.type_alias do + { + discounts: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount]), + end_date: T.nilable(Time), + external_price_id: T.nilable(String), + maximum_amount: T.nilable(String), + minimum_amount: T.nilable(String), + plan_phase_order: T.nilable(Integer), + price: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Variants), + price_id: T.nilable(String), + start_date: T.nilable(Time) + } + end + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount])) + end + attr_accessor :discounts + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Variants)) + end + attr_accessor :price + + sig { returns(T.nilable(String)) } + attr_accessor :price_id + + sig { returns(T.nilable(Time)) } + attr_accessor :start_date + + sig do + params( + discounts: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount]), + end_date: T.nilable(Time), + external_price_id: T.nilable(String), + maximum_amount: T.nilable(String), + minimum_amount: T.nilable(String), + plan_phase_order: T.nilable(Integer), + price: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::Variants), + price_id: T.nilable(String), + start_date: T.nilable(Time) + ).void + end + def initialize( + discounts: nil, + end_date: nil, + external_price_id: nil, + maximum_amount: nil, + minimum_amount: nil, + plan_phase_order: nil, + price: nil, + price_id: nil, + start_date: nil + ); end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Shape) } + def to_h; end + + class Discount < Orb::BaseModel + Shape = T.type_alias do + { + discount_type: Symbol, + amount_discount: T.nilable(String), + percentage_discount: T.nilable(Float), + usage_discount: T.nilable(Float) + } + end + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(String)) } + attr_accessor :amount_discount + + sig { returns(T.nilable(Float)) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Float)) } + attr_accessor :usage_discount + + sig do + params( + discount_type: Symbol, + amount_discount: T.nilable(String), + percentage_discount: T.nilable(Float), + usage_discount: T.nilable(Float) + ).void + end + def initialize(discount_type:, amount_discount: nil, percentage_discount: nil, usage_discount: nil) + end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount::Shape) } + def to_h; end + + class DiscountType < Orb::Enum + abstract! + + PERCENTAGE = :percentage + USAGE = :usage + AMOUNT = :amount + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Price < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice + ) + end + + class NewSubscriptionUnitPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + unit_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig) + end + attr_accessor :unit_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + unit_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + unit_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :unit + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class UnitConfig < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(unit_amount: String).void } + def initialize(unit_amount:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig::Shape) + end + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + package_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig) + end + attr_accessor :package_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + package_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + package_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :package + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class PackageConfig < Orb::BaseModel + Shape = T.type_alias { {package_amount: String, package_size: Integer} } + + sig { returns(String) } + attr_accessor :package_amount + + sig { returns(Integer) } + attr_accessor :package_size + + sig { params(package_amount: String, package_size: Integer).void } + def initialize(package_amount:, package_size:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig::Shape) + end + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionMatrixPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + matrix_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig) + end + attr_accessor :matrix_config + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + matrix_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + matrix_config:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :matrix + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class MatrixConfig < Orb::BaseModel + Shape = T.type_alias do + { + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + } + end + + sig { returns(String) } + attr_accessor :default_unit_amount + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimensions + + sig do + returns(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue]) + end + attr_accessor :matrix_values + + sig do + params( + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + ).void + end + def initialize(default_unit_amount:, dimensions:, matrix_values:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::Shape) + end + def to_h; end + + class MatrixValue < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[T.nilable(String)], unit_amount: String} } + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(dimension_values: T::Array[T.nilable(String)], unit_amount: String).void } + def initialize(dimension_values:, unit_amount:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTieredPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig) + end + attr_accessor :tiered_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TieredConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias { {first_unit: Float, unit_amount: String, last_unit: T.nilable(Float)} } + + sig { returns(Float) } + attr_accessor :first_unit + + sig { returns(String) } + attr_accessor :unit_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :last_unit + + sig { params(first_unit: Float, unit_amount: String, last_unit: T.nilable(Float)).void } + def initialize(first_unit:, unit_amount:, last_unit: nil); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTieredBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig) + end + attr_accessor :tiered_bps_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_bps_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered_bps + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TieredBpsConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias do + { + bps: Float, + minimum_amount: String, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + } + end + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig do + params( + bps: Float, + minimum_amount: String, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + ).void + end + def initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig, + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable( + T::Hash[Symbol, + T.nilable(String)] + ), + reference_id: T.nilable(String) + } + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig) + end + attr_accessor :bps_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig, + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + bps_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :bps + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::Shape) + end + def to_h; end + + class BpsConfig < Orb::BaseModel + Shape = T.type_alias { {bps: Float, per_unit_maximum: T.nilable(String)} } + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig { params(bps: Float, per_unit_maximum: T.nilable(String)).void } + def initialize(bps:, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig::Shape) + end + def to_h; end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionBulkBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable( + T::Hash[Symbol, + T.nilable(String)] + ), + reference_id: T.nilable(String) + } + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig) + end + attr_accessor :bulk_bps_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + bulk_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + bulk_bps_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :bulk_bps + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::Shape) + end + def to_h; end + + class BulkBpsConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias do + {bps: Float, maximum_amount: T.nilable(String), per_unit_maximum: T.nilable(String)} + end + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig do + params( + bps: Float, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + ).void + end + def initialize(bps:, maximum_amount: nil, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier::Shape) + end + def to_h; end + end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionBulkPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig, + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration), + metadata: T.nilable( + T::Hash[Symbol, + T.nilable(String)] + ), + reference_id: T.nilable(String) + } + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig) + end + attr_accessor :bulk_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + bulk_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig, + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + bulk_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :bulk + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::Shape) + end + def to_h; end + + class BulkConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String, maximum_units: T.nilable(Float)} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :maximum_units + + sig { params(unit_amount: String, maximum_units: T.nilable(Float)).void } + def initialize(unit_amount:, maximum_units: nil); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier::Shape) + end + def to_h; end + end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionThresholdTotalAmountPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :threshold_total_amount_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + threshold_total_amount_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :threshold_total_amount + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTieredPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_package_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_package_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_package_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_package_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered_package + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTieredWithMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_with_minimum_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_with_minimum_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered_with_minimum + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionUnitWithPercentPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + unit_with_percent_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :unit_with_percent_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + unit_with_percent_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + unit_with_percent_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :unit_with_percent + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionPackageWithAllocationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + package_with_allocation_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :package_with_allocation_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + package_with_allocation_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + package_with_allocation_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :package_with_allocation + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTierWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_with_proration_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_with_proration_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered_with_proration + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionUnitWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + unit_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :unit_with_proration_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + unit_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + unit_with_proration_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :unit_with_proration + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionGroupedAllocationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + grouped_allocation_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_allocation_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + grouped_allocation_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + grouped_allocation_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :grouped_allocation + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionGroupedWithProratedMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_with_prorated_minimum_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + grouped_with_prorated_minimum_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :grouped_with_prorated_minimum + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionBulkWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_with_proration_config: T::Hash[Symbol, T.anything], + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :bulk_with_proration_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + bulk_with_proration_config: T::Hash[Symbol, T.anything], + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + bulk_with_proration_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :bulk_with_proration + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice + ] + ] + ) + end + private_class_method def self.variants; end + end + end + + class BillingCycleAlignment < Orb::Enum + abstract! + + UNCHANGED = T.let(:unchanged, T.nilable(Symbol)) + PLAN_CHANGE_DATE = T.let(:plan_change_date, T.nilable(Symbol)) + START_OF_MONTH = T.let(:start_of_month, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleAnchorConfiguration < Orb::BaseModel + Shape = T.type_alias { {day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)} } + + sig { returns(Integer) } + attr_accessor :day + + sig { returns(T.nilable(Integer)) } + attr_accessor :month + + sig { returns(T.nilable(Integer)) } + attr_accessor :year + + sig { params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).void } + def initialize(day:, month: nil, year: nil); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAnchorConfiguration::Shape) + end + def to_h; end + end + + class RemoveAdjustment < Orb::BaseModel + Shape = T.type_alias { {adjustment_id: String} } + + sig { returns(String) } + attr_accessor :adjustment_id + + sig { params(adjustment_id: String).void } + def initialize(adjustment_id:); end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeParams::RemoveAdjustment::Shape) } + def to_h; end + end + + class RemovePrice < Orb::BaseModel + Shape = T.type_alias { {external_price_id: T.nilable(String), price_id: T.nilable(String)} } + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(String)) } + attr_accessor :price_id + + sig { params(external_price_id: T.nilable(String), price_id: T.nilable(String)).void } + def initialize(external_price_id: nil, price_id: nil); end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeParams::RemovePrice::Shape) } + def to_h; end + end + + class ReplaceAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + adjustment: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::Variants, + replaces_adjustment_id: String + } + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::Variants) + end + attr_accessor :adjustment + + sig { returns(String) } + attr_accessor :replaces_adjustment_id + + sig do + params( + adjustment: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::Variants, + replaces_adjustment_id: String + ).void + end + def initialize(adjustment:, replaces_adjustment_id:); end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewUsageDiscount, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewAmountDiscount, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMinimum, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMaximum + ) + end + + class NewPercentageDiscount < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + percentage_discount: Float, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + percentage_discount: Float, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + percentage_discount:, + is_invoice_level: nil, + adjustment_type: :percentage_discount + ) + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount::Shape) + end + def to_h; end + end + + class NewUsageDiscount < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + usage_discount: Float, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(Float) } + attr_accessor :usage_discount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + usage_discount: Float, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + usage_discount:, + is_invoice_level: nil, + adjustment_type: :usage_discount + ) + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewUsageDiscount::Shape) + end + def to_h; end + end + + class NewAmountDiscount < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + amount_discount:, + applies_to_price_ids:, + is_invoice_level: nil, + adjustment_type: :amount_discount + ) + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewAmountDiscount::Shape) + end + def to_h; end + end + + class NewMinimum < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + item_id:, + minimum_amount:, + is_invoice_level: nil, + adjustment_type: :minimum + ) + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMinimum::Shape) + end + def to_h; end + end + + class NewMaximum < Orb::BaseModel + Shape = T.type_alias do + { + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + maximum_amount: String, + is_invoice_level: T::Boolean + } + end + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_invoice_level + + sig { params(is_invoice_level: T::Boolean).void } + attr_writer :is_invoice_level + + sig do + params( + applies_to_price_ids: T::Array[String], + maximum_amount: String, + is_invoice_level: T::Boolean, + adjustment_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + maximum_amount:, + is_invoice_level: nil, + adjustment_type: :maximum + ) + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMaximum::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewUsageDiscount + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewAmountDiscount + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMinimum + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMaximum + ] + ] + ) + end + private_class_method def self.variants; end + end + end + + class ReplacePrice < Orb::BaseModel + Shape = T.type_alias do + { + replaces_price_id: String, + discounts: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount]), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + maximum_amount: T.nilable(String), + minimum_amount: T.nilable(String), + price: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Variants), + price_id: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :replaces_price_id + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount])) + end + attr_accessor :discounts + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :minimum_amount + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Variants)) + end + attr_accessor :price + + sig { returns(T.nilable(String)) } + attr_accessor :price_id + + sig do + params( + replaces_price_id: String, + discounts: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount]), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + maximum_amount: T.nilable(String), + minimum_amount: T.nilable(String), + price: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::Variants), + price_id: T.nilable(String) + ).void + end + def initialize( + replaces_price_id:, + discounts: nil, + external_price_id: nil, + fixed_price_quantity: nil, + maximum_amount: nil, + minimum_amount: nil, + price: nil, + price_id: nil + ); end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Shape) } + def to_h; end + + class Discount < Orb::BaseModel + Shape = T.type_alias do + { + discount_type: Symbol, + amount_discount: T.nilable(String), + percentage_discount: T.nilable(Float), + usage_discount: T.nilable(Float) + } + end + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(String)) } + attr_accessor :amount_discount + + sig { returns(T.nilable(Float)) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Float)) } + attr_accessor :usage_discount + + sig do + params( + discount_type: Symbol, + amount_discount: T.nilable(String), + percentage_discount: T.nilable(Float), + usage_discount: T.nilable(Float) + ).void + end + def initialize(discount_type:, amount_discount: nil, percentage_discount: nil, usage_discount: nil) + end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount::Shape) } + def to_h; end + + class DiscountType < Orb::Enum + abstract! + + PERCENTAGE = :percentage + USAGE = :usage + AMOUNT = :amount + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class Price < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice + ) + end + + class NewSubscriptionUnitPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + unit_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig) + end + attr_accessor :unit_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + unit_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + unit_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :unit + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class UnitConfig < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(unit_amount: String).void } + def initialize(unit_amount:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig::Shape) + end + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + package_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig) + end + attr_accessor :package_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + package_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + package_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :package + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class PackageConfig < Orb::BaseModel + Shape = T.type_alias { {package_amount: String, package_size: Integer} } + + sig { returns(String) } + attr_accessor :package_amount + + sig { returns(Integer) } + attr_accessor :package_size + + sig { params(package_amount: String, package_size: Integer).void } + def initialize(package_amount:, package_size:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig::Shape) + end + def to_h; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionMatrixPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + matrix_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig) + end + attr_accessor :matrix_config + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + matrix_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + matrix_config:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :matrix + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class MatrixConfig < Orb::BaseModel + Shape = T.type_alias do + { + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + } + end + + sig { returns(String) } + attr_accessor :default_unit_amount + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimensions + + sig do + returns(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue]) + end + attr_accessor :matrix_values + + sig do + params( + default_unit_amount: String, + dimensions: T::Array[T.nilable(String)], + matrix_values: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + ).void + end + def initialize(default_unit_amount:, dimensions:, matrix_values:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::Shape) + end + def to_h; end + + class MatrixValue < Orb::BaseModel + Shape = T.type_alias { {dimension_values: T::Array[T.nilable(String)], unit_amount: String} } + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :dimension_values + + sig { returns(String) } + attr_accessor :unit_amount + + sig { params(dimension_values: T::Array[T.nilable(String)], unit_amount: String).void } + def initialize(dimension_values:, unit_amount:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTieredPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig) + end + attr_accessor :tiered_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TieredConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias { {first_unit: Float, unit_amount: String, last_unit: T.nilable(Float)} } + + sig { returns(Float) } + attr_accessor :first_unit + + sig { returns(String) } + attr_accessor :unit_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :last_unit + + sig { params(first_unit: Float, unit_amount: String, last_unit: T.nilable(Float)).void } + def initialize(first_unit:, unit_amount:, last_unit: nil); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTieredBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig) + end + attr_accessor :tiered_bps_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_bps_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered_bps + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TieredBpsConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias do + { + bps: Float, + minimum_amount: String, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + } + end + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig do + params( + bps: Float, + minimum_amount: String, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + ).void + end + def initialize(bps:, minimum_amount:, maximum_amount: nil, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier::Shape) + end + def to_h; end + end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig, + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable( + T::Hash[Symbol, + T.nilable(String)] + ), + reference_id: T.nilable(String) + } + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig) + end + attr_accessor :bps_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig, + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + bps_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :bps + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::Shape) + end + def to_h; end + + class BpsConfig < Orb::BaseModel + Shape = T.type_alias { {bps: Float, per_unit_maximum: T.nilable(String)} } + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig { params(bps: Float, per_unit_maximum: T.nilable(String)).void } + def initialize(bps:, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig::Shape) + end + def to_h; end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionBulkBpsPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable( + T::Hash[Symbol, + T.nilable(String)] + ), + reference_id: T.nilable(String) + } + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig) + end + attr_accessor :bulk_bps_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + bulk_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + bulk_bps_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :bulk_bps + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::Shape) + end + def to_h; end + + class BulkBpsConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias do + {bps: Float, maximum_amount: T.nilable(String), per_unit_maximum: T.nilable(String)} + end + + sig { returns(Float) } + attr_accessor :bps + + sig { returns(T.nilable(String)) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(String)) } + attr_accessor :per_unit_maximum + + sig do + params( + bps: Float, + maximum_amount: T.nilable(String), + per_unit_maximum: T.nilable(String) + ).void + end + def initialize(bps:, maximum_amount: nil, per_unit_maximum: nil); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier::Shape) + end + def to_h; end + end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionBulkPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig, + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration), + metadata: T.nilable( + T::Hash[Symbol, + T.nilable(String)] + ), + reference_id: T.nilable(String) + } + end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig) + end + attr_accessor :bulk_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + bulk_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig, + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + bulk_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :bulk + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::Shape) + end + def to_h; end + + class BulkConfig < Orb::BaseModel + Shape = T.type_alias do + {tiers: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier]} + end + + sig do + returns(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier]) + end + attr_accessor :tiers + + sig do + params( + tiers: T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + ).void + end + def initialize(tiers:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Shape) + end + def to_h; end + + class Tier < Orb::BaseModel + Shape = T.type_alias { {unit_amount: String, maximum_units: T.nilable(Float)} } + + sig { returns(String) } + attr_accessor :unit_amount + + sig { returns(T.nilable(Float)) } + attr_accessor :maximum_units + + sig { params(unit_amount: String, maximum_units: T.nilable(Float)).void } + def initialize(unit_amount:, maximum_units: nil); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier::Shape) + end + def to_h; end + end + end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionThresholdTotalAmountPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :threshold_total_amount_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + threshold_total_amount_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :threshold_total_amount + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTieredPackagePrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_package_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_package_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_package_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_package_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered_package + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTieredWithMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_with_minimum_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_with_minimum_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered_with_minimum + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionUnitWithPercentPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + unit_with_percent_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :unit_with_percent_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + unit_with_percent_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + unit_with_percent_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :unit_with_percent + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionPackageWithAllocationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + package_with_allocation_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :package_with_allocation_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + package_with_allocation_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + package_with_allocation_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :package_with_allocation + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionTierWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + tiered_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :tiered_with_proration_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + tiered_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + tiered_with_proration_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :tiered_with_proration + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionUnitWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + unit_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :unit_with_proration_config + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + item_id: String, + name: String, + unit_with_proration_config: T::Hash[Symbol, T.anything], + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + item_id:, + name:, + unit_with_proration_config:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :unit_with_proration + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionGroupedAllocationPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + grouped_allocation_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_allocation_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + grouped_allocation_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + grouped_allocation_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :grouped_allocation + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionGroupedWithProratedMinimumPrice < Orb::BaseModel + Shape = T.type_alias do + { + cadence: Symbol, + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :grouped_with_prorated_minimum_config + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + cadence: Symbol, + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + cadence:, + grouped_with_prorated_minimum_config:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :grouped_with_prorated_minimum + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class NewSubscriptionBulkWithProrationPrice < Orb::BaseModel + Shape = T.type_alias do + { + bulk_with_proration_config: T::Hash[Symbol, T.anything], + cadence: Symbol, + item_id: String, + model_type: Symbol, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String) + } + end + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :bulk_with_proration_config + + sig { returns(Symbol) } + attr_accessor :cadence + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(Symbol) } + attr_accessor :model_type + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :billable_metric_id + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :billed_in_advance + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration)) + end + attr_accessor :billing_cycle_configuration + + sig { returns(T.nilable(Float)) } + attr_accessor :conversion_rate + + sig { returns(T.nilable(String)) } + attr_accessor :currency + + sig { returns(T.nilable(String)) } + attr_accessor :external_price_id + + sig { returns(T.nilable(Float)) } + attr_accessor :fixed_price_quantity + + sig { returns(T.nilable(String)) } + attr_accessor :invoice_grouping_key + + sig do + returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration)) + end + attr_accessor :invoicing_cycle_configuration + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig do + params( + bulk_with_proration_config: T::Hash[Symbol, T.anything], + cadence: Symbol, + item_id: String, + name: String, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + currency: T.nilable(String), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + reference_id: T.nilable(String), + model_type: Symbol + ).void + end + def initialize( + bulk_with_proration_config:, + cadence:, + item_id:, + name:, + billable_metric_id: nil, + billed_in_advance: nil, + billing_cycle_configuration: nil, + conversion_rate: nil, + currency: nil, + external_price_id: nil, + fixed_price_quantity: nil, + invoice_grouping_key: nil, + invoicing_cycle_configuration: nil, + metadata: nil, + reference_id: nil, + model_type: :bulk_with_proration + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::Shape) + end + def to_h; end + + class Cadence < Orb::Enum + abstract! + + ANNUAL = :annual + SEMI_ANNUAL = :semi_annual + MONTHLY = :monthly + QUARTERLY = :quarterly + ONE_TIME = :one_time + CUSTOM = :custom + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class BillingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + + class InvoicingCycleConfiguration < Orb::BaseModel + Shape = T.type_alias { {duration: Integer, duration_unit: Symbol} } + + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :duration_unit + + sig { params(duration: Integer, duration_unit: Symbol).void } + def initialize(duration:, duration_unit:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::Shape) + end + def to_h; end + + class DurationUnit < Orb::Enum + abstract! + + DAY = :day + MONTH = :month + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice + ] + ] + ) + end + private_class_method def self.variants; end + end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_schedule_plan_change_response.rbi b/rbi/lib/orb/models/subscription_schedule_plan_change_response.rbi new file mode 100644 index 00000000..6883134f --- /dev/null +++ b/rbi/lib/orb/models/subscription_schedule_plan_change_response.rbi @@ -0,0 +1,1035 @@ +# typed: strong + +module Orb + module Models + class SubscriptionSchedulePlanChangeResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionSchedulePlanChangeResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionSchedulePlanChangeResponse::TrialInfo + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Integer)) } + attr_accessor :active_plan_phase_order + + sig { returns(T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval]) } + attr_accessor :adjustment_intervals + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::BillingCycleAnchorConfiguration) } + attr_accessor :billing_cycle_anchor_configuration + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(Orb::Models::Customer) } + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :default_invoice_memo + + sig do + returns(T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::Variants]) + end + attr_accessor :discount_intervals + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::FixedFeeQuantitySchedule]) } + attr_accessor :fixed_fee_quantity_schedule + + sig { returns(T.nilable(String)) } + attr_accessor :invoicing_threshold + + sig { returns(T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::MaximumInterval]) } + attr_accessor :maximum_intervals + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::MinimumInterval]) } + attr_accessor :minimum_intervals + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(Orb::Models::Plan) } + attr_accessor :plan + + sig { returns(T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval]) } + attr_accessor :price_intervals + + sig { returns(T.nilable(Orb::Models::SubscriptionSchedulePlanChangeResponse::RedeemedCoupon)) } + attr_accessor :redeemed_coupon + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::TrialInfo) } + attr_accessor :trial_info + + sig do + params( + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionSchedulePlanChangeResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionSchedulePlanChangeResponse::TrialInfo + ).void + end + def initialize( + id:, + active_plan_phase_order:, + adjustment_intervals:, + auto_collection:, + billing_cycle_anchor_configuration:, + billing_cycle_day:, + created_at:, + current_billing_period_end_date:, + current_billing_period_start_date:, + customer:, + default_invoice_memo:, + discount_intervals:, + end_date:, + fixed_fee_quantity_schedule:, + invoicing_threshold:, + maximum_intervals:, + metadata:, + minimum_intervals:, + net_terms:, + plan:, + price_intervals:, + redeemed_coupon:, + start_date:, + status:, + trial_info: + ); end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::Shape) } + def to_h; end + + class AdjustmentInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment: Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::Variants) + end + attr_accessor :adjustment + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + adjustment: Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + ).void + end + def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ) + end + + class AmountDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + amount_discount:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + adjustment_type: :amount_discount + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment::Shape) + end + def to_h; end + end + + class PercentageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + percentage_discount:, + plan_phase_order:, + reason:, + adjustment_type: :percentage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment::Shape) + end + def to_h; end + end + + class UsageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float, + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + usage_discount:, + adjustment_type: :usage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment::Shape) + end + def to_h; end + end + + class MinimumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + item_id:, + minimum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :minimum + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MinimumAdjustment::Shape) + end + def to_h; end + end + + class MaximumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + maximum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :maximum + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MaximumAdjustment::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ] + ] + ) + end + private_class_method def self.variants; end + end + end + + class BillingCycleAnchorConfiguration < Orb::BaseModel + Shape = T.type_alias { {day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)} } + + sig { returns(Integer) } + attr_accessor :day + + sig { returns(T.nilable(Integer)) } + attr_accessor :month + + sig { returns(T.nilable(Integer)) } + attr_accessor :year + + sig { params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).void } + def initialize(day:, month: nil, year: nil); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::BillingCycleAnchorConfiguration::Shape) + end + def to_h; end + end + + class DiscountInterval < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::AmountDiscountInterval, + Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::PercentageDiscountInterval, + Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::UsageDiscountInterval + ) + end + + class AmountDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + amount_discount:, + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + discount_type: :amount + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::AmountDiscountInterval::Shape) + end + def to_h; end + end + + class PercentageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + percentage_discount:, + start_date:, + discount_type: :percentage + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::PercentageDiscountInterval::Shape) + end + def to_h; end + end + + class UsageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + usage_discount:, + discount_type: :usage + ); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::UsageDiscountInterval::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::AmountDiscountInterval + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::PercentageDiscountInterval + ], + [ + Symbol, + Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::UsageDiscountInterval + ] + ] + ) + end + private_class_method def self.variants; end + end + + class FixedFeeQuantitySchedule < Orb::BaseModel + Shape = T.type_alias do + {end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time} + end + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time).void } + def initialize(end_date:, price_id:, quantity:, start_date:); end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::FixedFeeQuantitySchedule::Shape) } + def to_h; end + end + + class MaximumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + maximum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::MaximumInterval::Shape) } + def to_h; end + end + + class MinimumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + minimum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::MinimumInterval::Shape) } + def to_h; end + end + + class PriceInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval::FixedFeeQuantityTransition])) + end + attr_accessor :fixed_fee_quantity_transitions + + sig { returns(Orb::Models::Price::Variants) } + attr_accessor :price + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + ).void + end + def initialize( + id:, + billing_cycle_day:, + current_billing_period_end_date:, + current_billing_period_start_date:, + end_date:, + fixed_fee_quantity_transitions:, + price:, + start_date: + ); end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval::Shape) } + def to_h; end + + class FixedFeeQuantityTransition < Orb::BaseModel + Shape = T.type_alias { {effective_date: Time, price_id: String, quantity: Integer} } + + sig { returns(Time) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Integer) } + attr_accessor :quantity + + sig { params(effective_date: Time, price_id: String, quantity: Integer).void } + def initialize(effective_date:, price_id:, quantity:); end + + sig do + returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval::FixedFeeQuantityTransition::Shape) + end + def to_h; end + end + end + + class RedeemedCoupon < Orb::BaseModel + Shape = T.type_alias { {coupon_id: String, end_date: T.nilable(Time), start_date: Time} } + + sig { returns(String) } + attr_accessor :coupon_id + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(coupon_id: String, end_date: T.nilable(Time), start_date: Time).void } + def initialize(coupon_id:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::RedeemedCoupon::Shape) } + def to_h; end + end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TrialInfo < Orb::BaseModel + Shape = T.type_alias { {end_date: T.nilable(Time)} } + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { params(end_date: T.nilable(Time)).void } + def initialize(end_date:); end + + sig { returns(Orb::Models::SubscriptionSchedulePlanChangeResponse::TrialInfo::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_trigger_phase_params.rbi b/rbi/lib/orb/models/subscription_trigger_phase_params.rbi new file mode 100644 index 00000000..bb886116 --- /dev/null +++ b/rbi/lib/orb/models/subscription_trigger_phase_params.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Orb + module Models + class SubscriptionTriggerPhaseParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({effective_date: T.nilable(Date)}, Orb::RequestParameters::Shape) } + + sig { returns(T.nilable(Date)) } + attr_accessor :effective_date + + sig { params(effective_date: T.nilable(Date), request_options: Orb::RequestOpts).void } + def initialize(effective_date: nil, request_options: {}); end + + sig { returns(Orb::Models::SubscriptionTriggerPhaseParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/subscription_trigger_phase_response.rbi b/rbi/lib/orb/models/subscription_trigger_phase_response.rbi new file mode 100644 index 00000000..1e05345e --- /dev/null +++ b/rbi/lib/orb/models/subscription_trigger_phase_response.rbi @@ -0,0 +1,1028 @@ +# typed: strong + +module Orb + module Models + class SubscriptionTriggerPhaseResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionTriggerPhaseResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionTriggerPhaseResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionTriggerPhaseResponse::TrialInfo + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Integer)) } + attr_accessor :active_plan_phase_order + + sig { returns(T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval]) } + attr_accessor :adjustment_intervals + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig { returns(Orb::Models::SubscriptionTriggerPhaseResponse::BillingCycleAnchorConfiguration) } + attr_accessor :billing_cycle_anchor_configuration + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(Orb::Models::Customer) } + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :default_invoice_memo + + sig { returns(T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::Variants]) } + attr_accessor :discount_intervals + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::FixedFeeQuantitySchedule]) } + attr_accessor :fixed_fee_quantity_schedule + + sig { returns(T.nilable(String)) } + attr_accessor :invoicing_threshold + + sig { returns(T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::MaximumInterval]) } + attr_accessor :maximum_intervals + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::MinimumInterval]) } + attr_accessor :minimum_intervals + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(Orb::Models::Plan) } + attr_accessor :plan + + sig { returns(T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval]) } + attr_accessor :price_intervals + + sig { returns(T.nilable(Orb::Models::SubscriptionTriggerPhaseResponse::RedeemedCoupon)) } + attr_accessor :redeemed_coupon + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Orb::Models::SubscriptionTriggerPhaseResponse::TrialInfo) } + attr_accessor :trial_info + + sig do + params( + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionTriggerPhaseResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionTriggerPhaseResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionTriggerPhaseResponse::TrialInfo + ).void + end + def initialize( + id:, + active_plan_phase_order:, + adjustment_intervals:, + auto_collection:, + billing_cycle_anchor_configuration:, + billing_cycle_day:, + created_at:, + current_billing_period_end_date:, + current_billing_period_start_date:, + customer:, + default_invoice_memo:, + discount_intervals:, + end_date:, + fixed_fee_quantity_schedule:, + invoicing_threshold:, + maximum_intervals:, + metadata:, + minimum_intervals:, + net_terms:, + plan:, + price_intervals:, + redeemed_coupon:, + start_date:, + status:, + trial_info: + ); end + + sig { returns(Orb::Models::SubscriptionTriggerPhaseResponse::Shape) } + def to_h; end + + class AdjustmentInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment: Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns(Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::Variants) + end + attr_accessor :adjustment + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + adjustment: Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + ).void + end + def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ) + end + + class AmountDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + amount_discount:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + adjustment_type: :amount_discount + ); end + + sig do + returns(Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment::Shape) + end + def to_h; end + end + + class PercentageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + percentage_discount:, + plan_phase_order:, + reason:, + adjustment_type: :percentage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment::Shape) + end + def to_h; end + end + + class UsageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float, + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + usage_discount:, + adjustment_type: :usage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment::Shape) + end + def to_h; end + end + + class MinimumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + item_id:, + minimum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :minimum + ); end + + sig do + returns(Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MinimumAdjustment::Shape) + end + def to_h; end + end + + class MaximumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + maximum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :maximum + ); end + + sig do + returns(Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MaximumAdjustment::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ] + ] + ) + end + private_class_method def self.variants; end + end + end + + class BillingCycleAnchorConfiguration < Orb::BaseModel + Shape = T.type_alias { {day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)} } + + sig { returns(Integer) } + attr_accessor :day + + sig { returns(T.nilable(Integer)) } + attr_accessor :month + + sig { returns(T.nilable(Integer)) } + attr_accessor :year + + sig { params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).void } + def initialize(day:, month: nil, year: nil); end + + sig { returns(Orb::Models::SubscriptionTriggerPhaseResponse::BillingCycleAnchorConfiguration::Shape) } + def to_h; end + end + + class DiscountInterval < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::AmountDiscountInterval, + Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::PercentageDiscountInterval, + Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::UsageDiscountInterval + ) + end + + class AmountDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + amount_discount:, + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + discount_type: :amount + ); end + + sig do + returns(Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::AmountDiscountInterval::Shape) + end + def to_h; end + end + + class PercentageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + percentage_discount:, + start_date:, + discount_type: :percentage + ); end + + sig do + returns(Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::PercentageDiscountInterval::Shape) + end + def to_h; end + end + + class UsageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + usage_discount:, + discount_type: :usage + ); end + + sig do + returns(Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::UsageDiscountInterval::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::AmountDiscountInterval + ], + [ + Symbol, + Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::PercentageDiscountInterval + ], + [Symbol, Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::UsageDiscountInterval] + ] + ) + end + private_class_method def self.variants; end + end + + class FixedFeeQuantitySchedule < Orb::BaseModel + Shape = T.type_alias do + {end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time} + end + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time).void } + def initialize(end_date:, price_id:, quantity:, start_date:); end + + sig { returns(Orb::Models::SubscriptionTriggerPhaseResponse::FixedFeeQuantitySchedule::Shape) } + def to_h; end + end + + class MaximumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + maximum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionTriggerPhaseResponse::MaximumInterval::Shape) } + def to_h; end + end + + class MinimumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + minimum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionTriggerPhaseResponse::MinimumInterval::Shape) } + def to_h; end + end + + class PriceInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval::FixedFeeQuantityTransition])) + end + attr_accessor :fixed_fee_quantity_transitions + + sig { returns(Orb::Models::Price::Variants) } + attr_accessor :price + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + ).void + end + def initialize( + id:, + billing_cycle_day:, + current_billing_period_end_date:, + current_billing_period_start_date:, + end_date:, + fixed_fee_quantity_transitions:, + price:, + start_date: + ); end + + sig { returns(Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval::Shape) } + def to_h; end + + class FixedFeeQuantityTransition < Orb::BaseModel + Shape = T.type_alias { {effective_date: Time, price_id: String, quantity: Integer} } + + sig { returns(Time) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Integer) } + attr_accessor :quantity + + sig { params(effective_date: Time, price_id: String, quantity: Integer).void } + def initialize(effective_date:, price_id:, quantity:); end + + sig do + returns(Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval::FixedFeeQuantityTransition::Shape) + end + def to_h; end + end + end + + class RedeemedCoupon < Orb::BaseModel + Shape = T.type_alias { {coupon_id: String, end_date: T.nilable(Time), start_date: Time} } + + sig { returns(String) } + attr_accessor :coupon_id + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(coupon_id: String, end_date: T.nilable(Time), start_date: Time).void } + def initialize(coupon_id:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionTriggerPhaseResponse::RedeemedCoupon::Shape) } + def to_h; end + end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TrialInfo < Orb::BaseModel + Shape = T.type_alias { {end_date: T.nilable(Time)} } + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { params(end_date: T.nilable(Time)).void } + def initialize(end_date:); end + + sig { returns(Orb::Models::SubscriptionTriggerPhaseResponse::TrialInfo::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_unschedule_cancellation_params.rbi b/rbi/lib/orb/models/subscription_unschedule_cancellation_params.rbi new file mode 100644 index 00000000..5a220077 --- /dev/null +++ b/rbi/lib/orb/models/subscription_unschedule_cancellation_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class SubscriptionUnscheduleCancellationParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::SubscriptionUnscheduleCancellationParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/subscription_unschedule_cancellation_response.rbi b/rbi/lib/orb/models/subscription_unschedule_cancellation_response.rbi new file mode 100644 index 00000000..8afcd77f --- /dev/null +++ b/rbi/lib/orb/models/subscription_unschedule_cancellation_response.rbi @@ -0,0 +1,1041 @@ +# typed: strong + +module Orb + module Models + class SubscriptionUnscheduleCancellationResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnscheduleCancellationResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionUnscheduleCancellationResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionUnscheduleCancellationResponse::TrialInfo + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Integer)) } + attr_accessor :active_plan_phase_order + + sig { returns(T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval]) } + attr_accessor :adjustment_intervals + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig do + returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::BillingCycleAnchorConfiguration) + end + attr_accessor :billing_cycle_anchor_configuration + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(Orb::Models::Customer) } + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :default_invoice_memo + + sig do + returns(T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::Variants]) + end + attr_accessor :discount_intervals + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig do + returns(T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::FixedFeeQuantitySchedule]) + end + attr_accessor :fixed_fee_quantity_schedule + + sig { returns(T.nilable(String)) } + attr_accessor :invoicing_threshold + + sig { returns(T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::MaximumInterval]) } + attr_accessor :maximum_intervals + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::MinimumInterval]) } + attr_accessor :minimum_intervals + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(Orb::Models::Plan) } + attr_accessor :plan + + sig { returns(T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval]) } + attr_accessor :price_intervals + + sig { returns(T.nilable(Orb::Models::SubscriptionUnscheduleCancellationResponse::RedeemedCoupon)) } + attr_accessor :redeemed_coupon + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::TrialInfo) } + attr_accessor :trial_info + + sig do + params( + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnscheduleCancellationResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionUnscheduleCancellationResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionUnscheduleCancellationResponse::TrialInfo + ).void + end + def initialize( + id:, + active_plan_phase_order:, + adjustment_intervals:, + auto_collection:, + billing_cycle_anchor_configuration:, + billing_cycle_day:, + created_at:, + current_billing_period_end_date:, + current_billing_period_start_date:, + customer:, + default_invoice_memo:, + discount_intervals:, + end_date:, + fixed_fee_quantity_schedule:, + invoicing_threshold:, + maximum_intervals:, + metadata:, + minimum_intervals:, + net_terms:, + plan:, + price_intervals:, + redeemed_coupon:, + start_date:, + status:, + trial_info: + ); end + + sig { returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::Shape) } + def to_h; end + + class AdjustmentInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment: Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::Variants) + end + attr_accessor :adjustment + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + adjustment: Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + ).void + end + def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ) + end + + class AmountDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + amount_discount:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + adjustment_type: :amount_discount + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment::Shape) + end + def to_h; end + end + + class PercentageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + percentage_discount:, + plan_phase_order:, + reason:, + adjustment_type: :percentage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment::Shape) + end + def to_h; end + end + + class UsageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float, + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + usage_discount:, + adjustment_type: :usage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment::Shape) + end + def to_h; end + end + + class MinimumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + item_id:, + minimum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :minimum + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MinimumAdjustment::Shape) + end + def to_h; end + end + + class MaximumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + maximum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :maximum + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MaximumAdjustment::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ] + ] + ) + end + private_class_method def self.variants; end + end + end + + class BillingCycleAnchorConfiguration < Orb::BaseModel + Shape = T.type_alias { {day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)} } + + sig { returns(Integer) } + attr_accessor :day + + sig { returns(T.nilable(Integer)) } + attr_accessor :month + + sig { returns(T.nilable(Integer)) } + attr_accessor :year + + sig { params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).void } + def initialize(day:, month: nil, year: nil); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::BillingCycleAnchorConfiguration::Shape) + end + def to_h; end + end + + class DiscountInterval < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::AmountDiscountInterval, + Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::PercentageDiscountInterval, + Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::UsageDiscountInterval + ) + end + + class AmountDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + amount_discount:, + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + discount_type: :amount + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::AmountDiscountInterval::Shape) + end + def to_h; end + end + + class PercentageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + percentage_discount:, + start_date:, + discount_type: :percentage + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::PercentageDiscountInterval::Shape) + end + def to_h; end + end + + class UsageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + usage_discount:, + discount_type: :usage + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::UsageDiscountInterval::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::AmountDiscountInterval + ], + [ + Symbol, + Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::PercentageDiscountInterval + ], + [ + Symbol, + Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::UsageDiscountInterval + ] + ] + ) + end + private_class_method def self.variants; end + end + + class FixedFeeQuantitySchedule < Orb::BaseModel + Shape = T.type_alias do + {end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time} + end + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time).void } + def initialize(end_date:, price_id:, quantity:, start_date:); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::FixedFeeQuantitySchedule::Shape) + end + def to_h; end + end + + class MaximumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + maximum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::MaximumInterval::Shape) } + def to_h; end + end + + class MinimumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + minimum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::MinimumInterval::Shape) } + def to_h; end + end + + class PriceInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval::FixedFeeQuantityTransition])) + end + attr_accessor :fixed_fee_quantity_transitions + + sig { returns(Orb::Models::Price::Variants) } + attr_accessor :price + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + ).void + end + def initialize( + id:, + billing_cycle_day:, + current_billing_period_end_date:, + current_billing_period_start_date:, + end_date:, + fixed_fee_quantity_transitions:, + price:, + start_date: + ); end + + sig { returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval::Shape) } + def to_h; end + + class FixedFeeQuantityTransition < Orb::BaseModel + Shape = T.type_alias { {effective_date: Time, price_id: String, quantity: Integer} } + + sig { returns(Time) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Integer) } + attr_accessor :quantity + + sig { params(effective_date: Time, price_id: String, quantity: Integer).void } + def initialize(effective_date:, price_id:, quantity:); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval::FixedFeeQuantityTransition::Shape) + end + def to_h; end + end + end + + class RedeemedCoupon < Orb::BaseModel + Shape = T.type_alias { {coupon_id: String, end_date: T.nilable(Time), start_date: Time} } + + sig { returns(String) } + attr_accessor :coupon_id + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(coupon_id: String, end_date: T.nilable(Time), start_date: Time).void } + def initialize(coupon_id:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::RedeemedCoupon::Shape) } + def to_h; end + end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TrialInfo < Orb::BaseModel + Shape = T.type_alias { {end_date: T.nilable(Time)} } + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { params(end_date: T.nilable(Time)).void } + def initialize(end_date:); end + + sig { returns(Orb::Models::SubscriptionUnscheduleCancellationResponse::TrialInfo::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbi b/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbi new file mode 100644 index 00000000..8099985d --- /dev/null +++ b/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Orb + module Models + class SubscriptionUnscheduleFixedFeeQuantityUpdatesParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({price_id: String}, Orb::RequestParameters::Shape) } + + sig { returns(String) } + attr_accessor :price_id + + sig { params(price_id: String, request_options: Orb::RequestOpts).void } + def initialize(price_id:, request_options: {}); end + + sig { returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbi b/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbi new file mode 100644 index 00000000..3b082431 --- /dev/null +++ b/rbi/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbi @@ -0,0 +1,1059 @@ +# typed: strong + +module Orb + module Models + class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::TrialInfo + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Integer)) } + attr_accessor :active_plan_phase_order + + sig do + returns(T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval]) + end + attr_accessor :adjustment_intervals + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::BillingCycleAnchorConfiguration) + end + attr_accessor :billing_cycle_anchor_configuration + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(Orb::Models::Customer) } + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :default_invoice_memo + + sig do + returns(T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::Variants]) + end + attr_accessor :discount_intervals + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig do + returns(T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::FixedFeeQuantitySchedule]) + end + attr_accessor :fixed_fee_quantity_schedule + + sig { returns(T.nilable(String)) } + attr_accessor :invoicing_threshold + + sig do + returns(T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::MaximumInterval]) + end + attr_accessor :maximum_intervals + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig do + returns(T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::MinimumInterval]) + end + attr_accessor :minimum_intervals + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(Orb::Models::Plan) } + attr_accessor :plan + + sig do + returns(T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval]) + end + attr_accessor :price_intervals + + sig do + returns(T.nilable(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::RedeemedCoupon)) + end + attr_accessor :redeemed_coupon + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::TrialInfo) } + attr_accessor :trial_info + + sig do + params( + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::TrialInfo + ).void + end + def initialize( + id:, + active_plan_phase_order:, + adjustment_intervals:, + auto_collection:, + billing_cycle_anchor_configuration:, + billing_cycle_day:, + created_at:, + current_billing_period_end_date:, + current_billing_period_start_date:, + customer:, + default_invoice_memo:, + discount_intervals:, + end_date:, + fixed_fee_quantity_schedule:, + invoicing_threshold:, + maximum_intervals:, + metadata:, + minimum_intervals:, + net_terms:, + plan:, + price_intervals:, + redeemed_coupon:, + start_date:, + status:, + trial_info: + ); end + + sig { returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::Shape) } + def to_h; end + + class AdjustmentInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::Variants) + end + attr_accessor :adjustment + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + adjustment: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + ).void + end + def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Shape) + end + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ) + end + + class AmountDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + amount_discount:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + adjustment_type: :amount_discount + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment::Shape) + end + def to_h; end + end + + class PercentageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + percentage_discount:, + plan_phase_order:, + reason:, + adjustment_type: :percentage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment::Shape) + end + def to_h; end + end + + class UsageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float, + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + usage_discount:, + adjustment_type: :usage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment::Shape) + end + def to_h; end + end + + class MinimumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + item_id:, + minimum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :minimum + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment::Shape) + end + def to_h; end + end + + class MaximumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + maximum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :maximum + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ] + ] + ) + end + private_class_method def self.variants; end + end + end + + class BillingCycleAnchorConfiguration < Orb::BaseModel + Shape = T.type_alias { {day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)} } + + sig { returns(Integer) } + attr_accessor :day + + sig { returns(T.nilable(Integer)) } + attr_accessor :month + + sig { returns(T.nilable(Integer)) } + attr_accessor :year + + sig { params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).void } + def initialize(day:, month: nil, year: nil); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::BillingCycleAnchorConfiguration::Shape) + end + def to_h; end + end + + class DiscountInterval < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::AmountDiscountInterval, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::PercentageDiscountInterval, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::UsageDiscountInterval + ) + end + + class AmountDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + amount_discount:, + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + discount_type: :amount + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::AmountDiscountInterval::Shape) + end + def to_h; end + end + + class PercentageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + percentage_discount:, + start_date:, + discount_type: :percentage + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::PercentageDiscountInterval::Shape) + end + def to_h; end + end + + class UsageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + usage_discount:, + discount_type: :usage + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::UsageDiscountInterval::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::AmountDiscountInterval + ], + [ + Symbol, + Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::PercentageDiscountInterval + ], + [ + Symbol, + Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::UsageDiscountInterval + ] + ] + ) + end + private_class_method def self.variants; end + end + + class FixedFeeQuantitySchedule < Orb::BaseModel + Shape = T.type_alias do + {end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time} + end + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time).void } + def initialize(end_date:, price_id:, quantity:, start_date:); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::FixedFeeQuantitySchedule::Shape) + end + def to_h; end + end + + class MaximumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + maximum_amount:, + start_date: + ) + end + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::MaximumInterval::Shape) + end + def to_h; end + end + + class MinimumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + minimum_amount:, + start_date: + ) + end + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::MinimumInterval::Shape) + end + def to_h; end + end + + class PriceInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval::FixedFeeQuantityTransition])) + end + attr_accessor :fixed_fee_quantity_transitions + + sig { returns(Orb::Models::Price::Variants) } + attr_accessor :price + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + ).void + end + def initialize( + id:, + billing_cycle_day:, + current_billing_period_end_date:, + current_billing_period_start_date:, + end_date:, + fixed_fee_quantity_transitions:, + price:, + start_date: + ); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval::Shape) + end + def to_h; end + + class FixedFeeQuantityTransition < Orb::BaseModel + Shape = T.type_alias { {effective_date: Time, price_id: String, quantity: Integer} } + + sig { returns(Time) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Integer) } + attr_accessor :quantity + + sig { params(effective_date: Time, price_id: String, quantity: Integer).void } + def initialize(effective_date:, price_id:, quantity:); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval::FixedFeeQuantityTransition::Shape) + end + def to_h; end + end + end + + class RedeemedCoupon < Orb::BaseModel + Shape = T.type_alias { {coupon_id: String, end_date: T.nilable(Time), start_date: Time} } + + sig { returns(String) } + attr_accessor :coupon_id + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(coupon_id: String, end_date: T.nilable(Time), start_date: Time).void } + def initialize(coupon_id:, end_date:, start_date:); end + + sig do + returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::RedeemedCoupon::Shape) + end + def to_h; end + end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TrialInfo < Orb::BaseModel + Shape = T.type_alias { {end_date: T.nilable(Time)} } + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { params(end_date: T.nilable(Time)).void } + def initialize(end_date:); end + + sig { returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::TrialInfo::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rbi b/rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rbi new file mode 100644 index 00000000..b93eef4c --- /dev/null +++ b/rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class SubscriptionUnschedulePendingPlanChangesParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rbi b/rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rbi new file mode 100644 index 00000000..c3bacffd --- /dev/null +++ b/rbi/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rbi @@ -0,0 +1,1049 @@ +# typed: strong + +module Orb + module Models + class SubscriptionUnschedulePendingPlanChangesResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::TrialInfo + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Integer)) } + attr_accessor :active_plan_phase_order + + sig do + returns(T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval]) + end + attr_accessor :adjustment_intervals + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig do + returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::BillingCycleAnchorConfiguration) + end + attr_accessor :billing_cycle_anchor_configuration + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(Orb::Models::Customer) } + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :default_invoice_memo + + sig do + returns(T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::Variants]) + end + attr_accessor :discount_intervals + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig do + returns(T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::FixedFeeQuantitySchedule]) + end + attr_accessor :fixed_fee_quantity_schedule + + sig { returns(T.nilable(String)) } + attr_accessor :invoicing_threshold + + sig do + returns(T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::MaximumInterval]) + end + attr_accessor :maximum_intervals + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig do + returns(T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::MinimumInterval]) + end + attr_accessor :minimum_intervals + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(Orb::Models::Plan) } + attr_accessor :plan + + sig { returns(T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval]) } + attr_accessor :price_intervals + + sig do + returns(T.nilable(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::RedeemedCoupon)) + end + attr_accessor :redeemed_coupon + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::TrialInfo) } + attr_accessor :trial_info + + sig do + params( + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::TrialInfo + ).void + end + def initialize( + id:, + active_plan_phase_order:, + adjustment_intervals:, + auto_collection:, + billing_cycle_anchor_configuration:, + billing_cycle_day:, + created_at:, + current_billing_period_end_date:, + current_billing_period_start_date:, + customer:, + default_invoice_memo:, + discount_intervals:, + end_date:, + fixed_fee_quantity_schedule:, + invoicing_threshold:, + maximum_intervals:, + metadata:, + minimum_intervals:, + net_terms:, + plan:, + price_intervals:, + redeemed_coupon:, + start_date:, + status:, + trial_info: + ); end + + sig { returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::Shape) } + def to_h; end + + class AdjustmentInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::Variants) + end + attr_accessor :adjustment + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + adjustment: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + ).void + end + def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:); end + + sig do + returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Shape) + end + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ) + end + + class AmountDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + amount_discount:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + adjustment_type: :amount_discount + ); end + + sig do + returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment::Shape) + end + def to_h; end + end + + class PercentageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + percentage_discount:, + plan_phase_order:, + reason:, + adjustment_type: :percentage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment::Shape) + end + def to_h; end + end + + class UsageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float, + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + usage_discount:, + adjustment_type: :usage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment::Shape) + end + def to_h; end + end + + class MinimumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + item_id:, + minimum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :minimum + ); end + + sig do + returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment::Shape) + end + def to_h; end + end + + class MaximumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + maximum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :maximum + ); end + + sig do + returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ] + ] + ) + end + private_class_method def self.variants; end + end + end + + class BillingCycleAnchorConfiguration < Orb::BaseModel + Shape = T.type_alias { {day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)} } + + sig { returns(Integer) } + attr_accessor :day + + sig { returns(T.nilable(Integer)) } + attr_accessor :month + + sig { returns(T.nilable(Integer)) } + attr_accessor :year + + sig { params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).void } + def initialize(day:, month: nil, year: nil); end + + sig do + returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::BillingCycleAnchorConfiguration::Shape) + end + def to_h; end + end + + class DiscountInterval < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::AmountDiscountInterval, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::PercentageDiscountInterval, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::UsageDiscountInterval + ) + end + + class AmountDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + amount_discount:, + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + discount_type: :amount + ); end + + sig do + returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::AmountDiscountInterval::Shape) + end + def to_h; end + end + + class PercentageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + percentage_discount:, + start_date:, + discount_type: :percentage + ); end + + sig do + returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::PercentageDiscountInterval::Shape) + end + def to_h; end + end + + class UsageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + usage_discount:, + discount_type: :usage + ); end + + sig do + returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::UsageDiscountInterval::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::AmountDiscountInterval + ], + [ + Symbol, + Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::PercentageDiscountInterval + ], + [ + Symbol, + Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::UsageDiscountInterval + ] + ] + ) + end + private_class_method def self.variants; end + end + + class FixedFeeQuantitySchedule < Orb::BaseModel + Shape = T.type_alias do + {end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time} + end + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time).void } + def initialize(end_date:, price_id:, quantity:, start_date:); end + + sig do + returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::FixedFeeQuantitySchedule::Shape) + end + def to_h; end + end + + class MaximumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + maximum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::MaximumInterval::Shape) } + def to_h; end + end + + class MinimumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + minimum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::MinimumInterval::Shape) } + def to_h; end + end + + class PriceInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval::FixedFeeQuantityTransition])) + end + attr_accessor :fixed_fee_quantity_transitions + + sig { returns(Orb::Models::Price::Variants) } + attr_accessor :price + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + ).void + end + def initialize( + id:, + billing_cycle_day:, + current_billing_period_end_date:, + current_billing_period_start_date:, + end_date:, + fixed_fee_quantity_transitions:, + price:, + start_date: + ); end + + sig { returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval::Shape) } + def to_h; end + + class FixedFeeQuantityTransition < Orb::BaseModel + Shape = T.type_alias { {effective_date: Time, price_id: String, quantity: Integer} } + + sig { returns(Time) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Integer) } + attr_accessor :quantity + + sig { params(effective_date: Time, price_id: String, quantity: Integer).void } + def initialize(effective_date:, price_id:, quantity:); end + + sig do + returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval::FixedFeeQuantityTransition::Shape) + end + def to_h; end + end + end + + class RedeemedCoupon < Orb::BaseModel + Shape = T.type_alias { {coupon_id: String, end_date: T.nilable(Time), start_date: Time} } + + sig { returns(String) } + attr_accessor :coupon_id + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(coupon_id: String, end_date: T.nilable(Time), start_date: Time).void } + def initialize(coupon_id:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::RedeemedCoupon::Shape) } + def to_h; end + end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TrialInfo < Orb::BaseModel + Shape = T.type_alias { {end_date: T.nilable(Time)} } + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { params(end_date: T.nilable(Time)).void } + def initialize(end_date:); end + + sig { returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::TrialInfo::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_params.rbi b/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_params.rbi new file mode 100644 index 00000000..5413ad14 --- /dev/null +++ b/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_params.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module Orb + module Models + class SubscriptionUpdateFixedFeeQuantityParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + {price_id: String, quantity: Float, change_option: Symbol, effective_date: T.nilable(Date)}, + Orb::RequestParameters::Shape + ) + end + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(T.nilable(Symbol)) } + attr_reader :change_option + + sig { params(change_option: Symbol).void } + attr_writer :change_option + + sig { returns(T.nilable(Date)) } + attr_accessor :effective_date + + sig do + params( + price_id: String, + quantity: Float, + change_option: Symbol, + effective_date: T.nilable(Date), + request_options: Orb::RequestOpts + ).void + end + def initialize(price_id:, quantity:, change_option: nil, effective_date: nil, request_options: {}); end + + sig { returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityParams::Shape) } + def to_h; end + + class ChangeOption < Orb::Enum + abstract! + + IMMEDIATE = :immediate + UPCOMING_INVOICE = :upcoming_invoice + EFFECTIVE_DATE = :effective_date + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_response.rbi b/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_response.rbi new file mode 100644 index 00000000..9b6068c1 --- /dev/null +++ b/rbi/lib/orb/models/subscription_update_fixed_fee_quantity_response.rbi @@ -0,0 +1,1041 @@ +# typed: strong + +module Orb + module Models + class SubscriptionUpdateFixedFeeQuantityResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::TrialInfo + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Integer)) } + attr_accessor :active_plan_phase_order + + sig { returns(T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval]) } + attr_accessor :adjustment_intervals + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig do + returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::BillingCycleAnchorConfiguration) + end + attr_accessor :billing_cycle_anchor_configuration + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(Orb::Models::Customer) } + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :default_invoice_memo + + sig do + returns(T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::Variants]) + end + attr_accessor :discount_intervals + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig do + returns(T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::FixedFeeQuantitySchedule]) + end + attr_accessor :fixed_fee_quantity_schedule + + sig { returns(T.nilable(String)) } + attr_accessor :invoicing_threshold + + sig { returns(T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::MaximumInterval]) } + attr_accessor :maximum_intervals + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::MinimumInterval]) } + attr_accessor :minimum_intervals + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(Orb::Models::Plan) } + attr_accessor :plan + + sig { returns(T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval]) } + attr_accessor :price_intervals + + sig { returns(T.nilable(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::RedeemedCoupon)) } + attr_accessor :redeemed_coupon + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::TrialInfo) } + attr_accessor :trial_info + + sig do + params( + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::TrialInfo + ).void + end + def initialize( + id:, + active_plan_phase_order:, + adjustment_intervals:, + auto_collection:, + billing_cycle_anchor_configuration:, + billing_cycle_day:, + created_at:, + current_billing_period_end_date:, + current_billing_period_start_date:, + customer:, + default_invoice_memo:, + discount_intervals:, + end_date:, + fixed_fee_quantity_schedule:, + invoicing_threshold:, + maximum_intervals:, + metadata:, + minimum_intervals:, + net_terms:, + plan:, + price_intervals:, + redeemed_coupon:, + start_date:, + status:, + trial_info: + ); end + + sig { returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::Shape) } + def to_h; end + + class AdjustmentInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::Variants) + end + attr_accessor :adjustment + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + adjustment: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + ).void + end + def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ) + end + + class AmountDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + amount_discount:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + adjustment_type: :amount_discount + ); end + + sig do + returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment::Shape) + end + def to_h; end + end + + class PercentageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + percentage_discount:, + plan_phase_order:, + reason:, + adjustment_type: :percentage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment::Shape) + end + def to_h; end + end + + class UsageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float, + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + usage_discount:, + adjustment_type: :usage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment::Shape) + end + def to_h; end + end + + class MinimumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + item_id:, + minimum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :minimum + ); end + + sig do + returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MinimumAdjustment::Shape) + end + def to_h; end + end + + class MaximumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + maximum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :maximum + ); end + + sig do + returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MaximumAdjustment::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ] + ] + ) + end + private_class_method def self.variants; end + end + end + + class BillingCycleAnchorConfiguration < Orb::BaseModel + Shape = T.type_alias { {day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)} } + + sig { returns(Integer) } + attr_accessor :day + + sig { returns(T.nilable(Integer)) } + attr_accessor :month + + sig { returns(T.nilable(Integer)) } + attr_accessor :year + + sig { params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).void } + def initialize(day:, month: nil, year: nil); end + + sig do + returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::BillingCycleAnchorConfiguration::Shape) + end + def to_h; end + end + + class DiscountInterval < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::AmountDiscountInterval, + Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::PercentageDiscountInterval, + Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::UsageDiscountInterval + ) + end + + class AmountDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + amount_discount:, + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + discount_type: :amount + ); end + + sig do + returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::AmountDiscountInterval::Shape) + end + def to_h; end + end + + class PercentageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + percentage_discount:, + start_date:, + discount_type: :percentage + ); end + + sig do + returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::PercentageDiscountInterval::Shape) + end + def to_h; end + end + + class UsageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + usage_discount:, + discount_type: :usage + ); end + + sig do + returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::UsageDiscountInterval::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::AmountDiscountInterval + ], + [ + Symbol, + Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::PercentageDiscountInterval + ], + [ + Symbol, + Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::UsageDiscountInterval + ] + ] + ) + end + private_class_method def self.variants; end + end + + class FixedFeeQuantitySchedule < Orb::BaseModel + Shape = T.type_alias do + {end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time} + end + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time).void } + def initialize(end_date:, price_id:, quantity:, start_date:); end + + sig do + returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::FixedFeeQuantitySchedule::Shape) + end + def to_h; end + end + + class MaximumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + maximum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::MaximumInterval::Shape) } + def to_h; end + end + + class MinimumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + minimum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::MinimumInterval::Shape) } + def to_h; end + end + + class PriceInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval::FixedFeeQuantityTransition])) + end + attr_accessor :fixed_fee_quantity_transitions + + sig { returns(Orb::Models::Price::Variants) } + attr_accessor :price + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + ).void + end + def initialize( + id:, + billing_cycle_day:, + current_billing_period_end_date:, + current_billing_period_start_date:, + end_date:, + fixed_fee_quantity_transitions:, + price:, + start_date: + ); end + + sig { returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval::Shape) } + def to_h; end + + class FixedFeeQuantityTransition < Orb::BaseModel + Shape = T.type_alias { {effective_date: Time, price_id: String, quantity: Integer} } + + sig { returns(Time) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Integer) } + attr_accessor :quantity + + sig { params(effective_date: Time, price_id: String, quantity: Integer).void } + def initialize(effective_date:, price_id:, quantity:); end + + sig do + returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval::FixedFeeQuantityTransition::Shape) + end + def to_h; end + end + end + + class RedeemedCoupon < Orb::BaseModel + Shape = T.type_alias { {coupon_id: String, end_date: T.nilable(Time), start_date: Time} } + + sig { returns(String) } + attr_accessor :coupon_id + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(coupon_id: String, end_date: T.nilable(Time), start_date: Time).void } + def initialize(coupon_id:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::RedeemedCoupon::Shape) } + def to_h; end + end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TrialInfo < Orb::BaseModel + Shape = T.type_alias { {end_date: T.nilable(Time)} } + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { params(end_date: T.nilable(Time)).void } + def initialize(end_date:); end + + sig { returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::TrialInfo::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_update_params.rbi b/rbi/lib/orb/models/subscription_update_params.rbi new file mode 100644 index 00000000..39eaa426 --- /dev/null +++ b/rbi/lib/orb/models/subscription_update_params.rbi @@ -0,0 +1,60 @@ +# typed: strong + +module Orb + module Models + class SubscriptionUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + auto_collection: T.nilable(T::Boolean), + default_invoice_memo: T.nilable(String), + invoicing_threshold: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + net_terms: T.nilable(Integer) + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig { returns(T.nilable(String)) } + attr_accessor :default_invoice_memo + + sig { returns(T.nilable(String)) } + attr_accessor :invoicing_threshold + + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } + attr_accessor :metadata + + sig { returns(T.nilable(Integer)) } + attr_accessor :net_terms + + sig do + params( + auto_collection: T.nilable(T::Boolean), + default_invoice_memo: T.nilable(String), + invoicing_threshold: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + net_terms: T.nilable(Integer), + request_options: Orb::RequestOpts + ).void + end + def initialize( + auto_collection: nil, + default_invoice_memo: nil, + invoicing_threshold: nil, + metadata: nil, + net_terms: nil, + request_options: {} + ); end + + sig { returns(Orb::Models::SubscriptionUpdateParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/subscription_update_trial_params.rbi b/rbi/lib/orb/models/subscription_update_trial_params.rbi new file mode 100644 index 00000000..e1ee62ad --- /dev/null +++ b/rbi/lib/orb/models/subscription_update_trial_params.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Orb + module Models + class SubscriptionUpdateTrialParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias do + T.all( + { + trial_end_date: Orb::Models::SubscriptionUpdateTrialParams::TrialEndDate::Variants, + shift: T::Boolean + }, + Orb::RequestParameters::Shape + ) + end + + sig { returns(Orb::Models::SubscriptionUpdateTrialParams::TrialEndDate::Variants) } + attr_accessor :trial_end_date + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :shift + + sig { params(shift: T::Boolean).void } + attr_writer :shift + + sig do + params( + trial_end_date: Orb::Models::SubscriptionUpdateTrialParams::TrialEndDate::Variants, + shift: T::Boolean, + request_options: Orb::RequestOpts + ).void + end + def initialize(trial_end_date:, shift: nil, request_options: {}); end + + sig { returns(Orb::Models::SubscriptionUpdateTrialParams::Shape) } + def to_h; end + + class TrialEndDate < Orb::Union + abstract! + + Variants = T.type_alias { T.any(Time, Symbol) } + + class UnionMember1 < Orb::Enum + abstract! + + IMMEDIATE = :immediate + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + sig { override.returns([[NilClass, Time], [NilClass, Symbol]]) } + private_class_method def self.variants; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_update_trial_response.rbi b/rbi/lib/orb/models/subscription_update_trial_response.rbi new file mode 100644 index 00000000..d8be974b --- /dev/null +++ b/rbi/lib/orb/models/subscription_update_trial_response.rbi @@ -0,0 +1,1028 @@ +# typed: strong + +module Orb + module Models + class SubscriptionUpdateTrialResponse < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUpdateTrialResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionUpdateTrialResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionUpdateTrialResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionUpdateTrialResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionUpdateTrialResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionUpdateTrialResponse::TrialInfo + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Integer)) } + attr_accessor :active_plan_phase_order + + sig { returns(T::Array[Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval]) } + attr_accessor :adjustment_intervals + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :auto_collection + + sig { returns(Orb::Models::SubscriptionUpdateTrialResponse::BillingCycleAnchorConfiguration) } + attr_accessor :billing_cycle_anchor_configuration + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(Orb::Models::Customer) } + attr_accessor :customer + + sig { returns(T.nilable(String)) } + attr_accessor :default_invoice_memo + + sig { returns(T::Array[Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::Variants]) } + attr_accessor :discount_intervals + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(T::Array[Orb::Models::SubscriptionUpdateTrialResponse::FixedFeeQuantitySchedule]) } + attr_accessor :fixed_fee_quantity_schedule + + sig { returns(T.nilable(String)) } + attr_accessor :invoicing_threshold + + sig { returns(T::Array[Orb::Models::SubscriptionUpdateTrialResponse::MaximumInterval]) } + attr_accessor :maximum_intervals + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :metadata + + sig { returns(T::Array[Orb::Models::SubscriptionUpdateTrialResponse::MinimumInterval]) } + attr_accessor :minimum_intervals + + sig { returns(Integer) } + attr_accessor :net_terms + + sig { returns(Orb::Models::Plan) } + attr_accessor :plan + + sig { returns(T::Array[Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval]) } + attr_accessor :price_intervals + + sig { returns(T.nilable(Orb::Models::SubscriptionUpdateTrialResponse::RedeemedCoupon)) } + attr_accessor :redeemed_coupon + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(Orb::Models::SubscriptionUpdateTrialResponse::TrialInfo) } + attr_accessor :trial_info + + sig do + params( + id: String, + active_plan_phase_order: T.nilable(Integer), + adjustment_intervals: T::Array[Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval], + auto_collection: T.nilable(T::Boolean), + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUpdateTrialResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + customer: Orb::Models::Customer, + default_invoice_memo: T.nilable(String), + discount_intervals: T::Array[Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::Variants], + end_date: T.nilable(Time), + fixed_fee_quantity_schedule: T::Array[Orb::Models::SubscriptionUpdateTrialResponse::FixedFeeQuantitySchedule], + invoicing_threshold: T.nilable(String), + maximum_intervals: T::Array[Orb::Models::SubscriptionUpdateTrialResponse::MaximumInterval], + metadata: T::Hash[Symbol, String], + minimum_intervals: T::Array[Orb::Models::SubscriptionUpdateTrialResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: T::Array[Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval], + redeemed_coupon: T.nilable(Orb::Models::SubscriptionUpdateTrialResponse::RedeemedCoupon), + start_date: Time, + status: Symbol, + trial_info: Orb::Models::SubscriptionUpdateTrialResponse::TrialInfo + ).void + end + def initialize( + id:, + active_plan_phase_order:, + adjustment_intervals:, + auto_collection:, + billing_cycle_anchor_configuration:, + billing_cycle_day:, + created_at:, + current_billing_period_end_date:, + current_billing_period_start_date:, + customer:, + default_invoice_memo:, + discount_intervals:, + end_date:, + fixed_fee_quantity_schedule:, + invoicing_threshold:, + maximum_intervals:, + metadata:, + minimum_intervals:, + net_terms:, + plan:, + price_intervals:, + redeemed_coupon:, + start_date:, + status:, + trial_info: + ); end + + sig { returns(Orb::Models::SubscriptionUpdateTrialResponse::Shape) } + def to_h; end + + class AdjustmentInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment: Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns(Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::Variants) + end + attr_accessor :adjustment + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + adjustment: Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::Variants, + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time + ).void + end + def initialize(id:, adjustment:, applies_to_price_interval_ids:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Shape) } + def to_h; end + + class Adjustment < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MinimumAdjustment, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ) + end + + class AmountDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + amount_discount: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + amount_discount:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + adjustment_type: :amount_discount + ); end + + sig do + returns(Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment::Shape) + end + def to_h; end + end + + class PercentageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + percentage_discount: Float, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + percentage_discount:, + plan_phase_order:, + reason:, + adjustment_type: :percentage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment::Shape) + end + def to_h; end + end + + class UsageDiscountAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + usage_discount: Float, + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + plan_phase_order:, + reason:, + usage_discount:, + adjustment_type: :usage_discount + ); end + + sig do + returns(Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment::Shape) + end + def to_h; end + end + + class MinimumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :item_id + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + item_id: String, + minimum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + item_id:, + minimum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :minimum + ); end + + sig do + returns(Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MinimumAdjustment::Shape) + end + def to_h; end + end + + class MaximumAdjustment < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + adjustment_type: Symbol, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String) + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :adjustment_type + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Boolean) } + attr_accessor :is_invoice_level + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(T.nilable(Integer)) } + attr_accessor :plan_phase_order + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig do + params( + id: String, + applies_to_price_ids: T::Array[String], + is_invoice_level: T::Boolean, + maximum_amount: String, + plan_phase_order: T.nilable(Integer), + reason: T.nilable(String), + adjustment_type: Symbol + ).void + end + def initialize( + id:, + applies_to_price_ids:, + is_invoice_level:, + maximum_amount:, + plan_phase_order:, + reason:, + adjustment_type: :maximum + ); end + + sig do + returns(Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MaximumAdjustment::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + ], + [ + Symbol, + Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + ] + ] + ) + end + private_class_method def self.variants; end + end + end + + class BillingCycleAnchorConfiguration < Orb::BaseModel + Shape = T.type_alias { {day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)} } + + sig { returns(Integer) } + attr_accessor :day + + sig { returns(T.nilable(Integer)) } + attr_accessor :month + + sig { returns(T.nilable(Integer)) } + attr_accessor :year + + sig { params(day: Integer, month: T.nilable(Integer), year: T.nilable(Integer)).void } + def initialize(day:, month: nil, year: nil); end + + sig { returns(Orb::Models::SubscriptionUpdateTrialResponse::BillingCycleAnchorConfiguration::Shape) } + def to_h; end + end + + class DiscountInterval < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::AmountDiscountInterval, + Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::PercentageDiscountInterval, + Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::UsageDiscountInterval + ) + end + + class AmountDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :amount_discount + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + amount_discount: String, + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + amount_discount:, + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + discount_type: :amount + ); end + + sig do + returns(Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::AmountDiscountInterval::Shape) + end + def to_h; end + end + + class PercentageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Float) } + attr_accessor :percentage_discount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + percentage_discount: Float, + start_date: Time, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + percentage_discount:, + start_date:, + discount_type: :percentage + ); end + + sig do + returns(Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::PercentageDiscountInterval::Shape) + end + def to_h; end + end + + class UsageDiscountInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + discount_type: Symbol, + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { returns(Float) } + attr_accessor :usage_discount + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + start_date: Time, + usage_discount: Float, + discount_type: Symbol + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + start_date:, + usage_discount:, + discount_type: :usage + ); end + + sig do + returns(Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::UsageDiscountInterval::Shape) + end + def to_h; end + end + + sig do + override.returns( + [ + [ + Symbol, + Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::AmountDiscountInterval + ], + [ + Symbol, + Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::PercentageDiscountInterval + ], + [Symbol, Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::UsageDiscountInterval] + ] + ) + end + private_class_method def self.variants; end + end + + class FixedFeeQuantitySchedule < Orb::BaseModel + Shape = T.type_alias do + {end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time} + end + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(end_date: T.nilable(Time), price_id: String, quantity: Float, start_date: Time).void } + def initialize(end_date:, price_id:, quantity:, start_date:); end + + sig { returns(Orb::Models::SubscriptionUpdateTrialResponse::FixedFeeQuantitySchedule::Shape) } + def to_h; end + end + + class MaximumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :maximum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + maximum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + maximum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionUpdateTrialResponse::MaximumInterval::Shape) } + def to_h; end + end + + class MinimumInterval < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_interval_ids + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(String) } + attr_accessor :minimum_amount + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + applies_to_price_ids: T::Array[String], + applies_to_price_interval_ids: T::Array[String], + end_date: T.nilable(Time), + minimum_amount: String, + start_date: Time + ).void + end + def initialize( + applies_to_price_ids:, + applies_to_price_interval_ids:, + end_date:, + minimum_amount:, + start_date: + ) + end + + sig { returns(Orb::Models::SubscriptionUpdateTrialResponse::MinimumInterval::Shape) } + def to_h; end + end + + class PriceInterval < Orb::BaseModel + Shape = T.type_alias do + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + } + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Integer) } + attr_accessor :billing_cycle_day + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_end_date + + sig { returns(T.nilable(Time)) } + attr_accessor :current_billing_period_start_date + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig do + returns(T.nilable(T::Array[Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval::FixedFeeQuantityTransition])) + end + attr_accessor :fixed_fee_quantity_transitions + + sig { returns(Orb::Models::Price::Variants) } + attr_accessor :price + + sig { returns(Time) } + attr_accessor :start_date + + sig do + params( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: T.nilable(Time), + current_billing_period_start_date: T.nilable(Time), + end_date: T.nilable(Time), + fixed_fee_quantity_transitions: T.nilable(T::Array[Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval::FixedFeeQuantityTransition]), + price: Orb::Models::Price::Variants, + start_date: Time + ).void + end + def initialize( + id:, + billing_cycle_day:, + current_billing_period_end_date:, + current_billing_period_start_date:, + end_date:, + fixed_fee_quantity_transitions:, + price:, + start_date: + ); end + + sig { returns(Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval::Shape) } + def to_h; end + + class FixedFeeQuantityTransition < Orb::BaseModel + Shape = T.type_alias { {effective_date: Time, price_id: String, quantity: Integer} } + + sig { returns(Time) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :price_id + + sig { returns(Integer) } + attr_accessor :quantity + + sig { params(effective_date: Time, price_id: String, quantity: Integer).void } + def initialize(effective_date:, price_id:, quantity:); end + + sig do + returns(Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval::FixedFeeQuantityTransition::Shape) + end + def to_h; end + end + end + + class RedeemedCoupon < Orb::BaseModel + Shape = T.type_alias { {coupon_id: String, end_date: T.nilable(Time), start_date: Time} } + + sig { returns(String) } + attr_accessor :coupon_id + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { returns(Time) } + attr_accessor :start_date + + sig { params(coupon_id: String, end_date: T.nilable(Time), start_date: Time).void } + def initialize(coupon_id:, end_date:, start_date:); end + + sig { returns(Orb::Models::SubscriptionUpdateTrialResponse::RedeemedCoupon::Shape) } + def to_h; end + end + + class Status < Orb::Enum + abstract! + + ACTIVE = :active + ENDED = :ended + UPCOMING = :upcoming + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + + class TrialInfo < Orb::BaseModel + Shape = T.type_alias { {end_date: T.nilable(Time)} } + + sig { returns(T.nilable(Time)) } + attr_accessor :end_date + + sig { params(end_date: T.nilable(Time)).void } + def initialize(end_date:); end + + sig { returns(Orb::Models::SubscriptionUpdateTrialResponse::TrialInfo::Shape) } + def to_h; end + end + end + end +end diff --git a/rbi/lib/orb/models/subscription_usage.rbi b/rbi/lib/orb/models/subscription_usage.rbi new file mode 100644 index 00000000..a3f7030a --- /dev/null +++ b/rbi/lib/orb/models/subscription_usage.rbi @@ -0,0 +1,246 @@ +# typed: strong + +module Orb + module Models + class SubscriptionUsage < Orb::Union + abstract! + + Variants = T.type_alias do + T.any( + Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage, + Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage + ) + end + + class UngroupedSubscriptionUsage < Orb::BaseModel + Shape = T.type_alias do + {data: T::Array[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data]} + end + + sig { returns(T::Array[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data]) } + attr_accessor :data + + sig { params(data: T::Array[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data]).void } + def initialize(data:); end + + sig { returns(Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Shape) } + def to_h; end + + class Data < Orb::BaseModel + Shape = T.type_alias do + { + billable_metric: Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::BillableMetric, + usage: T::Array[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::Usage], + view_mode: Symbol + } + end + + sig { returns(Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::BillableMetric) } + attr_accessor :billable_metric + + sig { returns(T::Array[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::Usage]) } + attr_accessor :usage + + sig { returns(Symbol) } + attr_accessor :view_mode + + sig do + params( + billable_metric: Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::BillableMetric, + usage: T::Array[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::Usage], + view_mode: Symbol + ).void + end + def initialize(billable_metric:, usage:, view_mode:); end + + sig { returns(Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig do + returns(Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::BillableMetric::Shape) + end + def to_h; end + end + + class Usage < Orb::BaseModel + Shape = T.type_alias { {quantity: Float, timeframe_end: Time, timeframe_start: Time} } + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Time) } + attr_accessor :timeframe_end + + sig { returns(Time) } + attr_accessor :timeframe_start + + sig { params(quantity: Float, timeframe_end: Time, timeframe_start: Time).void } + def initialize(quantity:, timeframe_end:, timeframe_start:); end + + sig { returns(Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::Usage::Shape) } + def to_h; end + end + + class ViewMode < Orb::Enum + abstract! + + PERIODIC = :periodic + CUMULATIVE = :cumulative + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + class GroupedSubscriptionUsage < Orb::BaseModel + Shape = T.type_alias do + { + data: T::Array[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data], + pagination_metadata: T.nilable(Orb::Models::PaginationMetadata) + } + end + + sig { returns(T::Array[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data]) } + attr_accessor :data + + sig { returns(T.nilable(Orb::Models::PaginationMetadata)) } + attr_accessor :pagination_metadata + + sig do + params( + data: T::Array[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data], + pagination_metadata: T.nilable(Orb::Models::PaginationMetadata) + ).void + end + def initialize(data:, pagination_metadata: nil); end + + sig { returns(Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Shape) } + def to_h; end + + class Data < Orb::BaseModel + Shape = T.type_alias do + { + billable_metric: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric, + metric_group: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup, + usage: T::Array[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::Usage], + view_mode: Symbol + } + end + + sig { returns(Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric) } + attr_accessor :billable_metric + + sig { returns(Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup) } + attr_accessor :metric_group + + sig { returns(T::Array[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::Usage]) } + attr_accessor :usage + + sig { returns(Symbol) } + attr_accessor :view_mode + + sig do + params( + billable_metric: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric, + metric_group: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup, + usage: T::Array[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::Usage], + view_mode: Symbol + ).void + end + def initialize(billable_metric:, metric_group:, usage:, view_mode:); end + + sig { returns(Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::Shape) } + def to_h; end + + class BillableMetric < Orb::BaseModel + Shape = T.type_alias { {id: String, name: String} } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, name: String).void } + def initialize(id:, name:); end + + sig do + returns(Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric::Shape) + end + def to_h; end + end + + class MetricGroup < Orb::BaseModel + Shape = T.type_alias { {property_key: String, property_value: String} } + + sig { returns(String) } + attr_accessor :property_key + + sig { returns(String) } + attr_accessor :property_value + + sig { params(property_key: String, property_value: String).void } + def initialize(property_key:, property_value:); end + + sig do + returns(Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup::Shape) + end + def to_h; end + end + + class Usage < Orb::BaseModel + Shape = T.type_alias { {quantity: Float, timeframe_end: Time, timeframe_start: Time} } + + sig { returns(Float) } + attr_accessor :quantity + + sig { returns(Time) } + attr_accessor :timeframe_end + + sig { returns(Time) } + attr_accessor :timeframe_start + + sig { params(quantity: Float, timeframe_end: Time, timeframe_start: Time).void } + def initialize(quantity:, timeframe_end:, timeframe_start:); end + + sig { returns(Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::Usage::Shape) } + def to_h; end + end + + class ViewMode < Orb::Enum + abstract! + + PERIODIC = :periodic + CUMULATIVE = :cumulative + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end + + sig do + override.returns( + [ + [NilClass, Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage], + [NilClass, Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage] + ] + ) + end + private_class_method def self.variants; end + end + end +end diff --git a/rbi/lib/orb/models/subscriptions.rbi b/rbi/lib/orb/models/subscriptions.rbi new file mode 100644 index 00000000..9c6ca7bd --- /dev/null +++ b/rbi/lib/orb/models/subscriptions.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Orb + module Models + class SubscriptionsAPI < Orb::BaseModel + Shape = T.type_alias do + {data: T::Array[Orb::Models::Subscription], pagination_metadata: Orb::Models::PaginationMetadata} + end + + sig { returns(T::Array[Orb::Models::Subscription]) } + attr_accessor :data + + sig { returns(Orb::Models::PaginationMetadata) } + attr_accessor :pagination_metadata + + sig do + params( + data: T::Array[Orb::Models::Subscription], + pagination_metadata: Orb::Models::PaginationMetadata + ).void + end + def initialize(data:, pagination_metadata:); end + + sig { returns(Orb::Models::SubscriptionsAPI::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/top_level_ping_params.rbi b/rbi/lib/orb/models/top_level_ping_params.rbi new file mode 100644 index 00000000..8bf10ca3 --- /dev/null +++ b/rbi/lib/orb/models/top_level_ping_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class TopLevelPingParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + Shape = T.type_alias { T.all({}, Orb::RequestParameters::Shape) } + + sig { params(request_options: Orb::RequestOpts).void } + def initialize(request_options: {}); end + + sig { returns(Orb::Models::TopLevelPingParams::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/top_level_ping_response.rbi b/rbi/lib/orb/models/top_level_ping_response.rbi new file mode 100644 index 00000000..9f813795 --- /dev/null +++ b/rbi/lib/orb/models/top_level_ping_response.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Orb + module Models + class TopLevelPingResponse < Orb::BaseModel + Shape = T.type_alias { {response: String} } + + sig { returns(String) } + attr_accessor :response + + sig { params(response: String).void } + def initialize(response:); end + + sig { returns(Orb::Models::TopLevelPingResponse::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/models/trial_discount.rbi b/rbi/lib/orb/models/trial_discount.rbi new file mode 100644 index 00000000..c08b494e --- /dev/null +++ b/rbi/lib/orb/models/trial_discount.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module Orb + module Models + class TrialDiscount < Orb::BaseModel + Shape = T.type_alias do + { + applies_to_price_ids: T::Array[String], + discount_type: Symbol, + reason: T.nilable(String), + trial_amount_discount: T.nilable(String), + trial_percentage_discount: T.nilable(Float) + } + end + + sig { returns(T::Array[String]) } + attr_accessor :applies_to_price_ids + + sig { returns(Symbol) } + attr_accessor :discount_type + + sig { returns(T.nilable(String)) } + attr_accessor :reason + + sig { returns(T.nilable(String)) } + attr_accessor :trial_amount_discount + + sig { returns(T.nilable(Float)) } + attr_accessor :trial_percentage_discount + + sig do + params( + applies_to_price_ids: T::Array[String], + discount_type: Symbol, + reason: T.nilable(String), + trial_amount_discount: T.nilable(String), + trial_percentage_discount: T.nilable(Float) + ).void + end + def initialize( + applies_to_price_ids:, + discount_type:, + reason: nil, + trial_amount_discount: nil, + trial_percentage_discount: nil + ); end + + sig { returns(Orb::Models::TrialDiscount::Shape) } + def to_h; end + + class DiscountType < Orb::Enum + abstract! + + TRIAL = :trial + + sig { override.returns(T::Array[Symbol]) } + def self.values; end + end + end + end +end diff --git a/rbi/lib/orb/page.rbi b/rbi/lib/orb/page.rbi new file mode 100644 index 00000000..1e7d12de --- /dev/null +++ b/rbi/lib/orb/page.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module Orb + class Page + include Orb::BasePage + + Elem = type_member + + sig { returns(T::Array[Elem]) } + attr_accessor :data + + sig { returns(PaginationMetadata) } + attr_accessor :pagination_metadata + + sig do + params( + client: Orb::BaseClient, + req: Orb::BaseClient::RequestShape, + headers: T::Hash[String, String], + unwrapped: T::Hash[Symbol, T.anything] + ).void + end + def initialize(client:, req:, headers:, unwrapped:); end + + class PaginationMetadata < Orb::BaseModel + Shape = T.type_alias { {has_more: T::Boolean, next_cursor: T.nilable(String)} } + + sig { returns(T::Boolean) } + attr_accessor :has_more + + sig { returns(T.nilable(String)) } + attr_accessor :next_cursor + + sig { params(has_more: T::Boolean, next_cursor: T.nilable(String)).void } + def initialize(has_more:, next_cursor:); end + + sig { returns(PaginationMetadata::Shape) } + def to_h; end + end + end +end diff --git a/rbi/lib/orb/request_options.rbi b/rbi/lib/orb/request_options.rbi new file mode 100644 index 00000000..269dab6c --- /dev/null +++ b/rbi/lib/orb/request_options.rbi @@ -0,0 +1,55 @@ +# typed: strong + +module Orb + RequestOpts = T.type_alias do + T.any(Orb::RequestOptions, Orb::RequestOptions::Shape, T::Hash[Symbol, T.anything]) + end + + module RequestParameters + abstract! + + Shape = T.type_alias { {request_options: Orb::RequestOpts} } + + sig { returns(Orb::RequestOpts) } + attr_accessor :request_options + + module Converter + sig { params(params: T.anything).returns([T.anything, T::Hash[Symbol, T.anything]]) } + def dump_request(params); end + end + end + + class RequestOptions < Orb::BaseModel + Shape = T.type_alias do + { + idempotency_key: T.nilable(String), + extra_query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]), + extra_headers: T.nilable(T::Hash[String, T.nilable(String)]), + extra_body: T.nilable(T::Hash[Symbol, T.anything]), + max_retries: T.nilable(Integer), + timeout: T.nilable(Float) + } + end + + sig { params(opts: T.any(T.self_type, T::Hash[Symbol, T.anything])).void } + def self.validate!(opts); end + + sig { returns(T.nilable(String)) } + attr_accessor :idempotency_key + + sig { returns(T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])) } + attr_accessor :extra_query + + sig { returns(T.nilable(T::Hash[String, T.nilable(String)])) } + attr_accessor :extra_headers + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :extra_body + + sig { returns(T.nilable(Integer)) } + attr_accessor :max_retries + + sig { returns(T.nilable(Float)) } + attr_accessor :timeout + end +end diff --git a/rbi/lib/orb/resources/alerts.rbi b/rbi/lib/orb/resources/alerts.rbi new file mode 100644 index 00000000..1d3fd356 --- /dev/null +++ b/rbi/lib/orb/resources/alerts.rbi @@ -0,0 +1,107 @@ +# typed: strong + +module Orb + module Resources + class Alerts + sig { params(alert_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::Alert) } + def retrieve(alert_id, request_options: {}); end + + sig do + params( + alert_configuration_id: String, + thresholds: T::Array[Orb::Models::AlertUpdateParams::Threshold], + request_options: Orb::RequestOpts + ).returns(Orb::Models::Alert) + end + def update(alert_configuration_id, thresholds:, request_options: {}); end + + sig do + params( + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + cursor: T.nilable(String), + customer_id: T.nilable(String), + external_customer_id: T.nilable(String), + limit: Integer, + subscription_id: T.nilable(String), + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Alert]) + end + def list( + created_at_gt:, + created_at_gte:, + created_at_lt:, + created_at_lte:, + cursor:, + customer_id:, + external_customer_id:, + limit:, + subscription_id:, + request_options: {} + ); end + + sig do + params( + customer_id: String, + currency: String, + type: Symbol, + thresholds: T.nilable(T::Array[Orb::Models::AlertCreateForCustomerParams::Threshold]), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Alert) + end + def create_for_customer(customer_id, currency:, type:, thresholds:, request_options: {}); end + + sig do + params( + external_customer_id: String, + currency: String, + type: Symbol, + thresholds: T.nilable(T::Array[Orb::Models::AlertCreateForExternalCustomerParams::Threshold]), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Alert) + end + def create_for_external_customer( + external_customer_id, + currency:, + type:, + thresholds:, + request_options: {} + ) + end + + sig do + params( + subscription_id: String, + thresholds: T::Array[Orb::Models::AlertCreateForSubscriptionParams::Threshold], + type: Symbol, + metric_id: T.nilable(String), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Alert) + end + def create_for_subscription(subscription_id, thresholds:, type:, metric_id:, request_options: {}); end + + sig do + params( + alert_configuration_id: String, + subscription_id: T.nilable(String), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Alert) + end + def disable(alert_configuration_id, subscription_id:, request_options: {}); end + + sig do + params( + alert_configuration_id: String, + subscription_id: T.nilable(String), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Alert) + end + def enable(alert_configuration_id, subscription_id:, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end +end diff --git a/rbi/lib/orb/resources/coupons.rbi b/rbi/lib/orb/resources/coupons.rbi new file mode 100644 index 00000000..db6bdaed --- /dev/null +++ b/rbi/lib/orb/resources/coupons.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module Orb + module Resources + class Coupons + sig { returns(Orb::Resources::Coupons::Subscriptions) } + attr_reader :subscriptions + + sig do + params( + discount: Orb::Models::CouponCreateParams::Discount::Variants, + redemption_code: String, + duration_in_months: T.nilable(Integer), + max_redemptions: T.nilable(Integer), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Coupon) + end + def create(discount:, redemption_code:, duration_in_months:, max_redemptions:, request_options: {}); end + + sig do + params( + cursor: T.nilable(String), + limit: Integer, + redemption_code: T.nilable(String), + show_archived: T.nilable(T::Boolean), + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Coupon]) + end + def list(cursor:, limit:, redemption_code:, show_archived:, request_options: {}); end + + sig { params(coupon_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::Coupon) } + def archive(coupon_id, request_options: {}); end + + sig { params(coupon_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::Coupon) } + def fetch(coupon_id, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end +end diff --git a/rbi/lib/orb/resources/coupons/subscriptions.rbi b/rbi/lib/orb/resources/coupons/subscriptions.rbi new file mode 100644 index 00000000..028094b5 --- /dev/null +++ b/rbi/lib/orb/resources/coupons/subscriptions.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Orb + module Resources + class Coupons + class Subscriptions + sig do + params( + coupon_id: String, + cursor: T.nilable(String), + limit: Integer, + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Subscription]) + end + def list(coupon_id, cursor:, limit:, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end + end +end diff --git a/rbi/lib/orb/resources/credit_notes.rbi b/rbi/lib/orb/resources/credit_notes.rbi new file mode 100644 index 00000000..852daaa3 --- /dev/null +++ b/rbi/lib/orb/resources/credit_notes.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Orb + module Resources + class CreditNotes + sig do + params( + line_items: T::Array[Orb::Models::CreditNoteCreateParams::LineItem], + memo: T.nilable(String), + reason: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).returns(Orb::Models::CreditNote) + end + def create(line_items:, memo:, reason:, request_options: {}); end + + sig do + params( + cursor: T.nilable(String), + limit: Integer, + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::CreditNote]) + end + def list(cursor:, limit:, request_options: {}); end + + sig do + params(credit_note_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::CreditNote) + end + def fetch(credit_note_id, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end +end diff --git a/rbi/lib/orb/resources/customers.rbi b/rbi/lib/orb/resources/customers.rbi new file mode 100644 index 00000000..170e3a66 --- /dev/null +++ b/rbi/lib/orb/resources/customers.rbi @@ -0,0 +1,187 @@ +# typed: strong + +module Orb + module Resources + class Customers + sig { returns(Orb::Resources::Customers::Costs) } + attr_reader :costs + + sig { returns(Orb::Resources::Customers::Credits) } + attr_reader :credits + + sig { returns(Orb::Resources::Customers::BalanceTransactions) } + attr_reader :balance_transactions + + sig do + params( + email: String, + name: String, + accounting_sync_configuration: T.nilable(Orb::Models::CustomerCreateParams::AccountingSyncConfiguration), + additional_emails: T.nilable(T::Array[String]), + auto_collection: T.nilable(T::Boolean), + billing_address: T.nilable(Orb::Models::CustomerCreateParams::BillingAddress), + currency: T.nilable(String), + email_delivery: T.nilable(T::Boolean), + external_customer_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + payment_provider: T.nilable(Symbol), + payment_provider_id: T.nilable(String), + reporting_configuration: T.nilable(Orb::Models::CustomerCreateParams::ReportingConfiguration), + shipping_address: T.nilable(Orb::Models::CustomerCreateParams::ShippingAddress), + tax_configuration: T.nilable(Orb::Models::CustomerCreateParams::TaxConfiguration::Variants), + tax_id: T.nilable(Orb::Models::CustomerCreateParams::TaxID), + timezone: T.nilable(String), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Customer) + end + def create( + email:, + name:, + accounting_sync_configuration:, + additional_emails:, + auto_collection:, + billing_address:, + currency:, + email_delivery:, + external_customer_id:, + metadata:, + payment_provider:, + payment_provider_id:, + reporting_configuration:, + shipping_address:, + tax_configuration:, + tax_id:, + timezone:, + request_options: {} + ); end + + sig do + params( + customer_id: String, + accounting_sync_configuration: T.nilable(Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration), + additional_emails: T.nilable(T::Array[String]), + auto_collection: T.nilable(T::Boolean), + billing_address: T.nilable(Orb::Models::CustomerUpdateParams::BillingAddress), + currency: T.nilable(String), + email: T.nilable(String), + email_delivery: T.nilable(T::Boolean), + external_customer_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + name: T.nilable(String), + payment_provider: T.nilable(Symbol), + payment_provider_id: T.nilable(String), + reporting_configuration: T.nilable(Orb::Models::CustomerUpdateParams::ReportingConfiguration), + shipping_address: T.nilable(Orb::Models::CustomerUpdateParams::ShippingAddress), + tax_configuration: T.nilable(Orb::Models::CustomerUpdateParams::TaxConfiguration::Variants), + tax_id: T.nilable(Orb::Models::CustomerUpdateParams::TaxID), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Customer) + end + def update( + customer_id, + accounting_sync_configuration:, + additional_emails:, + auto_collection:, + billing_address:, + currency:, + email:, + email_delivery:, + external_customer_id:, + metadata:, + name:, + payment_provider:, + payment_provider_id:, + reporting_configuration:, + shipping_address:, + tax_configuration:, + tax_id:, + request_options: {} + ); end + + sig do + params( + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + cursor: T.nilable(String), + limit: Integer, + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Customer]) + end + def list( + created_at_gt:, + created_at_gte:, + created_at_lt:, + created_at_lte:, + cursor:, + limit:, + request_options: {} + ) + end + + sig { params(customer_id: String, request_options: Orb::RequestOpts).void } + def delete(customer_id, request_options: {}); end + + sig { params(customer_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::Customer) } + def fetch(customer_id, request_options: {}); end + + sig do + params(external_customer_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::Customer) + end + def fetch_by_external_id(external_customer_id, request_options: {}); end + + sig { params(external_customer_id: String, request_options: Orb::RequestOpts).void } + def sync_payment_methods_from_gateway(external_customer_id, request_options: {}); end + + sig { params(customer_id: String, request_options: Orb::RequestOpts).void } + def sync_payment_methods_from_gateway_by_external_customer_id(customer_id, request_options: {}); end + + sig do + params( + id: String, + accounting_sync_configuration: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration), + additional_emails: T.nilable(T::Array[String]), + auto_collection: T.nilable(T::Boolean), + billing_address: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::BillingAddress), + currency: T.nilable(String), + email: T.nilable(String), + email_delivery: T.nilable(T::Boolean), + external_customer_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + name: T.nilable(String), + payment_provider: T.nilable(Symbol), + payment_provider_id: T.nilable(String), + reporting_configuration: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::ReportingConfiguration), + shipping_address: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::ShippingAddress), + tax_configuration: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Variants), + tax_id: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::TaxID), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Customer) + end + def update_by_external_id( + id, + accounting_sync_configuration:, + additional_emails:, + auto_collection:, + billing_address:, + currency:, + email:, + email_delivery:, + external_customer_id:, + metadata:, + name:, + payment_provider:, + payment_provider_id:, + reporting_configuration:, + shipping_address:, + tax_configuration:, + tax_id:, + request_options: {} + ); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end +end diff --git a/rbi/lib/orb/resources/customers/balance_transactions.rbi b/rbi/lib/orb/resources/customers/balance_transactions.rbi new file mode 100644 index 00000000..15edbb2f --- /dev/null +++ b/rbi/lib/orb/resources/customers/balance_transactions.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Orb + module Resources + class Customers + class BalanceTransactions + sig do + params( + customer_id: String, + amount: String, + type: Symbol, + description: T.nilable(String), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Customers::BalanceTransactionCreateResponse) + end + def create(customer_id, amount:, type:, description:, request_options: {}); end + + sig do + params( + customer_id: String, + cursor: T.nilable(String), + limit: Integer, + operation_time_gt: T.nilable(Time), + operation_time_gte: T.nilable(Time), + operation_time_lt: T.nilable(Time), + operation_time_lte: T.nilable(Time), + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Customers::BalanceTransactionListResponse]) + end + def list( + customer_id, + cursor:, + limit:, + operation_time_gt:, + operation_time_gte:, + operation_time_lt:, + operation_time_lte:, + request_options: {} + ); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end + end +end diff --git a/rbi/lib/orb/resources/customers/costs.rbi b/rbi/lib/orb/resources/customers/costs.rbi new file mode 100644 index 00000000..31dc72dc --- /dev/null +++ b/rbi/lib/orb/resources/customers/costs.rbi @@ -0,0 +1,45 @@ +# typed: strong + +module Orb + module Resources + class Customers + class Costs + sig do + params( + customer_id: String, + currency: T.nilable(String), + timeframe_end: T.nilable(Time), + timeframe_start: T.nilable(Time), + view_mode: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Customers::CostListResponse) + end + def list(customer_id, currency:, timeframe_end:, timeframe_start:, view_mode:, request_options: {}) + end + + sig do + params( + external_customer_id: String, + currency: T.nilable(String), + timeframe_end: T.nilable(Time), + timeframe_start: T.nilable(Time), + view_mode: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Customers::CostListByExternalIDResponse) + end + def list_by_external_id( + external_customer_id, + currency:, + timeframe_end:, + timeframe_start:, + view_mode:, + request_options: {} + ) + end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end + end +end diff --git a/rbi/lib/orb/resources/customers/credits.rbi b/rbi/lib/orb/resources/customers/credits.rbi new file mode 100644 index 00000000..dcf3a1d4 --- /dev/null +++ b/rbi/lib/orb/resources/customers/credits.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Orb + module Resources + class Customers + class Credits + sig { returns(Orb::Resources::Customers::Credits::Ledger) } + attr_reader :ledger + + sig { returns(Orb::Resources::Customers::Credits::TopUps) } + attr_reader :top_ups + + sig do + params( + customer_id: String, + currency: T.nilable(String), + cursor: T.nilable(String), + include_all_blocks: T::Boolean, + limit: Integer, + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Customers::CreditListResponse]) + end + def list(customer_id, currency:, cursor:, include_all_blocks:, limit:, request_options: {}); end + + sig do + params( + external_customer_id: String, + currency: T.nilable(String), + cursor: T.nilable(String), + include_all_blocks: T::Boolean, + limit: Integer, + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Customers::CreditListByExternalIDResponse]) + end + def list_by_external_id( + external_customer_id, + currency:, + cursor:, + include_all_blocks:, + limit:, + request_options: {} + ) + end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end + end +end diff --git a/rbi/lib/orb/resources/customers/credits/ledger.rbi b/rbi/lib/orb/resources/customers/credits/ledger.rbi new file mode 100644 index 00000000..5365b1a9 --- /dev/null +++ b/rbi/lib/orb/resources/customers/credits/ledger.rbi @@ -0,0 +1,146 @@ +# typed: strong + +module Orb + module Resources + class Customers + class Credits + class Ledger + sig do + params( + customer_id: String, + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + currency: T.nilable(String), + cursor: T.nilable(String), + entry_status: T.nilable(Symbol), + entry_type: T.nilable(Symbol), + limit: Integer, + minimum_amount: T.nilable(String), + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Customers::Credits::LedgerListResponse::Variants]) + end + def list( + customer_id, + created_at_gt:, + created_at_gte:, + created_at_lt:, + created_at_lte:, + currency:, + cursor:, + entry_status:, + entry_type:, + limit:, + minimum_amount:, + request_options: {} + ); end + + sig do + params( + customer_id: String, + amount: Float, + entry_type: Symbol, + currency: T.nilable(String), + description: T.nilable(String), + effective_date: T.nilable(Time), + expiry_date: T.nilable(Time), + invoice_settings: T.nilable(Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + per_unit_cost_basis: T.nilable(String), + target_expiry_date: Date, + block_id: String, + void_reason: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Customers::Credits::LedgerCreateEntryResponse::Variants) + end + def create_entry( + customer_id, + amount:, + entry_type:, + currency:, + description:, + effective_date:, + expiry_date:, + invoice_settings:, + metadata:, + per_unit_cost_basis:, + target_expiry_date:, + block_id:, + void_reason:, + request_options: {} + ); end + + sig do + params( + external_customer_id: String, + amount: Float, + entry_type: Symbol, + currency: T.nilable(String), + description: T.nilable(String), + effective_date: T.nilable(Time), + expiry_date: T.nilable(Time), + invoice_settings: T.nilable(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + per_unit_cost_basis: T.nilable(String), + target_expiry_date: Date, + block_id: String, + void_reason: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::Variants) + end + def create_entry_by_external_id( + external_customer_id, + amount:, + entry_type:, + currency:, + description:, + effective_date:, + expiry_date:, + invoice_settings:, + metadata:, + per_unit_cost_basis:, + target_expiry_date:, + block_id:, + void_reason:, + request_options: {} + ); end + + sig do + params( + external_customer_id: String, + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + currency: T.nilable(String), + cursor: T.nilable(String), + entry_status: T.nilable(Symbol), + entry_type: T.nilable(Symbol), + limit: Integer, + minimum_amount: T.nilable(String), + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::Variants]) + end + def list_by_external_id( + external_customer_id, + created_at_gt:, + created_at_gte:, + created_at_lt:, + created_at_lte:, + currency:, + cursor:, + entry_status:, + entry_type:, + limit:, + minimum_amount:, + request_options: {} + ); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end + end + end +end diff --git a/rbi/lib/orb/resources/customers/credits/top_ups.rbi b/rbi/lib/orb/resources/customers/credits/top_ups.rbi new file mode 100644 index 00000000..9bf87be1 --- /dev/null +++ b/rbi/lib/orb/resources/customers/credits/top_ups.rbi @@ -0,0 +1,92 @@ +# typed: strong + +module Orb + module Resources + class Customers + class Credits + class TopUps + sig do + params( + customer_id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateParams::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: T.nilable(Integer), + expires_after_unit: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Customers::Credits::TopUpCreateResponse) + end + def create( + customer_id, + amount:, + currency:, + invoice_settings:, + per_unit_cost_basis:, + threshold:, + expires_after:, + expires_after_unit:, + request_options: {} + ); end + + sig do + params( + customer_id: String, + cursor: T.nilable(String), + limit: Integer, + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Customers::Credits::TopUpListResponse]) + end + def list(customer_id, cursor:, limit:, request_options: {}); end + + sig { params(top_up_id: String, customer_id: String, request_options: Orb::RequestOpts).void } + def delete(top_up_id, customer_id:, request_options: {}); end + + sig do + params( + external_customer_id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: T.nilable(Integer), + expires_after_unit: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse) + end + def create_by_external_id( + external_customer_id, + amount:, + currency:, + invoice_settings:, + per_unit_cost_basis:, + threshold:, + expires_after:, + expires_after_unit:, + request_options: {} + ); end + + sig do + params(top_up_id: String, external_customer_id: String, request_options: Orb::RequestOpts).void + end + def delete_by_external_id(top_up_id, external_customer_id:, request_options: {}); end + + sig do + params( + external_customer_id: String, + cursor: T.nilable(String), + limit: Integer, + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Customers::Credits::TopUpListByExternalIDResponse]) + end + def list_by_external_id(external_customer_id, cursor:, limit:, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end + end + end +end diff --git a/rbi/lib/orb/resources/dimensional_price_groups.rbi b/rbi/lib/orb/resources/dimensional_price_groups.rbi new file mode 100644 index 00000000..66ae3ba8 --- /dev/null +++ b/rbi/lib/orb/resources/dimensional_price_groups.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Orb + module Resources + class DimensionalPriceGroups + sig { returns(Orb::Resources::DimensionalPriceGroups::ExternalDimensionalPriceGroupID) } + attr_reader :external_dimensional_price_group_id + + sig do + params( + billable_metric_id: String, + dimensions: T::Array[String], + name: String, + external_dimensional_price_group_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).returns(Orb::Models::DimensionalPriceGroup) + end + def create( + billable_metric_id:, + dimensions:, + name:, + external_dimensional_price_group_id:, + metadata:, + request_options: {} + ); end + + sig do + params( + dimensional_price_group_id: String, + request_options: Orb::RequestOpts + ).returns(Orb::Models::DimensionalPriceGroup) + end + def retrieve(dimensional_price_group_id, request_options: {}); end + + sig do + params( + cursor: T.nilable(String), + limit: Integer, + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::DimensionalPriceGroup]) + end + def list(cursor:, limit:, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end +end diff --git a/rbi/lib/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rbi b/rbi/lib/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rbi new file mode 100644 index 00000000..5ad5f0f3 --- /dev/null +++ b/rbi/lib/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module Orb + module Resources + class DimensionalPriceGroups + class ExternalDimensionalPriceGroupID + sig do + params( + external_dimensional_price_group_id: String, + request_options: Orb::RequestOpts + ).returns(Orb::Models::DimensionalPriceGroup) + end + def retrieve(external_dimensional_price_group_id, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end + end +end diff --git a/rbi/lib/orb/resources/events.rbi b/rbi/lib/orb/resources/events.rbi new file mode 100644 index 00000000..800a4291 --- /dev/null +++ b/rbi/lib/orb/resources/events.rbi @@ -0,0 +1,66 @@ +# typed: strong + +module Orb + module Resources + class Events + sig { returns(Orb::Resources::Events::Backfills) } + attr_reader :backfills + + sig { returns(Orb::Resources::Events::Volume) } + attr_reader :volume + + sig do + params( + event_id: String, + event_name: String, + properties: T.anything, + timestamp: Time, + customer_id: T.nilable(String), + external_customer_id: T.nilable(String), + request_options: Orb::RequestOpts + ).returns(Orb::Models::EventUpdateResponse) + end + def update( + event_id, + event_name:, + properties:, + timestamp:, + customer_id:, + external_customer_id:, + request_options: {} + ) + end + + sig do + params( + event_id: String, + request_options: Orb::RequestOpts + ).returns(Orb::Models::EventDeprecateResponse) + end + def deprecate(event_id, request_options: {}); end + + sig do + params( + events: T::Array[Orb::Models::EventIngestParams::Event], + backfill_id: T.nilable(String), + debug: T::Boolean, + request_options: Orb::RequestOpts + ).returns(Orb::Models::EventIngestResponse) + end + def ingest(events:, backfill_id:, debug:, request_options: {}); end + + sig do + params( + event_ids: T::Array[String], + timeframe_end: T.nilable(Time), + timeframe_start: T.nilable(Time), + request_options: Orb::RequestOpts + ).returns(Orb::Models::EventSearchResponse) + end + def search(event_ids:, timeframe_end:, timeframe_start:, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end +end diff --git a/rbi/lib/orb/resources/events/backfills.rbi b/rbi/lib/orb/resources/events/backfills.rbi new file mode 100644 index 00000000..d5732a17 --- /dev/null +++ b/rbi/lib/orb/resources/events/backfills.rbi @@ -0,0 +1,68 @@ +# typed: strong + +module Orb + module Resources + class Events + class Backfills + sig do + params( + timeframe_end: Time, + timeframe_start: Time, + close_time: T.nilable(Time), + customer_id: T.nilable(String), + deprecation_filter: T.nilable(String), + external_customer_id: T.nilable(String), + replace_existing_events: T::Boolean, + request_options: Orb::RequestOpts + ).returns(Orb::Models::Events::BackfillCreateResponse) + end + def create( + timeframe_end:, + timeframe_start:, + close_time:, + customer_id:, + deprecation_filter:, + external_customer_id:, + replace_existing_events:, + request_options: {} + ); end + + sig do + params( + cursor: T.nilable(String), + limit: Integer, + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Events::BackfillListResponse]) + end + def list(cursor:, limit:, request_options: {}); end + + sig do + params( + backfill_id: String, + request_options: Orb::RequestOpts + ).returns(Orb::Models::Events::BackfillCloseResponse) + end + def close(backfill_id, request_options: {}); end + + sig do + params( + backfill_id: String, + request_options: Orb::RequestOpts + ).returns(Orb::Models::Events::BackfillFetchResponse) + end + def fetch(backfill_id, request_options: {}); end + + sig do + params( + backfill_id: String, + request_options: Orb::RequestOpts + ).returns(Orb::Models::Events::BackfillRevertResponse) + end + def revert(backfill_id, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end + end +end diff --git a/rbi/lib/orb/resources/events/volume.rbi b/rbi/lib/orb/resources/events/volume.rbi new file mode 100644 index 00000000..555a6f58 --- /dev/null +++ b/rbi/lib/orb/resources/events/volume.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module Orb + module Resources + class Events + class Volume + sig do + params( + timeframe_start: Time, + cursor: T.nilable(String), + limit: Integer, + timeframe_end: Time, + request_options: Orb::RequestOpts + ).returns(Orb::Models::Events::EventVolumes) + end + def list(timeframe_start:, cursor:, limit:, timeframe_end:, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end + end +end diff --git a/rbi/lib/orb/resources/invoice_line_items.rbi b/rbi/lib/orb/resources/invoice_line_items.rbi new file mode 100644 index 00000000..157fef58 --- /dev/null +++ b/rbi/lib/orb/resources/invoice_line_items.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module Orb + module Resources + class InvoiceLineItems + sig do + params( + amount: String, + end_date: Date, + invoice_id: String, + name: String, + quantity: Float, + start_date: Date, + request_options: Orb::RequestOpts + ).returns(Orb::Models::InvoiceLineItemCreateResponse) + end + def create(amount:, end_date:, invoice_id:, name:, quantity:, start_date:, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end +end diff --git a/rbi/lib/orb/resources/invoices.rbi b/rbi/lib/orb/resources/invoices.rbi new file mode 100644 index 00000000..82ee22a4 --- /dev/null +++ b/rbi/lib/orb/resources/invoices.rbi @@ -0,0 +1,132 @@ +# typed: strong + +module Orb + module Resources + class Invoices + sig do + params( + currency: String, + invoice_date: Time, + line_items: T::Array[Orb::Models::InvoiceCreateParams::LineItem], + net_terms: Integer, + customer_id: T.nilable(String), + discount: T.nilable(Orb::Models::Discount::Variants), + external_customer_id: T.nilable(String), + memo: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + will_auto_issue: T::Boolean, + request_options: Orb::RequestOpts + ).returns(Orb::Models::Invoice) + end + def create( + currency:, + invoice_date:, + line_items:, + net_terms:, + customer_id:, + discount:, + external_customer_id:, + memo:, + metadata:, + will_auto_issue:, + request_options: {} + ); end + + sig do + params( + invoice_id: String, + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Invoice) + end + def update(invoice_id, metadata:, request_options: {}); end + + sig do + params( + amount: T.nilable(String), + amount_gt: T.nilable(String), + amount_lt: T.nilable(String), + cursor: T.nilable(String), + customer_id: T.nilable(String), + date_type: T.nilable(Symbol), + due_date: T.nilable(Date), + due_date_window: T.nilable(String), + due_date_gt: T.nilable(Date), + due_date_lt: T.nilable(Date), + external_customer_id: T.nilable(String), + invoice_date_gt: T.nilable(Time), + invoice_date_gte: T.nilable(Time), + invoice_date_lt: T.nilable(Time), + invoice_date_lte: T.nilable(Time), + is_recurring: T.nilable(T::Boolean), + limit: Integer, + status: T.nilable(T::Array[Symbol]), + subscription_id: T.nilable(String), + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Invoice]) + end + def list( + amount:, + amount_gt:, + amount_lt:, + cursor:, + customer_id:, + date_type:, + due_date:, + due_date_window:, + due_date_gt:, + due_date_lt:, + external_customer_id:, + invoice_date_gt:, + invoice_date_gte:, + invoice_date_lt:, + invoice_date_lte:, + is_recurring:, + limit:, + status:, + subscription_id:, + request_options: {} + ); end + + sig { params(invoice_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::Invoice) } + def fetch(invoice_id, request_options: {}); end + + sig do + params( + subscription_id: String, + request_options: Orb::RequestOpts + ).returns(Orb::Models::InvoiceFetchUpcomingResponse) + end + def fetch_upcoming(subscription_id:, request_options: {}); end + + sig do + params( + invoice_id: String, + synchronous: T::Boolean, + request_options: Orb::RequestOpts + ).returns(Orb::Models::Invoice) + end + def issue(invoice_id, synchronous:, request_options: {}); end + + sig do + params( + invoice_id: String, + payment_received_date: Date, + external_id: T.nilable(String), + notes: T.nilable(String), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Invoice) + end + def mark_paid(invoice_id, payment_received_date:, external_id:, notes:, request_options: {}); end + + sig { params(invoice_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::Invoice) } + def pay(invoice_id, request_options: {}); end + + sig { params(invoice_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::Invoice) } + def void(invoice_id, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end +end diff --git a/rbi/lib/orb/resources/items.rbi b/rbi/lib/orb/resources/items.rbi new file mode 100644 index 00000000..d7c427cd --- /dev/null +++ b/rbi/lib/orb/resources/items.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Orb + module Resources + class Items + sig { params(name: String, request_options: Orb::RequestOpts).returns(Orb::Models::Item) } + def create(name:, request_options: {}); end + + sig do + params( + item_id: String, + external_connections: T.nilable(T::Array[Orb::Models::ItemUpdateParams::ExternalConnection]), + name: T.nilable(String), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Item) + end + def update(item_id, external_connections:, name:, request_options: {}); end + + sig do + params( + cursor: T.nilable(String), + limit: Integer, + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Item]) + end + def list(cursor:, limit:, request_options: {}); end + + sig { params(item_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::Item) } + def fetch(item_id, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end +end diff --git a/rbi/lib/orb/resources/metrics.rbi b/rbi/lib/orb/resources/metrics.rbi new file mode 100644 index 00000000..caf64c3b --- /dev/null +++ b/rbi/lib/orb/resources/metrics.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Orb + module Resources + class Metrics + sig do + params( + description: T.nilable(String), + item_id: String, + name: String, + sql: String, + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).returns(Orb::Models::BillableMetric) + end + def create(description:, item_id:, name:, sql:, metadata:, request_options: {}); end + + sig do + params( + metric_id: String, + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).returns(Orb::Models::BillableMetric) + end + def update(metric_id, metadata:, request_options: {}); end + + sig do + params( + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + cursor: T.nilable(String), + limit: Integer, + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::BillableMetric]) + end + def list( + created_at_gt:, + created_at_gte:, + created_at_lt:, + created_at_lte:, + cursor:, + limit:, + request_options: {} + ) + end + + sig do + params(metric_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::BillableMetric) + end + def fetch(metric_id, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end +end diff --git a/rbi/lib/orb/resources/plans.rbi b/rbi/lib/orb/resources/plans.rbi new file mode 100644 index 00000000..f83a1172 --- /dev/null +++ b/rbi/lib/orb/resources/plans.rbi @@ -0,0 +1,74 @@ +# typed: strong + +module Orb + module Resources + class Plans + sig { returns(Orb::Resources::Plans::ExternalPlanID) } + attr_reader :external_plan_id + + sig do + params( + currency: String, + name: String, + prices: T::Array[Orb::Models::PlanCreateParams::Price::Variants], + default_invoice_memo: T.nilable(String), + external_plan_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + net_terms: T.nilable(Integer), + status: Symbol, + request_options: Orb::RequestOpts + ).returns(Orb::Models::Plan) + end + def create( + currency:, + name:, + prices:, + default_invoice_memo:, + external_plan_id:, + metadata:, + net_terms:, + status:, + request_options: {} + ); end + + sig do + params( + plan_id: String, + external_plan_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Plan) + end + def update(plan_id, external_plan_id:, metadata:, request_options: {}); end + + sig do + params( + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + cursor: T.nilable(String), + limit: Integer, + status: Symbol, + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Plan]) + end + def list( + created_at_gt:, + created_at_gte:, + created_at_lt:, + created_at_lte:, + cursor:, + limit:, + status:, + request_options: {} + ); end + + sig { params(plan_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::Plan) } + def fetch(plan_id, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end +end diff --git a/rbi/lib/orb/resources/plans/external_plan_id.rbi b/rbi/lib/orb/resources/plans/external_plan_id.rbi new file mode 100644 index 00000000..8b8c3606 --- /dev/null +++ b/rbi/lib/orb/resources/plans/external_plan_id.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Orb + module Resources + class Plans + class ExternalPlanID + sig do + params( + other_external_plan_id: String, + external_plan_id: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Plan) + end + def update(other_external_plan_id, external_plan_id:, metadata:, request_options: {}); end + + sig { params(external_plan_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::Plan) } + def fetch(external_plan_id, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end + end +end diff --git a/rbi/lib/orb/resources/prices.rbi b/rbi/lib/orb/resources/prices.rbi new file mode 100644 index 00000000..3625bfca --- /dev/null +++ b/rbi/lib/orb/resources/prices.rbi @@ -0,0 +1,150 @@ +# typed: strong + +module Orb + module Resources + class Prices + sig { returns(Orb::Resources::Prices::ExternalPriceID) } + attr_reader :external_price_id + + sig do + params( + cadence: Symbol, + currency: String, + item_id: String, + model_type: Symbol, + name: String, + unit_config: Orb::Models::PriceCreateParams::UnitConfig, + billable_metric_id: T.nilable(String), + billed_in_advance: T.nilable(T::Boolean), + billing_cycle_configuration: T.nilable(Orb::Models::PriceCreateParams::BillingCycleConfiguration), + conversion_rate: T.nilable(Float), + external_price_id: T.nilable(String), + fixed_price_quantity: T.nilable(Float), + invoice_grouping_key: T.nilable(String), + invoicing_cycle_configuration: T.nilable(Orb::Models::PriceCreateParams::InvoicingCycleConfiguration), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + package_config: Orb::Models::PriceCreateParams::PackageConfig, + matrix_config: Orb::Models::PriceCreateParams::MatrixConfig, + matrix_with_allocation_config: Orb::Models::PriceCreateParams::MatrixWithAllocationConfig, + tiered_config: Orb::Models::PriceCreateParams::TieredConfig, + tiered_bps_config: Orb::Models::PriceCreateParams::TieredBpsConfig, + bps_config: Orb::Models::PriceCreateParams::BpsConfig, + bulk_bps_config: Orb::Models::PriceCreateParams::BulkBpsConfig, + bulk_config: Orb::Models::PriceCreateParams::BulkConfig, + threshold_total_amount_config: T::Hash[Symbol, T.anything], + tiered_package_config: T::Hash[Symbol, T.anything], + grouped_tiered_config: T::Hash[Symbol, T.anything], + max_group_tiered_package_config: T::Hash[Symbol, T.anything], + tiered_with_minimum_config: T::Hash[Symbol, T.anything], + package_with_allocation_config: T::Hash[Symbol, T.anything], + tiered_package_with_minimum_config: T::Hash[Symbol, T.anything], + unit_with_percent_config: T::Hash[Symbol, T.anything], + tiered_with_proration_config: T::Hash[Symbol, T.anything], + unit_with_proration_config: T::Hash[Symbol, T.anything], + grouped_allocation_config: T::Hash[Symbol, T.anything], + grouped_with_prorated_minimum_config: T::Hash[Symbol, T.anything], + grouped_with_metered_minimum_config: T::Hash[Symbol, T.anything], + matrix_with_display_name_config: T::Hash[Symbol, T.anything], + bulk_with_proration_config: T::Hash[Symbol, T.anything], + grouped_tiered_package_config: T::Hash[Symbol, T.anything], + scalable_matrix_with_unit_pricing_config: T::Hash[Symbol, T.anything], + scalable_matrix_with_tiered_pricing_config: T::Hash[Symbol, T.anything], + request_options: Orb::RequestOpts + ).returns(Orb::Models::Price::Variants) + end + def create( + cadence:, + currency:, + item_id:, + model_type:, + name:, + unit_config:, + billable_metric_id:, + billed_in_advance:, + billing_cycle_configuration:, + conversion_rate:, + external_price_id:, + fixed_price_quantity:, + invoice_grouping_key:, + invoicing_cycle_configuration:, + metadata:, + package_config:, + matrix_config:, + matrix_with_allocation_config:, + tiered_config:, + tiered_bps_config:, + bps_config:, + bulk_bps_config:, + bulk_config:, + threshold_total_amount_config:, + tiered_package_config:, + grouped_tiered_config:, + max_group_tiered_package_config:, + tiered_with_minimum_config:, + package_with_allocation_config:, + tiered_package_with_minimum_config:, + unit_with_percent_config:, + tiered_with_proration_config:, + unit_with_proration_config:, + grouped_allocation_config:, + grouped_with_prorated_minimum_config:, + grouped_with_metered_minimum_config:, + matrix_with_display_name_config:, + bulk_with_proration_config:, + grouped_tiered_package_config:, + scalable_matrix_with_unit_pricing_config:, + scalable_matrix_with_tiered_pricing_config:, + request_options: {} + ); end + + sig do + params( + price_id: String, + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Price::Variants) + end + def update(price_id, metadata:, request_options: {}); end + + sig do + params( + cursor: T.nilable(String), + limit: Integer, + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Price::Variants]) + end + def list(cursor:, limit:, request_options: {}); end + + sig do + params( + price_id: String, + timeframe_end: Time, + timeframe_start: Time, + customer_id: T.nilable(String), + external_customer_id: T.nilable(String), + filter: T.nilable(String), + grouping_keys: T::Array[String], + request_options: Orb::RequestOpts + ).returns(Orb::Models::PriceEvaluateResponse) + end + def evaluate( + price_id, + timeframe_end:, + timeframe_start:, + customer_id:, + external_customer_id:, + filter:, + grouping_keys:, + request_options: {} + ); end + + sig do + params(price_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::Price::Variants) + end + def fetch(price_id, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end +end diff --git a/rbi/lib/orb/resources/prices/external_price_id.rbi b/rbi/lib/orb/resources/prices/external_price_id.rbi new file mode 100644 index 00000000..10f9e822 --- /dev/null +++ b/rbi/lib/orb/resources/prices/external_price_id.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Orb + module Resources + class Prices + class ExternalPriceID + sig do + params( + external_price_id: String, + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Price::Variants) + end + def update(external_price_id, metadata:, request_options: {}); end + + sig do + params( + external_price_id: String, + request_options: Orb::RequestOpts + ).returns(Orb::Models::Price::Variants) + end + def fetch(external_price_id, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end + end +end diff --git a/rbi/lib/orb/resources/subscriptions.rbi b/rbi/lib/orb/resources/subscriptions.rbi new file mode 100644 index 00000000..08e9d7c2 --- /dev/null +++ b/rbi/lib/orb/resources/subscriptions.rbi @@ -0,0 +1,361 @@ +# typed: strong + +module Orb + module Resources + class Subscriptions + sig do + params( + add_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::AddAdjustment]), + add_prices: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::AddPrice]), + align_billing_with_subscription_start_date: T::Boolean, + auto_collection: T.nilable(T::Boolean), + aws_region: T.nilable(String), + billing_cycle_anchor_configuration: T.nilable(Orb::Models::SubscriptionCreateParams::BillingCycleAnchorConfiguration), + coupon_redemption_code: T.nilable(String), + credits_overage_rate: T.nilable(Float), + customer_id: T.nilable(String), + default_invoice_memo: T.nilable(String), + end_date: T.nilable(Time), + external_customer_id: T.nilable(String), + external_marketplace: T.nilable(Symbol), + external_marketplace_reporting_id: T.nilable(String), + external_plan_id: T.nilable(String), + filter: T.nilable(String), + initial_phase_order: T.nilable(Integer), + invoicing_threshold: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + net_terms: T.nilable(Integer), + per_credit_overage_amount: T.nilable(Float), + plan_id: T.nilable(String), + plan_version_number: T.nilable(Integer), + price_overrides: T.nilable(T::Array[T.anything]), + remove_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::RemoveAdjustment]), + remove_prices: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::RemovePrice]), + replace_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::ReplaceAdjustment]), + replace_prices: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice]), + start_date: T.nilable(Time), + trial_duration_days: T.nilable(Integer), + request_options: Orb::RequestOpts + ).returns(Orb::Models::SubscriptionCreateResponse) + end + def create( + add_adjustments:, + add_prices:, + align_billing_with_subscription_start_date:, + auto_collection:, + aws_region:, + billing_cycle_anchor_configuration:, + coupon_redemption_code:, + credits_overage_rate:, + customer_id:, + default_invoice_memo:, + end_date:, + external_customer_id:, + external_marketplace:, + external_marketplace_reporting_id:, + external_plan_id:, + filter:, + initial_phase_order:, + invoicing_threshold:, + metadata:, + net_terms:, + per_credit_overage_amount:, + plan_id:, + plan_version_number:, + price_overrides:, + remove_adjustments:, + remove_prices:, + replace_adjustments:, + replace_prices:, + start_date:, + trial_duration_days:, + request_options: {} + ); end + + sig do + params( + subscription_id: String, + auto_collection: T.nilable(T::Boolean), + default_invoice_memo: T.nilable(String), + invoicing_threshold: T.nilable(String), + metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), + net_terms: T.nilable(Integer), + request_options: Orb::RequestOpts + ).returns(Orb::Models::Subscription) + end + def update( + subscription_id, + auto_collection:, + default_invoice_memo:, + invoicing_threshold:, + metadata:, + net_terms:, + request_options: {} + ); end + + sig do + params( + created_at_gt: T.nilable(Time), + created_at_gte: T.nilable(Time), + created_at_lt: T.nilable(Time), + created_at_lte: T.nilable(Time), + cursor: T.nilable(String), + customer_id: T.nilable(T::Array[String]), + external_customer_id: T.nilable(String), + limit: Integer, + status: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::Subscription]) + end + def list( + created_at_gt:, + created_at_gte:, + created_at_lt:, + created_at_lte:, + cursor:, + customer_id:, + external_customer_id:, + limit:, + status:, + request_options: {} + ); end + + sig do + params( + subscription_id: String, + cancel_option: Symbol, + cancellation_date: T.nilable(Time), + request_options: Orb::RequestOpts + ).returns(Orb::Models::SubscriptionCancelResponse) + end + def cancel(subscription_id, cancel_option:, cancellation_date:, request_options: {}); end + + sig do + params(subscription_id: String, request_options: Orb::RequestOpts).returns(Orb::Models::Subscription) + end + def fetch(subscription_id, request_options: {}); end + + sig do + params( + subscription_id: String, + currency: T.nilable(String), + timeframe_end: T.nilable(Time), + timeframe_start: T.nilable(Time), + view_mode: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).returns(Orb::Models::SubscriptionFetchCostsResponse) + end + def fetch_costs( + subscription_id, + currency:, + timeframe_end:, + timeframe_start:, + view_mode:, + request_options: {} + ) + end + + sig do + params( + subscription_id: String, + cursor: T.nilable(String), + limit: Integer, + start_date_gt: T.nilable(Time), + start_date_gte: T.nilable(Time), + start_date_lt: T.nilable(Time), + start_date_lte: T.nilable(Time), + request_options: Orb::RequestOpts + ).returns(Orb::Page[Orb::Models::SubscriptionFetchScheduleResponse]) + end + def fetch_schedule( + subscription_id, + cursor:, + limit:, + start_date_gt:, + start_date_gte:, + start_date_lt:, + start_date_lte:, + request_options: {} + ); end + + sig do + params( + subscription_id: String, + billable_metric_id: T.nilable(String), + first_dimension_key: T.nilable(String), + first_dimension_value: T.nilable(String), + granularity: T.nilable(Symbol), + group_by: T.nilable(String), + second_dimension_key: T.nilable(String), + second_dimension_value: T.nilable(String), + timeframe_end: T.nilable(Time), + timeframe_start: T.nilable(Time), + view_mode: T.nilable(Symbol), + request_options: Orb::RequestOpts + ).returns(Orb::Models::SubscriptionUsage::Variants) + end + def fetch_usage( + subscription_id, + billable_metric_id:, + first_dimension_key:, + first_dimension_value:, + granularity:, + group_by:, + second_dimension_key:, + second_dimension_value:, + timeframe_end:, + timeframe_start:, + view_mode:, + request_options: {} + ); end + + sig do + params( + subscription_id: String, + add: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add], + add_adjustments: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment], + edit: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::Edit], + edit_adjustments: T::Array[Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment], + request_options: Orb::RequestOpts + ).returns(Orb::Models::SubscriptionPriceIntervalsResponse) + end + def price_intervals( + subscription_id, + add:, + add_adjustments:, + edit:, + edit_adjustments:, + request_options: {} + ) + end + + sig do + params( + subscription_id: String, + change_option: Symbol, + add_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment]), + add_prices: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice]), + align_billing_with_plan_change_date: T.nilable(T::Boolean), + auto_collection: T.nilable(T::Boolean), + billing_cycle_alignment: T.nilable(Symbol), + billing_cycle_anchor_configuration: T.nilable(Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAnchorConfiguration), + change_date: T.nilable(Time), + coupon_redemption_code: T.nilable(String), + credits_overage_rate: T.nilable(Float), + default_invoice_memo: T.nilable(String), + external_plan_id: T.nilable(String), + filter: T.nilable(String), + initial_phase_order: T.nilable(Integer), + invoicing_threshold: T.nilable(String), + net_terms: T.nilable(Integer), + per_credit_overage_amount: T.nilable(Float), + plan_id: T.nilable(String), + plan_version_number: T.nilable(Integer), + price_overrides: T.nilable(T::Array[T.anything]), + remove_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::RemoveAdjustment]), + remove_prices: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::RemovePrice]), + replace_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment]), + replace_prices: T.nilable(T::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice]), + trial_duration_days: T.nilable(Integer), + request_options: Orb::RequestOpts + ).returns(Orb::Models::SubscriptionSchedulePlanChangeResponse) + end + def schedule_plan_change( + subscription_id, + change_option:, + add_adjustments:, + add_prices:, + align_billing_with_plan_change_date:, + auto_collection:, + billing_cycle_alignment:, + billing_cycle_anchor_configuration:, + change_date:, + coupon_redemption_code:, + credits_overage_rate:, + default_invoice_memo:, + external_plan_id:, + filter:, + initial_phase_order:, + invoicing_threshold:, + net_terms:, + per_credit_overage_amount:, + plan_id:, + plan_version_number:, + price_overrides:, + remove_adjustments:, + remove_prices:, + replace_adjustments:, + replace_prices:, + trial_duration_days:, + request_options: {} + ); end + + sig do + params( + subscription_id: String, + effective_date: T.nilable(Date), + request_options: Orb::RequestOpts + ).returns(Orb::Models::SubscriptionTriggerPhaseResponse) + end + def trigger_phase(subscription_id, effective_date:, request_options: {}); end + + sig do + params( + subscription_id: String, + request_options: Orb::RequestOpts + ).returns(Orb::Models::SubscriptionUnscheduleCancellationResponse) + end + def unschedule_cancellation(subscription_id, request_options: {}); end + + sig do + params( + subscription_id: String, + price_id: String, + request_options: Orb::RequestOpts + ).returns(Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse) + end + def unschedule_fixed_fee_quantity_updates(subscription_id, price_id:, request_options: {}); end + + sig do + params( + subscription_id: String, + request_options: Orb::RequestOpts + ).returns(Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse) + end + def unschedule_pending_plan_changes(subscription_id, request_options: {}); end + + sig do + params( + subscription_id: String, + price_id: String, + quantity: Float, + change_option: Symbol, + effective_date: T.nilable(Date), + request_options: Orb::RequestOpts + ).returns(Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse) + end + def update_fixed_fee_quantity( + subscription_id, + price_id:, + quantity:, + change_option:, + effective_date:, + request_options: {} + ) + end + + sig do + params( + subscription_id: String, + trial_end_date: Orb::Models::SubscriptionUpdateTrialParams::TrialEndDate::Variants, + shift: T::Boolean, + request_options: Orb::RequestOpts + ).returns(Orb::Models::SubscriptionUpdateTrialResponse) + end + def update_trial(subscription_id, trial_end_date:, shift:, request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end +end diff --git a/rbi/lib/orb/resources/top_level.rbi b/rbi/lib/orb/resources/top_level.rbi new file mode 100644 index 00000000..feab6937 --- /dev/null +++ b/rbi/lib/orb/resources/top_level.rbi @@ -0,0 +1,13 @@ +# typed: strong + +module Orb + module Resources + class TopLevel + sig { params(request_options: Orb::RequestOpts).returns(Orb::Models::TopLevelPingResponse) } + def ping(request_options: {}); end + + sig { params(client: Orb::Client).void } + def initialize(client:); end + end + end +end diff --git a/rbi/lib/orb/util.rbi b/rbi/lib/orb/util.rbi new file mode 100644 index 00000000..e91250eb --- /dev/null +++ b/rbi/lib/orb/util.rbi @@ -0,0 +1,103 @@ +# typed: strong + +module Orb + module Util + sig { params(input: T.anything).returns(T.any(T::Boolean, T.anything)) } + def self.primitive?(input); end + + sig { params(input: T.anything).returns(T.any(T::Boolean, T.anything)) } + def self.coerce_boolean(input); end + + sig { params(input: T.anything).returns(T.nilable(T::Boolean)) } + def self.coerce_boolean!(input); end + + sig { params(input: T.anything).returns(T.any(Integer, T.anything)) } + def self.coerce_integer(input); end + + sig { params(input: T.anything).returns(T.any(Float, T.anything)) } + def self.coerce_float(input); end + + sig { params(input: T.anything).returns(T.any(T::Hash[T.anything, T.anything], T.anything)) } + def self.coerce_hash(input); end + + sig do + params( + exceptions: T::Array[Exception], + sentinel: T.nilable(T.anything), + blk: T.nilable(T.proc.returns(T.anything)) + ).returns(T.nilable(T.anything)) + end + def self.suppress(*exceptions, sentinel: nil, &blk); end + + OMIT = T.let(T.anything, T.anything) + + sig do + params( + values: T::Array[T.anything], + sentinel: T.nilable(T.anything), + concat: T::Boolean + ).returns(T.anything) + end + def self.deep_merge(*values, sentinel: nil, concat: false); end + + sig do + params( + data: T.any(T::Hash[Symbol, T.anything], T::Array[T.anything], T.anything), + pick: T.nilable(T.any(Symbol, Integer, T::Array[T.any(Symbol, Integer)])), + sentinel: T.nilable(T.anything), + blk: T.nilable(T.proc.returns(T.anything)) + ).returns(T.nilable(T.anything)) + end + def self.dig(data, pick, sentinel = nil, &blk); end + + sig { params(uri: URI::Generic).returns(String) } + def self.uri_origin(uri); end + + sig { params(path: T.any(String, T::Array[String])).returns(String) } + def self.interpolate_path(path); end + + ParsedUriShape = T.type_alias do + { + scheme: T.nilable(String), + host: T.nilable(String), + port: T.nilable(Integer), + path: T.nilable(String), + query: T::Hash[String, T::Array[String]] + } + end + + sig { params(url: T.any(URI::Generic, String)).returns(Orb::Util::ParsedUriShape) } + def self.parse_uri(url); end + + sig { params(parsed: Orb::Util::ParsedUriShape).returns(URI::Generic) } + def self.unparse_uri(parsed); end + + sig { params(lhs: Orb::Util::ParsedUriShape, rhs: Orb::Util::ParsedUriShape).returns(URI::Generic) } + def self.join_parsed_uri(lhs, rhs); end + + sig { params(query: T.nilable(String)).returns(T::Hash[String, T::Array[String]]) } + def self.decode_query(query); end + + sig do + params(query: T::Hash[String, T.nilable(T.any(T::Array[String], String))]).returns(T.nilable(String)) + end + def self.encode_query(query); end + + sig do + params( + headers: T::Array[T::Hash[String, + T.nilable(T.any(String, Integer))]] + ).returns(T::Hash[String, String]) + end + def self.normalized_headers(*headers); end + + sig { params(headers: T::Hash[String, String], body: T.anything).returns(T.anything) } + def self.encode_content(headers, body); end + + sig { params(response: Net::HTTPResponse, suppress_error: T::Boolean).returns(T.anything) } + def self.decode_content(response, suppress_error: false); end + + sig { params(io: StringIO, boundary: String, key: T.any(Symbol, String), val: T.anything).void } + private_class_method def self.encode_multipart_formdata(io, boundary:, key:, val:); end + end +end diff --git a/rbi/lib/orb/version.rbi b/rbi/lib/orb/version.rbi new file mode 100644 index 00000000..f49c5fcd --- /dev/null +++ b/rbi/lib/orb/version.rbi @@ -0,0 +1,5 @@ +# typed: strong + +module Orb + VERSION = "0.0.1-alpha.0" +end diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..3a77f774 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,64 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "release-type": "ruby", + "version-file": "lib/orb/version.rb" +} \ No newline at end of file diff --git a/scripts/bootstrap b/scripts/bootstrap new file mode 100755 index 00000000..0b65ccb0 --- /dev/null +++ b/scripts/bootstrap @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then + brew bundle check >/dev/null 2>&1 || { + echo "==> Installing Homebrew dependencies…" + brew bundle + } +fi + +echo "==> Installing Ruby dependencies…" + +bundle install diff --git a/scripts/format b/scripts/format new file mode 100755 index 00000000..67b400de --- /dev/null +++ b/scripts/format @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +cd -- "$(dirname -- "$0")/.." + +echo "==> Running formatters" +exec -- bundle exec rake format "$@" diff --git a/scripts/lint b/scripts/lint new file mode 100755 index 00000000..39581dc1 --- /dev/null +++ b/scripts/lint @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +cd -- "$(dirname -- "$0")/.." + +exec -- bundle exec rake lint "$@" diff --git a/scripts/mock b/scripts/mock new file mode 100755 index 00000000..d2814ae6 --- /dev/null +++ b/scripts/mock @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [[ -n "$1" && "$1" != '--'* ]]; then + URL="$1" + shift +else + URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" +fi + +# Check if the URL is empty +if [ -z "$URL" ]; then + echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" + exit 1 +fi + +echo "==> Starting mock server with URL ${URL}" + +# Run prism mock on the given spec +if [ "$1" == "--daemon" ]; then + npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + + # Wait for server to come online + echo -n "Waiting for server" + while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + echo -n "." + sleep 0.1 + done + + if grep -q "✖ fatal" ".prism.log"; then + cat .prism.log + exit 1 + fi + + echo +else + npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" +fi diff --git a/scripts/test b/scripts/test new file mode 100755 index 00000000..2e1fe093 --- /dev/null +++ b/scripts/test @@ -0,0 +1,56 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +NC='\033[0m' # No Color + +function prism_is_running() { + curl --silent "http://localhost:4010" >/dev/null 2>&1 +} + +kill_server_on_port() { + pids=$(lsof -t -i tcp:"$1" || echo "") + if [ "$pids" != "" ]; then + kill "$pids" + echo "Stopped $pids." + fi +} + +function is_overriding_api_base_url() { + [ -n "$TEST_API_BASE_URL" ] +} + +if ! is_overriding_api_base_url && ! prism_is_running ; then + # When we exit this script, make sure to kill the background mock server process + trap 'kill_server_on_port 4010' EXIT + + # Start the dev server + ./scripts/mock --daemon +fi + +if is_overriding_api_base_url ; then + echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" + echo +elif ! prism_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" + echo -e "running against your OpenAPI spec." + echo + echo -e "To run the server, pass in the path or url of your OpenAPI" + echo -e "spec to the prism command:" + echo + echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo + + exit 1 +else + echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo +fi + +echo "==> Running tests" +bundle exec rake test "$@" diff --git a/sig/orb/base_client.rbs b/sig/orb/base_client.rbs new file mode 100644 index 00000000..b85b4275 --- /dev/null +++ b/sig/orb/base_client.rbs @@ -0,0 +1,100 @@ +module Orb + class BaseClient + type request = + { + method: Symbol, + path: String | Array[String], + query: Hash[String, (Array[String] | String)?]?, + headers: Hash[String, String?]?, + body: top?, + unwrap: Symbol?, + page: Class?, + model: Orb::Converter::input?, + options: (Orb::RequestOptions + | Orb::request_options + | Hash[Symbol, top])? + } + + type normalized_request = + { + method: Symbol, + url: URI::Generic, + headers: Hash[String, String], + body: top, + max_retries: Integer, + timeout: Float + } + + MAX_REDIRECTS: 20 + + def self.validate!: (Orb::BaseClient::request req) -> void + + # @private + attr_accessor requester: top + + def initialize: ( + base_url: String, + timeout: Float, + max_retries: Integer, + initial_retry_delay: Float, + max_retry_delay: Float, + headers: Hash[String, String?], + idempotency_header: String? + ) -> void + + private def auth_headers: -> Hash[String, String] + + private def generate_idempotency_key: -> String + + private def build_request: ( + Orb::BaseClient::request req, + Orb::request_options opts + ) -> Orb::BaseClient::normalized_request + + private def should_retry?: ( + Integer status, + headers: Hash[String, String] + ) -> bool + + private def retry_delay: ( + Hash[String, String] headers, + retry_count: Integer + ) -> Float + + private def follow_redirect: ( + Orb::BaseClient::normalized_request request, + status: Integer, + location_header: String + ) -> Orb::BaseClient::normalized_request + + private def send_request: ( + Orb::BaseClient::normalized_request request, + redirect_count: Integer, + retry_count: Integer, + send_retry_header: bool + ) -> top + + private def parse_response: ( + Orb::BaseClient::request req, + nil response + ) -> top + + def request: + ( + Symbol method, + String | Array[String] path, + query: Hash[String, (Array[String] | String)?]?, + headers: Hash[String, String?]?, + body: top?, + unwrap: Symbol?, + page: Class?, + model: Orb::Converter::input?, + options: (Orb::RequestOptions + | Orb::request_options + | Hash[Symbol, top])? + ) -> top + | (Orb::BaseClient::request req) -> top + + def inspect: -> String + end +end diff --git a/sig/orb/base_model.rbs b/sig/orb/base_model.rbs new file mode 100644 index 00000000..7b9a0991 --- /dev/null +++ b/sig/orb/base_model.rbs @@ -0,0 +1,241 @@ +module Orb + module Converter + type input = Orb::Converter | Class + + def coerce: (top value) -> top + + def dump: (top value) -> top + + def try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + + def self.type_info: ( + { + const: (nil | bool | Integer | Float | Symbol)?, + enum: ^-> Orb::Converter::input?, + union: ^-> Orb::Converter::input? + } + | ^-> Orb::Converter::input + | Orb::Converter::input spec + ) -> (^-> top) + + def self.coerce: (Orb::Converter::input target, top value) -> top + + def self.dump: (Orb::Converter::input target, top value) -> top + + def self.try_strict_coerce: (Orb::Converter::input target, top value) -> top + end + + class Unknown + extend Orb::Converter + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: (top value) -> top + + def self.dump: (top value) -> top + + def self.try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + end + + class BooleanModel + extend Orb::Converter + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: (bool | top value) -> (bool | top) + + def self.dump: (bool | top value) -> (bool | top) + + def self.try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + end + + class Enum + extend Orb::Converter + + def self.values: -> Array[(nil | bool | Integer | Float | Symbol)] + + private def self.finalize!: -> void + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: (String | Symbol | top value) -> (Symbol | top) + + def self.dump: (Symbol | top value) -> (Symbol | top) + + def self.try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + end + + class Union + extend Orb::Extern + extend Orb::Converter + + private def self.known_variants: -> Array[[Symbol?, Proc]] + + def self.variants: -> Array[[Symbol?, top]] + + private def self.discriminator: (Symbol property) -> void + + private def self.variant: ( + Symbol + | Hash[Symbol, top] + | ^-> Orb::Converter::input + | Orb::Converter::input key, + ?Hash[Symbol, top] + | ^-> Orb::Converter::input + | Orb::Converter::input spec + ) -> void + + private def self.resolve_variant: (top value) -> Orb::Converter::input? + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: (top value) -> top + + def self.dump: (top value) -> top + + def self.try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + end + + class ArrayOf + include Orb::Converter + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def coerce: (Enumerable[top] | top value) -> (Array[top] | top) + + def dump: (Enumerable[top] | top value) -> (Array[top] | top) + + def try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + + def item_type: -> Orb::Converter::input + + def initialize: ( + Hash[Symbol, top] + | ^-> Orb::Converter::input + | Orb::Converter::input type_info, + ?Hash[Symbol, top] spec + ) -> void + end + + class HashOf + include Orb::Converter + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def coerce: (Hash[top, top] | top value) -> (Hash[Symbol, top] | top) + + def dump: (Hash[top, top] | top value) -> (Hash[Symbol, top] | top) + + def try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + + def item_type: -> Orb::Converter::input + + def initialize: ( + Hash[Symbol, top] + | ^-> Orb::Converter::input + | Orb::Converter::input type_info, + ?Hash[Symbol, top] spec + ) -> void + end + + class BaseModel + extend Orb::Extern + extend Orb::Converter + + type known_field = { mode: (:coerce | :dump)?, required: bool } + + def self.known_fields: -> Hash[Symbol, (Orb::BaseModel::known_field + & { type_fn: (^-> Orb::Converter::input) })] + + def self.fields: -> Hash[Symbol, (Orb::BaseModel::known_field + & { type: Orb::Converter::input })] + + def self.defaults: -> Hash[Symbol, (^-> Class)] + + private def self.add_field: ( + Symbol name_sym, + required: bool, + type_info: { + const: (nil | bool | Integer | Float | Symbol)?, + enum: ^-> Orb::Converter::input?, + union: ^-> Orb::Converter::input?, + api_name: Symbol + } + | ^-> Orb::Converter::input + | Orb::Converter::input, + spec: Hash[Symbol, top] + ) -> void + + def self.required: ( + Symbol name_sym, + Hash[Symbol, top] + | ^-> Orb::Converter::input + | Orb::Converter::input type_info, + ?Hash[Symbol, top] spec + ) -> void + + def self.optional: ( + Symbol name_sym, + Hash[Symbol, top] + | ^-> Orb::Converter::input + | Orb::Converter::input type_info, + ?Hash[Symbol, top] spec + ) -> void + + private def self.request_only: { -> void } -> void + + private def self.response_only: { -> void } -> void + + def ==: (top other) -> bool + + def self.coerce: ( + Orb::BaseModel | Hash[top, top] | top value + ) -> (instance | top) + + def self.dump: (instance | top value) -> (Hash[top, top] | top) + + def self.try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + + def []: (Symbol key) -> top? + + def to_h: -> Hash[Symbol, top] + + alias to_hash to_h + + def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, top] + + def initialize: (?Hash[Symbol, top] | self data) -> void + + def to_s: -> String + + def inspect: -> String + end +end diff --git a/sig/orb/base_page.rbs b/sig/orb/base_page.rbs new file mode 100644 index 00000000..4e8fdc95 --- /dev/null +++ b/sig/orb/base_page.rbs @@ -0,0 +1,20 @@ +module Orb + module BasePage[Elem] + def next_page?: -> bool + + def next_page: -> self + + def auto_paging_each: { (Elem arg0) -> void } -> void + + def to_enum: -> Enumerable[Elem] + + alias enum_for to_enum + + def initialize: ( + client: Orb::BaseClient, + req: Orb::BaseClient::request, + headers: Hash[String, String], + unwrapped: top + ) -> void + end +end diff --git a/sig/orb/client.rbs b/sig/orb/client.rbs new file mode 100644 index 00000000..8d0115bf --- /dev/null +++ b/sig/orb/client.rbs @@ -0,0 +1,53 @@ +module Orb + class Client < Orb::BaseClient + DEFAULT_MAX_RETRIES: 2 + + DEFAULT_TIMEOUT_IN_SECONDS: Float + + DEFAULT_INITIAL_RETRY_DELAY: Float + + DEFAULT_MAX_RETRY_DELAY: Float + + attr_reader api_key: String + + attr_reader top_level: Orb::Resources::TopLevel + + attr_reader coupons: Orb::Resources::Coupons + + attr_reader credit_notes: Orb::Resources::CreditNotes + + attr_reader customers: Orb::Resources::Customers + + attr_reader events: Orb::Resources::Events + + attr_reader invoice_line_items: Orb::Resources::InvoiceLineItems + + attr_reader invoices: Orb::Resources::Invoices + + attr_reader items: Orb::Resources::Items + + attr_reader metrics: Orb::Resources::Metrics + + attr_reader plans: Orb::Resources::Plans + + attr_reader prices: Orb::Resources::Prices + + attr_reader subscriptions: Orb::Resources::Subscriptions + + attr_reader alerts: Orb::Resources::Alerts + + attr_reader dimensional_price_groups: Orb::Resources::DimensionalPriceGroups + + private def auth_headers: -> Hash[String, String] + + def initialize: ( + base_url: String?, + api_key: String?, + max_retries: Integer, + timeout: Float, + initial_retry_delay: Float, + max_retry_delay: Float, + idempotency_header: String + ) -> void + end +end diff --git a/sig/orb/errors.rbs b/sig/orb/errors.rbs new file mode 100644 index 00000000..eb8c9d65 --- /dev/null +++ b/sig/orb/errors.rbs @@ -0,0 +1,170 @@ +module Orb + class Error < StandardError + attr_reader cause: StandardError? + end + + class ConversionError < Orb::Error + end + + class APIError < Orb::Error + attr_reader url: URI::Generic + + attr_reader status: Integer? + + attr_reader body: top? + + def initialize: ( + url: URI::Generic, + status: Integer?, + body: Object?, + request: nil, + response: nil, + message: String? + ) -> void + end + + class APIConnectionError < Orb::APIError + def initialize: ( + url: URI::Generic, + status: nil, + body: nil, + request: nil, + response: nil, + message: String? + ) -> void + end + + class APITimeoutError < Orb::APIConnectionError + def initialize: ( + url: URI::Generic, + status: nil, + body: nil, + request: nil, + response: nil, + message: String? + ) -> void + end + + class APIStatusError < Orb::APIError + def self.for: ( + url: URI::Generic, + status: Integer, + body: Object?, + request: nil, + response: nil + ) -> instance + + def initialize: ( + url: URI::Generic, + status: Integer, + body: Object?, + request: nil, + response: nil, + message: String? + ) -> void + end + + class BadRequestError < Orb::APIStatusError + HTTP_STATUS: 400 + end + + class AuthenticationError < Orb::APIStatusError + HTTP_STATUS: 401 + end + + class PermissionDeniedError < Orb::APIStatusError + HTTP_STATUS: 403 + end + + class NotFoundError < Orb::APIStatusError + HTTP_STATUS: 404 + end + + class ConflictError < Orb::APIStatusError + HTTP_STATUS: 409 + end + + class UnprocessableEntityError < Orb::APIStatusError + HTTP_STATUS: 422 + end + + class RateLimitError < Orb::APIStatusError + HTTP_STATUS: 429 + end + + class InternalServerError < Orb::APIStatusError + HTTP_STATUS: Range[Integer] + end + + class ConstraintViolation < Orb::APIStatusError + HTTP_STATUS: 400 + + TYPE: "https://docs.withorb.com/reference/error-responses#400-constraint-violation" + end + + class DuplicateResourceCreation < Orb::APIStatusError + HTTP_STATUS: 400 + + TYPE: "https://docs.withorb.com/reference/error-responses#400-duplicate-resource-creation" + end + + class FeatureNotAvailable < Orb::APIStatusError + HTTP_STATUS: 400 + + TYPE: "https://docs.withorb.com/reference/error-responses#404-feature-not-available" + end + + class RequestValidationError < Orb::APIStatusError + HTTP_STATUS: 400 + + TYPE: "https://docs.withorb.com/reference/error-responses#400-request-validation-errors" + end + + class OrbAuthenticationError < Orb::APIStatusError + HTTP_STATUS: 401 + + TYPE: "https://docs.withorb.com/reference/error-responses#401-authentication-error" + end + + class ResourceNotFound < Orb::APIStatusError + HTTP_STATUS: 404 + + TYPE: "https://docs.withorb.com/reference/error-responses#404-resource-not-found" + end + + class URLNotFound < Orb::APIStatusError + HTTP_STATUS: 404 + + TYPE: "https://docs.withorb.com/reference/error-responses#404-url-not-found" + end + + class ResourceConflict < Orb::APIStatusError + HTTP_STATUS: 409 + + TYPE: "https://docs.withorb.com/reference/error-responses#409-resource-conflict" + end + + class RequestTooLarge < Orb::APIStatusError + HTTP_STATUS: 413 + + TYPE: "https://docs.withorb.com/reference/error-responses#413-request-too-large" + end + + class ResourceTooLarge < Orb::APIStatusError + HTTP_STATUS: 413 + + TYPE: "https://docs.withorb.com/reference/error-responses#413-resource-too-large" + end + + class TooManyRequests < Orb::APIStatusError + HTTP_STATUS: 429 + + TYPE: "https://docs.withorb.com/reference/error-responses#429-too-many-requests" + end + + class OrbInternalServerError < Orb::APIStatusError + HTTP_STATUS: 500 + + TYPE: "https://docs.withorb.com/reference/error-responses#500-internal-server-error" + end +end diff --git a/sig/orb/extern.rbs b/sig/orb/extern.rbs new file mode 100644 index 00000000..c4cb4e87 --- /dev/null +++ b/sig/orb/extern.rbs @@ -0,0 +1,5 @@ +module Orb + module Extern + def sorbet!: { -> void } -> void + end +end diff --git a/sig/orb/models/alert.rbs b/sig/orb/models/alert.rbs new file mode 100644 index 00000000..1c7b3992 --- /dev/null +++ b/sig/orb/models/alert.rbs @@ -0,0 +1,152 @@ +module Orb + module Models + type alert = + { + id: String, + created_at: Time, + currency: String?, + customer: Orb::Models::Alert::Customer?, + enabled: bool, + metric: Orb::Models::Alert::Metric?, + plan: Orb::Models::Alert::Plan?, + subscription: Orb::Models::Alert::Subscription?, + thresholds: Array[Orb::Models::Alert::Threshold]?, + type: Orb::Models::Alert::type_ + } + + class Alert < Orb::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor currency: String? + + attr_accessor customer: Orb::Models::Alert::Customer? + + attr_accessor enabled: bool + + attr_accessor metric: Orb::Models::Alert::Metric? + + attr_accessor plan: Orb::Models::Alert::Plan? + + attr_accessor subscription: Orb::Models::Alert::Subscription? + + attr_accessor thresholds: Array[Orb::Models::Alert::Threshold]? + + attr_accessor type: Orb::Models::Alert::type_ + + def initialize: + ( + id: String, + created_at: Time, + currency: String?, + customer: Orb::Models::Alert::Customer?, + enabled: bool, + metric: Orb::Models::Alert::Metric?, + plan: Orb::Models::Alert::Plan?, + subscription: Orb::Models::Alert::Subscription?, + thresholds: Array[Orb::Models::Alert::Threshold]?, + type: Orb::Models::Alert::type_ + ) -> void + | (?Orb::Models::alert | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::alert + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | (?Orb::Models::Alert::customer | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Alert::customer + end + + type metric = { id: String } + + class Metric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | (?Orb::Models::Alert::metric | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Alert::metric + end + + type plan = + { + id: String?, + external_plan_id: String?, + name: String?, + plan_version: String + } + + class Plan < Orb::BaseModel + attr_accessor id: String? + + attr_accessor external_plan_id: String? + + attr_accessor name: String? + + attr_accessor plan_version: String + + def initialize: + ( + id: String?, + external_plan_id: String?, + name: String?, + plan_version: String + ) -> void + | (?Orb::Models::Alert::plan | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Alert::plan + end + + type subscription = { id: String } + + class Subscription < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | (?Orb::Models::Alert::subscription | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Alert::subscription + end + + type threshold = { value: Float } + + class Threshold < Orb::BaseModel + attr_accessor value: Float + + def initialize: + (value: Float) -> void + | (?Orb::Models::Alert::threshold | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Alert::threshold + end + + type type_ = + :usage_exceeded + | :cost_exceeded + | :credit_balance_depleted + | :credit_balance_dropped + | :credit_balance_recovered + + class Type < Orb::Enum + USAGE_EXCEEDED: :usage_exceeded + COST_EXCEEDED: :cost_exceeded + CREDIT_BALANCE_DEPLETED: :credit_balance_depleted + CREDIT_BALANCE_DROPPED: :credit_balance_dropped + CREDIT_BALANCE_RECOVERED: :credit_balance_recovered + + def self.values: -> Array[Orb::Models::Alert::type_] + end + end + end +end diff --git a/sig/orb/models/alert_create_for_customer_params.rbs b/sig/orb/models/alert_create_for_customer_params.rbs new file mode 100644 index 00000000..279ff4b1 --- /dev/null +++ b/sig/orb/models/alert_create_for_customer_params.rbs @@ -0,0 +1,67 @@ +module Orb + module Models + type alert_create_for_customer_params = + { + currency: String, + type: Orb::Models::AlertCreateForCustomerParams::type_, + thresholds: Array[Orb::Models::AlertCreateForCustomerParams::Threshold]? + } + & Orb::request_parameters + + class AlertCreateForCustomerParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor currency: String + + attr_accessor type: Orb::Models::AlertCreateForCustomerParams::type_ + + attr_accessor thresholds: Array[Orb::Models::AlertCreateForCustomerParams::Threshold]? + + def initialize: + ( + currency: String, + type: Orb::Models::AlertCreateForCustomerParams::type_, + thresholds: Array[Orb::Models::AlertCreateForCustomerParams::Threshold]?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::alert_create_for_customer_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::alert_create_for_customer_params + + type type_ = + :usage_exceeded + | :cost_exceeded + | :credit_balance_depleted + | :credit_balance_dropped + | :credit_balance_recovered + + class Type < Orb::Enum + USAGE_EXCEEDED: :usage_exceeded + COST_EXCEEDED: :cost_exceeded + CREDIT_BALANCE_DEPLETED: :credit_balance_depleted + CREDIT_BALANCE_DROPPED: :credit_balance_dropped + CREDIT_BALANCE_RECOVERED: :credit_balance_recovered + + def self.values: -> Array[Orb::Models::AlertCreateForCustomerParams::type_] + end + + type threshold = { value: Float } + + class Threshold < Orb::BaseModel + attr_accessor value: Float + + def initialize: + (value: Float) -> void + | ( + ?Orb::Models::AlertCreateForCustomerParams::threshold + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::AlertCreateForCustomerParams::threshold + end + end + end +end diff --git a/sig/orb/models/alert_create_for_external_customer_params.rbs b/sig/orb/models/alert_create_for_external_customer_params.rbs new file mode 100644 index 00000000..e9c22a21 --- /dev/null +++ b/sig/orb/models/alert_create_for_external_customer_params.rbs @@ -0,0 +1,68 @@ +module Orb + module Models + type alert_create_for_external_customer_params = + { + currency: String, + type: Orb::Models::AlertCreateForExternalCustomerParams::type_, + thresholds: Array[Orb::Models::AlertCreateForExternalCustomerParams::Threshold]? + } + & Orb::request_parameters + + class AlertCreateForExternalCustomerParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor currency: String + + attr_accessor type: Orb::Models::AlertCreateForExternalCustomerParams::type_ + + attr_accessor thresholds: Array[Orb::Models::AlertCreateForExternalCustomerParams::Threshold]? + + def initialize: + ( + currency: String, + type: Orb::Models::AlertCreateForExternalCustomerParams::type_, + thresholds: Array[Orb::Models::AlertCreateForExternalCustomerParams::Threshold]?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::alert_create_for_external_customer_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::alert_create_for_external_customer_params + + type type_ = + :usage_exceeded + | :cost_exceeded + | :credit_balance_depleted + | :credit_balance_dropped + | :credit_balance_recovered + + class Type < Orb::Enum + USAGE_EXCEEDED: :usage_exceeded + COST_EXCEEDED: :cost_exceeded + CREDIT_BALANCE_DEPLETED: :credit_balance_depleted + CREDIT_BALANCE_DROPPED: :credit_balance_dropped + CREDIT_BALANCE_RECOVERED: :credit_balance_recovered + + def self.values: -> Array[Orb::Models::AlertCreateForExternalCustomerParams::type_] + end + + type threshold = { value: Float } + + class Threshold < Orb::BaseModel + attr_accessor value: Float + + def initialize: + (value: Float) -> void + | ( + ?Orb::Models::AlertCreateForExternalCustomerParams::threshold + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::AlertCreateForExternalCustomerParams::threshold + end + end + end +end diff --git a/sig/orb/models/alert_create_for_subscription_params.rbs b/sig/orb/models/alert_create_for_subscription_params.rbs new file mode 100644 index 00000000..25865cb6 --- /dev/null +++ b/sig/orb/models/alert_create_for_subscription_params.rbs @@ -0,0 +1,68 @@ +module Orb + module Models + type alert_create_for_subscription_params = + { + thresholds: Array[Orb::Models::AlertCreateForSubscriptionParams::Threshold], + type: Orb::Models::AlertCreateForSubscriptionParams::type_, + metric_id: String? + } + & Orb::request_parameters + + class AlertCreateForSubscriptionParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor thresholds: Array[Orb::Models::AlertCreateForSubscriptionParams::Threshold] + + attr_accessor type: Orb::Models::AlertCreateForSubscriptionParams::type_ + + attr_accessor metric_id: String? + + def initialize: + ( + thresholds: Array[Orb::Models::AlertCreateForSubscriptionParams::Threshold], + type: Orb::Models::AlertCreateForSubscriptionParams::type_, + metric_id: String?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::alert_create_for_subscription_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::alert_create_for_subscription_params + + type threshold = { value: Float } + + class Threshold < Orb::BaseModel + attr_accessor value: Float + + def initialize: + (value: Float) -> void + | ( + ?Orb::Models::AlertCreateForSubscriptionParams::threshold + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::AlertCreateForSubscriptionParams::threshold + end + + type type_ = + :usage_exceeded + | :cost_exceeded + | :credit_balance_depleted + | :credit_balance_dropped + | :credit_balance_recovered + + class Type < Orb::Enum + USAGE_EXCEEDED: :usage_exceeded + COST_EXCEEDED: :cost_exceeded + CREDIT_BALANCE_DEPLETED: :credit_balance_depleted + CREDIT_BALANCE_DROPPED: :credit_balance_dropped + CREDIT_BALANCE_RECOVERED: :credit_balance_recovered + + def self.values: -> Array[Orb::Models::AlertCreateForSubscriptionParams::type_] + end + end + end +end diff --git a/sig/orb/models/alert_disable_params.rbs b/sig/orb/models/alert_disable_params.rbs new file mode 100644 index 00000000..40a16aee --- /dev/null +++ b/sig/orb/models/alert_disable_params.rbs @@ -0,0 +1,19 @@ +module Orb + module Models + type alert_disable_params = + { subscription_id: String? } & Orb::request_parameters + + class AlertDisableParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor subscription_id: String? + + def initialize: + (subscription_id: String?, request_options: Orb::request_opts) -> void + | (?Orb::Models::alert_disable_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::alert_disable_params + end + end +end diff --git a/sig/orb/models/alert_enable_params.rbs b/sig/orb/models/alert_enable_params.rbs new file mode 100644 index 00000000..4294b3a1 --- /dev/null +++ b/sig/orb/models/alert_enable_params.rbs @@ -0,0 +1,19 @@ +module Orb + module Models + type alert_enable_params = + { subscription_id: String? } & Orb::request_parameters + + class AlertEnableParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor subscription_id: String? + + def initialize: + (subscription_id: String?, request_options: Orb::request_opts) -> void + | (?Orb::Models::alert_enable_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::alert_enable_params + end + end +end diff --git a/sig/orb/models/alert_list_params.rbs b/sig/orb/models/alert_list_params.rbs new file mode 100644 index 00000000..17b570df --- /dev/null +++ b/sig/orb/models/alert_list_params.rbs @@ -0,0 +1,59 @@ +module Orb + module Models + type alert_list_params = + { + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + cursor: String?, + customer_id: String?, + external_customer_id: String?, + limit: Integer, + subscription_id: String? + } + & Orb::request_parameters + + class AlertListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor created_at_gt: Time? + + attr_accessor created_at_gte: Time? + + attr_accessor created_at_lt: Time? + + attr_accessor created_at_lte: Time? + + attr_accessor cursor: String? + + attr_accessor customer_id: String? + + attr_accessor external_customer_id: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + attr_accessor subscription_id: String? + + def initialize: + ( + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + cursor: String?, + customer_id: String?, + external_customer_id: String?, + limit: Integer, + subscription_id: String?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::alert_list_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::alert_list_params + end + end +end diff --git a/sig/orb/models/alert_retrieve_params.rbs b/sig/orb/models/alert_retrieve_params.rbs new file mode 100644 index 00000000..fd3d4b53 --- /dev/null +++ b/sig/orb/models/alert_retrieve_params.rbs @@ -0,0 +1,16 @@ +module Orb + module Models + type alert_retrieve_params = { } & Orb::request_parameters + + class AlertRetrieveParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | (?Orb::Models::alert_retrieve_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::alert_retrieve_params + end + end +end diff --git a/sig/orb/models/alert_update_params.rbs b/sig/orb/models/alert_update_params.rbs new file mode 100644 index 00000000..49fdc843 --- /dev/null +++ b/sig/orb/models/alert_update_params.rbs @@ -0,0 +1,37 @@ +module Orb + module Models + type alert_update_params = + { thresholds: Array[Orb::Models::AlertUpdateParams::Threshold] } + & Orb::request_parameters + + class AlertUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor thresholds: Array[Orb::Models::AlertUpdateParams::Threshold] + + def initialize: + ( + thresholds: Array[Orb::Models::AlertUpdateParams::Threshold], + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::alert_update_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::alert_update_params + + type threshold = { value: Float } + + class Threshold < Orb::BaseModel + attr_accessor value: Float + + def initialize: + (value: Float) -> void + | ( + ?Orb::Models::AlertUpdateParams::threshold | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::AlertUpdateParams::threshold + end + end + end +end diff --git a/sig/orb/models/amount_discount.rbs b/sig/orb/models/amount_discount.rbs new file mode 100644 index 00000000..038cd858 --- /dev/null +++ b/sig/orb/models/amount_discount.rbs @@ -0,0 +1,40 @@ +module Orb + module Models + type amount_discount = + { + amount_discount: String, + applies_to_price_ids: Array[String], + discount_type: Orb::Models::AmountDiscount::discount_type, + reason: String? + } + + class AmountDiscount < Orb::BaseModel + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor discount_type: Orb::Models::AmountDiscount::discount_type + + attr_accessor reason: String? + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + discount_type: Orb::Models::AmountDiscount::discount_type, + reason: String? + ) -> void + | (?Orb::Models::amount_discount | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::amount_discount + + type discount_type = :amount + + class DiscountType < Orb::Enum + AMOUNT: :amount + + def self.values: -> Array[Orb::Models::AmountDiscount::discount_type] + end + end + end +end diff --git a/sig/orb/models/billable_metric.rbs b/sig/orb/models/billable_metric.rbs new file mode 100644 index 00000000..9457866a --- /dev/null +++ b/sig/orb/models/billable_metric.rbs @@ -0,0 +1,50 @@ +module Orb + module Models + type billable_metric = + { + id: String, + description: String?, + item: Orb::Models::Item, + metadata: Hash[Symbol, String], + name: String, + status: Orb::Models::BillableMetric::status + } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + attr_accessor description: String? + + attr_accessor item: Orb::Models::Item + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor name: String + + attr_accessor status: Orb::Models::BillableMetric::status + + def initialize: + ( + id: String, + description: String?, + item: Orb::Models::Item, + metadata: Hash[Symbol, String], + name: String, + status: Orb::Models::BillableMetric::status + ) -> void + | (?Orb::Models::billable_metric | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::billable_metric + + type status = :active | :draft | :archived + + class Status < Orb::Enum + ACTIVE: :active + DRAFT: :draft + ARCHIVED: :archived + + def self.values: -> Array[Orb::Models::BillableMetric::status] + end + end + end +end diff --git a/sig/orb/models/billing_cycle_relative_date.rbs b/sig/orb/models/billing_cycle_relative_date.rbs new file mode 100644 index 00000000..021915bd --- /dev/null +++ b/sig/orb/models/billing_cycle_relative_date.rbs @@ -0,0 +1,12 @@ +module Orb + module Models + type billing_cycle_relative_date = :start_of_term | :end_of_term + + class BillingCycleRelativeDate < Orb::Enum + START_OF_TERM: :start_of_term + END_OF_TERM: :end_of_term + + def self.values: -> Array[Orb::Models::billing_cycle_relative_date] + end + end +end diff --git a/sig/orb/models/coupon.rbs b/sig/orb/models/coupon.rbs new file mode 100644 index 00000000..dd7ad49e --- /dev/null +++ b/sig/orb/models/coupon.rbs @@ -0,0 +1,51 @@ +module Orb + module Models + type coupon = + { + id: String, + archived_at: Time?, + discount: Orb::Models::Coupon::discount, + duration_in_months: Integer?, + max_redemptions: Integer?, + redemption_code: String, + times_redeemed: Integer + } + + class Coupon < Orb::BaseModel + attr_accessor id: String + + attr_accessor archived_at: Time? + + attr_accessor discount: Orb::Models::Coupon::discount + + attr_accessor duration_in_months: Integer? + + attr_accessor max_redemptions: Integer? + + attr_accessor redemption_code: String + + attr_accessor times_redeemed: Integer + + def initialize: + ( + id: String, + archived_at: Time?, + discount: Orb::Models::Coupon::discount, + duration_in_months: Integer?, + max_redemptions: Integer?, + redemption_code: String, + times_redeemed: Integer + ) -> void + | (?Orb::Models::coupon | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::coupon + + type discount = + Orb::Models::PercentageDiscount | Orb::Models::AmountDiscount + + class Discount < Orb::Union + private def self.variants: -> [[:percentage, Orb::Models::PercentageDiscount], [:amount, Orb::Models::AmountDiscount]] + end + end + end +end diff --git a/sig/orb/models/coupon_archive_params.rbs b/sig/orb/models/coupon_archive_params.rbs new file mode 100644 index 00000000..de73af2b --- /dev/null +++ b/sig/orb/models/coupon_archive_params.rbs @@ -0,0 +1,16 @@ +module Orb + module Models + type coupon_archive_params = { } & Orb::request_parameters + + class CouponArchiveParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | (?Orb::Models::coupon_archive_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::coupon_archive_params + end + end +end diff --git a/sig/orb/models/coupon_create_params.rbs b/sig/orb/models/coupon_create_params.rbs new file mode 100644 index 00000000..73fa9fd8 --- /dev/null +++ b/sig/orb/models/coupon_create_params.rbs @@ -0,0 +1,81 @@ +module Orb + module Models + type coupon_create_params = + { + discount: Orb::Models::CouponCreateParams::discount, + redemption_code: String, + duration_in_months: Integer?, + max_redemptions: Integer? + } + & Orb::request_parameters + + class CouponCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor discount: Orb::Models::CouponCreateParams::discount + + attr_accessor redemption_code: String + + attr_accessor duration_in_months: Integer? + + attr_accessor max_redemptions: Integer? + + def initialize: + ( + discount: Orb::Models::CouponCreateParams::discount, + redemption_code: String, + duration_in_months: Integer?, + max_redemptions: Integer?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::coupon_create_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::coupon_create_params + + type discount = + Orb::Models::CouponCreateParams::Discount::NewCouponPercentageDiscount + | Orb::Models::CouponCreateParams::Discount::NewCouponAmountDiscount + + class Discount < Orb::Union + type new_coupon_percentage_discount = + { discount_type: :percentage, percentage_discount: Float } + + class NewCouponPercentageDiscount < Orb::BaseModel + attr_accessor discount_type: :percentage + + attr_accessor percentage_discount: Float + + def initialize: + (percentage_discount: Float, discount_type: :percentage) -> void + | ( + ?Orb::Models::CouponCreateParams::Discount::new_coupon_percentage_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CouponCreateParams::Discount::new_coupon_percentage_discount + end + + type new_coupon_amount_discount = + { amount_discount: String, discount_type: :amount } + + class NewCouponAmountDiscount < Orb::BaseModel + attr_accessor amount_discount: String + + attr_accessor discount_type: :amount + + def initialize: + (amount_discount: String, discount_type: :amount) -> void + | ( + ?Orb::Models::CouponCreateParams::Discount::new_coupon_amount_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CouponCreateParams::Discount::new_coupon_amount_discount + end + + private def self.variants: -> [[:percentage, Orb::Models::CouponCreateParams::Discount::NewCouponPercentageDiscount], [:amount, Orb::Models::CouponCreateParams::Discount::NewCouponAmountDiscount]] + end + end + end +end diff --git a/sig/orb/models/coupon_fetch_params.rbs b/sig/orb/models/coupon_fetch_params.rbs new file mode 100644 index 00000000..ffaf9bf1 --- /dev/null +++ b/sig/orb/models/coupon_fetch_params.rbs @@ -0,0 +1,16 @@ +module Orb + module Models + type coupon_fetch_params = { } & Orb::request_parameters + + class CouponFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | (?Orb::Models::coupon_fetch_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::coupon_fetch_params + end + end +end diff --git a/sig/orb/models/coupon_list_params.rbs b/sig/orb/models/coupon_list_params.rbs new file mode 100644 index 00000000..30e17b0c --- /dev/null +++ b/sig/orb/models/coupon_list_params.rbs @@ -0,0 +1,39 @@ +module Orb + module Models + type coupon_list_params = + { + cursor: String?, + limit: Integer, + redemption_code: String?, + show_archived: bool? + } + & Orb::request_parameters + + class CouponListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor cursor: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + attr_accessor redemption_code: String? + + attr_accessor show_archived: bool? + + def initialize: + ( + cursor: String?, + limit: Integer, + redemption_code: String?, + show_archived: bool?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::coupon_list_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::coupon_list_params + end + end +end diff --git a/sig/orb/models/coupons/subscription_list_params.rbs b/sig/orb/models/coupons/subscription_list_params.rbs new file mode 100644 index 00000000..d04455ae --- /dev/null +++ b/sig/orb/models/coupons/subscription_list_params.rbs @@ -0,0 +1,32 @@ +module Orb + module Models + module Coupons + type subscription_list_params = + { cursor: String?, limit: Integer } & Orb::request_parameters + + class SubscriptionListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor cursor: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + def initialize: + ( + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Coupons::subscription_list_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Coupons::subscription_list_params + end + end + end +end diff --git a/sig/orb/models/credit_note.rbs b/sig/orb/models/credit_note.rbs new file mode 100644 index 00000000..2872d424 --- /dev/null +++ b/sig/orb/models/credit_note.rbs @@ -0,0 +1,361 @@ +module Orb + module Models + type credit_note = + { + id: String, + created_at: Time, + credit_note_number: String, + credit_note_pdf: String?, + customer: Orb::Models::CreditNote::Customer, + invoice_id: String, + line_items: Array[Orb::Models::CreditNote::LineItem], + maximum_amount_adjustment: Orb::Models::CreditNote::MaximumAmountAdjustment?, + memo: String?, + minimum_amount_refunded: String?, + reason: Orb::Models::CreditNote::reason?, + subtotal: String, + total: String, + type: Orb::Models::CreditNote::type_, + voided_at: Time?, + discounts: Array[Orb::Models::CreditNote::Discount] + } + + class CreditNote < Orb::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor credit_note_number: String + + attr_accessor credit_note_pdf: String? + + attr_accessor customer: Orb::Models::CreditNote::Customer + + attr_accessor invoice_id: String + + attr_accessor line_items: Array[Orb::Models::CreditNote::LineItem] + + attr_accessor maximum_amount_adjustment: Orb::Models::CreditNote::MaximumAmountAdjustment? + + attr_accessor memo: String? + + attr_accessor minimum_amount_refunded: String? + + attr_accessor reason: Orb::Models::CreditNote::reason? + + attr_accessor subtotal: String + + attr_accessor total: String + + attr_accessor type: Orb::Models::CreditNote::type_ + + attr_accessor voided_at: Time? + + attr_reader discounts: Array[Orb::Models::CreditNote::Discount]? + + def discounts=: (Array[Orb::Models::CreditNote::Discount]) -> void + + def initialize: + ( + id: String, + created_at: Time, + credit_note_number: String, + credit_note_pdf: String?, + customer: Orb::Models::CreditNote::Customer, + invoice_id: String, + line_items: Array[Orb::Models::CreditNote::LineItem], + maximum_amount_adjustment: Orb::Models::CreditNote::MaximumAmountAdjustment?, + memo: String?, + minimum_amount_refunded: String?, + reason: Orb::Models::CreditNote::reason?, + subtotal: String, + total: String, + type: Orb::Models::CreditNote::type_, + voided_at: Time?, + discounts: Array[Orb::Models::CreditNote::Discount] + ) -> void + | (?Orb::Models::credit_note | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::credit_note + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | (?Orb::Models::CreditNote::customer | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::CreditNote::customer + end + + type line_item = + { + id: String, + amount: String, + name: String, + quantity: Float?, + subtotal: String, + tax_amounts: Array[Orb::Models::CreditNote::LineItem::TaxAmount], + discounts: Array[Orb::Models::CreditNote::LineItem::Discount] + } + + class LineItem < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: String + + attr_accessor name: String + + attr_accessor quantity: Float? + + attr_accessor subtotal: String + + attr_accessor tax_amounts: Array[Orb::Models::CreditNote::LineItem::TaxAmount] + + attr_reader discounts: Array[Orb::Models::CreditNote::LineItem::Discount]? + + def discounts=: ( + Array[Orb::Models::CreditNote::LineItem::Discount] + ) -> void + + def initialize: + ( + id: String, + amount: String, + name: String, + quantity: Float?, + subtotal: String, + tax_amounts: Array[Orb::Models::CreditNote::LineItem::TaxAmount], + discounts: Array[Orb::Models::CreditNote::LineItem::Discount] + ) -> void + | (?Orb::Models::CreditNote::line_item | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::CreditNote::line_item + + type tax_amount = + { + amount: String, + tax_rate_description: String, + tax_rate_percentage: String? + } + + class TaxAmount < Orb::BaseModel + attr_accessor amount: String + + attr_accessor tax_rate_description: String + + attr_accessor tax_rate_percentage: String? + + def initialize: + ( + amount: String, + tax_rate_description: String, + tax_rate_percentage: String? + ) -> void + | ( + ?Orb::Models::CreditNote::LineItem::tax_amount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CreditNote::LineItem::tax_amount + end + + type discount = + { + id: String, + amount_applied: String, + applies_to_price_ids: Array[String], + discount_type: Orb::Models::CreditNote::LineItem::Discount::discount_type, + percentage_discount: Float, + amount_discount: String?, + reason: String? + } + + class Discount < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount_applied: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor discount_type: Orb::Models::CreditNote::LineItem::Discount::discount_type + + attr_accessor percentage_discount: Float + + attr_accessor amount_discount: String? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + amount_applied: String, + applies_to_price_ids: Array[String], + discount_type: Orb::Models::CreditNote::LineItem::Discount::discount_type, + percentage_discount: Float, + amount_discount: String?, + reason: String? + ) -> void + | ( + ?Orb::Models::CreditNote::LineItem::discount | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CreditNote::LineItem::discount + + type discount_type = :percentage | :amount + + class DiscountType < Orb::Enum + PERCENTAGE: :percentage + AMOUNT: :amount + + def self.values: -> Array[Orb::Models::CreditNote::LineItem::Discount::discount_type] + end + end + end + + type maximum_amount_adjustment = + { + amount_applied: String, + discount_type: Orb::Models::CreditNote::MaximumAmountAdjustment::discount_type, + percentage_discount: Float, + applies_to_prices: Array[Orb::Models::CreditNote::MaximumAmountAdjustment::AppliesToPrice]?, + reason: String? + } + + class MaximumAmountAdjustment < Orb::BaseModel + attr_accessor amount_applied: String + + attr_accessor discount_type: Orb::Models::CreditNote::MaximumAmountAdjustment::discount_type + + attr_accessor percentage_discount: Float + + attr_accessor applies_to_prices: Array[Orb::Models::CreditNote::MaximumAmountAdjustment::AppliesToPrice]? + + attr_accessor reason: String? + + def initialize: + ( + amount_applied: String, + discount_type: Orb::Models::CreditNote::MaximumAmountAdjustment::discount_type, + percentage_discount: Float, + applies_to_prices: Array[Orb::Models::CreditNote::MaximumAmountAdjustment::AppliesToPrice]?, + reason: String? + ) -> void + | ( + ?Orb::Models::CreditNote::maximum_amount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CreditNote::maximum_amount_adjustment + + type discount_type = :percentage + + class DiscountType < Orb::Enum + PERCENTAGE: :percentage + + def self.values: -> Array[Orb::Models::CreditNote::MaximumAmountAdjustment::discount_type] + end + + type applies_to_price = { id: String, name: String } + + class AppliesToPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::CreditNote::MaximumAmountAdjustment::applies_to_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CreditNote::MaximumAmountAdjustment::applies_to_price + end + end + + type reason = + :Duplicate | :Fraudulent | :"Order change" | :"Product unsatisfactory" + + class Reason < Orb::Enum + DUPLICATE: :Duplicate + FRAUDULENT: :Fraudulent + ORDER_CHANGE: :"Order change" + PRODUCT_UNSATISFACTORY: :"Product unsatisfactory" + + def self.values: -> Array[Orb::Models::CreditNote::reason] + end + + type type_ = :refund | :adjustment + + class Type < Orb::Enum + REFUND: :refund + ADJUSTMENT: :adjustment + + def self.values: -> Array[Orb::Models::CreditNote::type_] + end + + type discount = + { + amount_applied: String, + discount_type: Orb::Models::CreditNote::Discount::discount_type, + percentage_discount: Float, + applies_to_prices: Array[Orb::Models::CreditNote::Discount::AppliesToPrice]?, + reason: String? + } + + class Discount < Orb::BaseModel + attr_accessor amount_applied: String + + attr_accessor discount_type: Orb::Models::CreditNote::Discount::discount_type + + attr_accessor percentage_discount: Float + + attr_accessor applies_to_prices: Array[Orb::Models::CreditNote::Discount::AppliesToPrice]? + + attr_accessor reason: String? + + def initialize: + ( + amount_applied: String, + discount_type: Orb::Models::CreditNote::Discount::discount_type, + percentage_discount: Float, + applies_to_prices: Array[Orb::Models::CreditNote::Discount::AppliesToPrice]?, + reason: String? + ) -> void + | (?Orb::Models::CreditNote::discount | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::CreditNote::discount + + type discount_type = :percentage + + class DiscountType < Orb::Enum + PERCENTAGE: :percentage + + def self.values: -> Array[Orb::Models::CreditNote::Discount::discount_type] + end + + type applies_to_price = { id: String, name: String } + + class AppliesToPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::CreditNote::Discount::applies_to_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CreditNote::Discount::applies_to_price + end + end + end + end +end diff --git a/sig/orb/models/credit_note_create_params.rbs b/sig/orb/models/credit_note_create_params.rbs new file mode 100644 index 00000000..c36d34b3 --- /dev/null +++ b/sig/orb/models/credit_note_create_params.rbs @@ -0,0 +1,64 @@ +module Orb + module Models + type credit_note_create_params = + { + line_items: Array[Orb::Models::CreditNoteCreateParams::LineItem], + memo: String?, + reason: Orb::Models::CreditNoteCreateParams::reason? + } + & Orb::request_parameters + + class CreditNoteCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor line_items: Array[Orb::Models::CreditNoteCreateParams::LineItem] + + attr_accessor memo: String? + + attr_accessor reason: Orb::Models::CreditNoteCreateParams::reason? + + def initialize: + ( + line_items: Array[Orb::Models::CreditNoteCreateParams::LineItem], + memo: String?, + reason: Orb::Models::CreditNoteCreateParams::reason?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::credit_note_create_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::credit_note_create_params + + type line_item = { amount: String, invoice_line_item_id: String } + + class LineItem < Orb::BaseModel + attr_accessor amount: String + + attr_accessor invoice_line_item_id: String + + def initialize: + (amount: String, invoice_line_item_id: String) -> void + | ( + ?Orb::Models::CreditNoteCreateParams::line_item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CreditNoteCreateParams::line_item + end + + type reason = + :duplicate | :fraudulent | :order_change | :product_unsatisfactory + + class Reason < Orb::Enum + DUPLICATE: :duplicate + FRAUDULENT: :fraudulent + ORDER_CHANGE: :order_change + PRODUCT_UNSATISFACTORY: :product_unsatisfactory + + def self.values: -> Array[Orb::Models::CreditNoteCreateParams::reason] + end + end + end +end diff --git a/sig/orb/models/credit_note_fetch_params.rbs b/sig/orb/models/credit_note_fetch_params.rbs new file mode 100644 index 00000000..2975331c --- /dev/null +++ b/sig/orb/models/credit_note_fetch_params.rbs @@ -0,0 +1,16 @@ +module Orb + module Models + type credit_note_fetch_params = { } & Orb::request_parameters + + class CreditNoteFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | (?Orb::Models::credit_note_fetch_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::credit_note_fetch_params + end + end +end diff --git a/sig/orb/models/credit_note_list_params.rbs b/sig/orb/models/credit_note_list_params.rbs new file mode 100644 index 00000000..5b0884bd --- /dev/null +++ b/sig/orb/models/credit_note_list_params.rbs @@ -0,0 +1,27 @@ +module Orb + module Models + type credit_note_list_params = + { cursor: String?, limit: Integer } & Orb::request_parameters + + class CreditNoteListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor cursor: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + def initialize: + ( + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::credit_note_list_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::credit_note_list_params + end + end +end diff --git a/sig/orb/models/customer.rbs b/sig/orb/models/customer.rbs new file mode 100644 index 00000000..6d2af84b --- /dev/null +++ b/sig/orb/models/customer.rbs @@ -0,0 +1,600 @@ +module Orb + module Models + type customer = + { + id: String, + additional_emails: Array[String], + auto_collection: bool, + balance: String, + billing_address: Orb::Models::Customer::BillingAddress?, + created_at: Time, + currency: String?, + email: String, + email_delivery: bool, + exempt_from_automated_tax: bool?, + external_customer_id: String?, + metadata: Hash[Symbol, String], + name: String, + payment_provider: Orb::Models::Customer::payment_provider?, + payment_provider_id: String?, + portal_url: String?, + shipping_address: Orb::Models::Customer::ShippingAddress?, + tax_id: Orb::Models::Customer::TaxID?, + timezone: String, + accounting_sync_configuration: Orb::Models::Customer::AccountingSyncConfiguration?, + reporting_configuration: Orb::Models::Customer::ReportingConfiguration? + } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor additional_emails: Array[String] + + attr_accessor auto_collection: bool + + attr_accessor balance: String + + attr_accessor billing_address: Orb::Models::Customer::BillingAddress? + + attr_accessor created_at: Time + + attr_accessor currency: String? + + attr_accessor email: String + + attr_accessor email_delivery: bool + + attr_accessor exempt_from_automated_tax: bool? + + attr_accessor external_customer_id: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor name: String + + attr_accessor payment_provider: Orb::Models::Customer::payment_provider? + + attr_accessor payment_provider_id: String? + + attr_accessor portal_url: String? + + attr_accessor shipping_address: Orb::Models::Customer::ShippingAddress? + + attr_accessor tax_id: Orb::Models::Customer::TaxID? + + attr_accessor timezone: String + + attr_accessor accounting_sync_configuration: Orb::Models::Customer::AccountingSyncConfiguration? + + attr_accessor reporting_configuration: Orb::Models::Customer::ReportingConfiguration? + + def initialize: + ( + id: String, + additional_emails: Array[String], + auto_collection: bool, + balance: String, + billing_address: Orb::Models::Customer::BillingAddress?, + created_at: Time, + currency: String?, + email: String, + email_delivery: bool, + exempt_from_automated_tax: bool?, + external_customer_id: String?, + metadata: Hash[Symbol, String], + name: String, + payment_provider: Orb::Models::Customer::payment_provider?, + payment_provider_id: String?, + portal_url: String?, + shipping_address: Orb::Models::Customer::ShippingAddress?, + tax_id: Orb::Models::Customer::TaxID?, + timezone: String, + accounting_sync_configuration: Orb::Models::Customer::AccountingSyncConfiguration?, + reporting_configuration: Orb::Models::Customer::ReportingConfiguration? + ) -> void + | (?Orb::Models::customer | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::customer + + type billing_address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + + class BillingAddress < Orb::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: + ( + city: String?, + country: String?, + line1: String?, + line2: String?, + postal_code: String?, + state: String? + ) -> void + | ( + ?Orb::Models::Customer::billing_address | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customer::billing_address + end + + type payment_provider = + :quickbooks | :"bill.com" | :stripe_charge | :stripe_invoice | :netsuite + + class PaymentProvider < Orb::Enum + QUICKBOOKS: :quickbooks + BILL_COM: :"bill.com" + STRIPE_CHARGE: :stripe_charge + STRIPE_INVOICE: :stripe_invoice + NETSUITE: :netsuite + + def self.values: -> Array[Orb::Models::Customer::payment_provider] + end + + type shipping_address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + + class ShippingAddress < Orb::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: + ( + city: String?, + country: String?, + line1: String?, + line2: String?, + postal_code: String?, + state: String? + ) -> void + | ( + ?Orb::Models::Customer::shipping_address | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customer::shipping_address + end + + type tax_id = + { + country: Orb::Models::Customer::TaxID::country, + type: Orb::Models::Customer::TaxID::type_, + value: String + } + + class TaxID < Orb::BaseModel + attr_accessor country: Orb::Models::Customer::TaxID::country + + attr_accessor type: Orb::Models::Customer::TaxID::type_ + + attr_accessor value: String + + def initialize: + ( + country: Orb::Models::Customer::TaxID::country, + type: Orb::Models::Customer::TaxID::type_, + value: String + ) -> void + | (?Orb::Models::Customer::tax_id | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Customer::tax_id + + type country = + :AD + | :AE + | :AR + | :AT + | :AU + | :BE + | :BG + | :BH + | :BO + | :BR + | :CA + | :CH + | :CL + | :CN + | :CO + | :CR + | :CY + | :CZ + | :DE + | :DK + | :EE + | :DO + | :EC + | :EG + | :ES + | :EU + | :FI + | :FR + | :GB + | :GE + | :GR + | :HK + | :HR + | :HU + | :ID + | :IE + | :IL + | :IN + | :IS + | :IT + | :JP + | :KE + | :KR + | :KZ + | :LI + | :LT + | :LU + | :LV + | :MT + | :MX + | :MY + | :NG + | :NL + | :NO + | :NZ + | :OM + | :PE + | :PH + | :PL + | :PT + | :RO + | :RS + | :RU + | :SA + | :SE + | :SG + | :SI + | :SK + | :SV + | :TH + | :TR + | :TW + | :UA + | :US + | :UY + | :VE + | :VN + | :ZA + + class Country < Orb::Enum + AD: :AD + AE: :AE + AR: :AR + AT: :AT + AU: :AU + BE: :BE + BG: :BG + BH: :BH + BO: :BO + BR: :BR + CA: :CA + CH: :CH + CL: :CL + CN: :CN + CO: :CO + CR: :CR + CY: :CY + CZ: :CZ + DE: :DE + DK: :DK + EE: :EE + DO: :DO + EC: :EC + EG: :EG + ES: :ES + EU: :EU + FI: :FI + FR: :FR + GB: :GB + GE: :GE + GR: :GR + HK: :HK + HR: :HR + HU: :HU + ID: :ID + IE: :IE + IL: :IL + IN: :IN + IS: :IS + IT: :IT + JP: :JP + KE: :KE + KR: :KR + KZ: :KZ + LI: :LI + LT: :LT + LU: :LU + LV: :LV + MT: :MT + MX: :MX + MY: :MY + NG: :NG + NL: :NL + NO: :NO + NZ: :NZ + OM: :OM + PE: :PE + PH: :PH + PL: :PL + PT: :PT + RO: :RO + RS: :RS + RU: :RU + SA: :SA + SE: :SE + SG: :SG + SI: :SI + SK: :SK + SV: :SV + TH: :TH + TR: :TR + TW: :TW + UA: :UA + US: :US + UY: :UY + VE: :VE + VN: :VN + ZA: :ZA + + def self.values: -> Array[Orb::Models::Customer::TaxID::country] + end + + type type_ = + :ad_nrt + | :ae_trn + | :ar_cuit + | :eu_vat + | :au_abn + | :au_arn + | :bg_uic + | :bh_vat + | :bo_tin + | :br_cnpj + | :br_cpf + | :ca_bn + | :ca_gst_hst + | :ca_pst_bc + | :ca_pst_mb + | :ca_pst_sk + | :ca_qst + | :ch_vat + | :cl_tin + | :cn_tin + | :co_nit + | :cr_tin + | :do_rcn + | :ec_ruc + | :eg_tin + | :es_cif + | :eu_oss_vat + | :gb_vat + | :ge_vat + | :hk_br + | :hu_tin + | :id_npwp + | :il_vat + | :in_gst + | :is_vat + | :jp_cn + | :jp_rn + | :jp_trn + | :ke_pin + | :kr_brn + | :kz_bin + | :li_uid + | :mx_rfc + | :my_frp + | :my_itn + | :my_sst + | :ng_tin + | :no_vat + | :no_voec + | :nz_gst + | :om_vat + | :pe_ruc + | :ph_tin + | :ro_tin + | :rs_pib + | :ru_inn + | :ru_kpp + | :sa_vat + | :sg_gst + | :sg_uen + | :si_tin + | :sv_nit + | :th_vat + | :tr_tin + | :tw_vat + | :ua_vat + | :us_ein + | :uy_ruc + | :ve_rif + | :vn_tin + | :za_vat + + class Type < Orb::Enum + AD_NRT: :ad_nrt + AE_TRN: :ae_trn + AR_CUIT: :ar_cuit + EU_VAT: :eu_vat + AU_ABN: :au_abn + AU_ARN: :au_arn + BG_UIC: :bg_uic + BH_VAT: :bh_vat + BO_TIN: :bo_tin + BR_CNPJ: :br_cnpj + BR_CPF: :br_cpf + CA_BN: :ca_bn + CA_GST_HST: :ca_gst_hst + CA_PST_BC: :ca_pst_bc + CA_PST_MB: :ca_pst_mb + CA_PST_SK: :ca_pst_sk + CA_QST: :ca_qst + CH_VAT: :ch_vat + CL_TIN: :cl_tin + CN_TIN: :cn_tin + CO_NIT: :co_nit + CR_TIN: :cr_tin + DO_RCN: :do_rcn + EC_RUC: :ec_ruc + EG_TIN: :eg_tin + ES_CIF: :es_cif + EU_OSS_VAT: :eu_oss_vat + GB_VAT: :gb_vat + GE_VAT: :ge_vat + HK_BR: :hk_br + HU_TIN: :hu_tin + ID_NPWP: :id_npwp + IL_VAT: :il_vat + IN_GST: :in_gst + IS_VAT: :is_vat + JP_CN: :jp_cn + JP_RN: :jp_rn + JP_TRN: :jp_trn + KE_PIN: :ke_pin + KR_BRN: :kr_brn + KZ_BIN: :kz_bin + LI_UID: :li_uid + MX_RFC: :mx_rfc + MY_FRP: :my_frp + MY_ITN: :my_itn + MY_SST: :my_sst + NG_TIN: :ng_tin + NO_VAT: :no_vat + NO_VOEC: :no_voec + NZ_GST: :nz_gst + OM_VAT: :om_vat + PE_RUC: :pe_ruc + PH_TIN: :ph_tin + RO_TIN: :ro_tin + RS_PIB: :rs_pib + RU_INN: :ru_inn + RU_KPP: :ru_kpp + SA_VAT: :sa_vat + SG_GST: :sg_gst + SG_UEN: :sg_uen + SI_TIN: :si_tin + SV_NIT: :sv_nit + TH_VAT: :th_vat + TR_TIN: :tr_tin + TW_VAT: :tw_vat + UA_VAT: :ua_vat + US_EIN: :us_ein + UY_RUC: :uy_ruc + VE_RIF: :ve_rif + VN_TIN: :vn_tin + ZA_VAT: :za_vat + + def self.values: -> Array[Orb::Models::Customer::TaxID::type_] + end + end + + type accounting_sync_configuration = + { + accounting_providers: Array[Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider], + excluded: bool + } + + class AccountingSyncConfiguration < Orb::BaseModel + attr_accessor accounting_providers: Array[Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider] + + attr_accessor excluded: bool + + def initialize: + ( + accounting_providers: Array[Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider], + excluded: bool + ) -> void + | ( + ?Orb::Models::Customer::accounting_sync_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customer::accounting_sync_configuration + + type accounting_provider = + { + external_provider_id: String?, + provider_type: Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider::provider_type + } + + class AccountingProvider < Orb::BaseModel + attr_accessor external_provider_id: String? + + attr_accessor provider_type: Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider::provider_type + + def initialize: + ( + external_provider_id: String?, + provider_type: Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider::provider_type + ) -> void + | ( + ?Orb::Models::Customer::AccountingSyncConfiguration::accounting_provider + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customer::AccountingSyncConfiguration::accounting_provider + + type provider_type = :quickbooks | :netsuite + + class ProviderType < Orb::Enum + QUICKBOOKS: :quickbooks + NETSUITE: :netsuite + + def self.values: -> Array[Orb::Models::Customer::AccountingSyncConfiguration::AccountingProvider::provider_type] + end + end + end + + type reporting_configuration = { exempt: bool } + + class ReportingConfiguration < Orb::BaseModel + attr_accessor exempt: bool + + def initialize: + (exempt: bool) -> void + | ( + ?Orb::Models::Customer::reporting_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customer::reporting_configuration + end + end + end +end diff --git a/sig/orb/models/customer_create_params.rbs b/sig/orb/models/customer_create_params.rbs new file mode 100644 index 00000000..c4bfd531 --- /dev/null +++ b/sig/orb/models/customer_create_params.rbs @@ -0,0 +1,632 @@ +module Orb + module Models + type customer_create_params = + { + email: String, + name: String, + accounting_sync_configuration: Orb::Models::CustomerCreateParams::AccountingSyncConfiguration?, + additional_emails: Array[String]?, + auto_collection: bool?, + billing_address: Orb::Models::CustomerCreateParams::BillingAddress?, + currency: String?, + email_delivery: bool?, + external_customer_id: String?, + metadata: Hash[Symbol, String?]?, + payment_provider: Orb::Models::CustomerCreateParams::payment_provider?, + payment_provider_id: String?, + reporting_configuration: Orb::Models::CustomerCreateParams::ReportingConfiguration?, + shipping_address: Orb::Models::CustomerCreateParams::ShippingAddress?, + tax_configuration: Orb::Models::CustomerCreateParams::tax_configuration?, + tax_id: Orb::Models::CustomerCreateParams::TaxID?, + timezone: String? + } + & Orb::request_parameters + + class CustomerCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor email: String + + attr_accessor name: String + + attr_accessor accounting_sync_configuration: Orb::Models::CustomerCreateParams::AccountingSyncConfiguration? + + attr_accessor additional_emails: Array[String]? + + attr_accessor auto_collection: bool? + + attr_accessor billing_address: Orb::Models::CustomerCreateParams::BillingAddress? + + attr_accessor currency: String? + + attr_accessor email_delivery: bool? + + attr_accessor external_customer_id: String? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor payment_provider: Orb::Models::CustomerCreateParams::payment_provider? + + attr_accessor payment_provider_id: String? + + attr_accessor reporting_configuration: Orb::Models::CustomerCreateParams::ReportingConfiguration? + + attr_accessor shipping_address: Orb::Models::CustomerCreateParams::ShippingAddress? + + attr_accessor tax_configuration: Orb::Models::CustomerCreateParams::tax_configuration? + + attr_accessor tax_id: Orb::Models::CustomerCreateParams::TaxID? + + attr_accessor timezone: String? + + def initialize: + ( + email: String, + name: String, + accounting_sync_configuration: Orb::Models::CustomerCreateParams::AccountingSyncConfiguration?, + additional_emails: Array[String]?, + auto_collection: bool?, + billing_address: Orb::Models::CustomerCreateParams::BillingAddress?, + currency: String?, + email_delivery: bool?, + external_customer_id: String?, + metadata: Hash[Symbol, String?]?, + payment_provider: Orb::Models::CustomerCreateParams::payment_provider?, + payment_provider_id: String?, + reporting_configuration: Orb::Models::CustomerCreateParams::ReportingConfiguration?, + shipping_address: Orb::Models::CustomerCreateParams::ShippingAddress?, + tax_configuration: Orb::Models::CustomerCreateParams::tax_configuration?, + tax_id: Orb::Models::CustomerCreateParams::TaxID?, + timezone: String?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::customer_create_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::customer_create_params + + type accounting_sync_configuration = + { + accounting_providers: Array[Orb::Models::CustomerCreateParams::AccountingSyncConfiguration::AccountingProvider]?, + excluded: bool? + } + + class AccountingSyncConfiguration < Orb::BaseModel + attr_accessor accounting_providers: Array[Orb::Models::CustomerCreateParams::AccountingSyncConfiguration::AccountingProvider]? + + attr_accessor excluded: bool? + + def initialize: + ( + accounting_providers: Array[Orb::Models::CustomerCreateParams::AccountingSyncConfiguration::AccountingProvider]?, + excluded: bool? + ) -> void + | ( + ?Orb::Models::CustomerCreateParams::accounting_sync_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerCreateParams::accounting_sync_configuration + + type accounting_provider = + { external_provider_id: String, provider_type: String } + + class AccountingProvider < Orb::BaseModel + attr_accessor external_provider_id: String + + attr_accessor provider_type: String + + def initialize: + (external_provider_id: String, provider_type: String) -> void + | ( + ?Orb::Models::CustomerCreateParams::AccountingSyncConfiguration::accounting_provider + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerCreateParams::AccountingSyncConfiguration::accounting_provider + end + end + + type billing_address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + + class BillingAddress < Orb::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: + ( + city: String?, + country: String?, + line1: String?, + line2: String?, + postal_code: String?, + state: String? + ) -> void + | ( + ?Orb::Models::CustomerCreateParams::billing_address + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerCreateParams::billing_address + end + + type payment_provider = + :quickbooks | :"bill.com" | :stripe_charge | :stripe_invoice | :netsuite + + class PaymentProvider < Orb::Enum + QUICKBOOKS: :quickbooks + BILL_COM: :"bill.com" + STRIPE_CHARGE: :stripe_charge + STRIPE_INVOICE: :stripe_invoice + NETSUITE: :netsuite + + def self.values: -> Array[Orb::Models::CustomerCreateParams::payment_provider] + end + + type reporting_configuration = { exempt: bool } + + class ReportingConfiguration < Orb::BaseModel + attr_accessor exempt: bool + + def initialize: + (exempt: bool) -> void + | ( + ?Orb::Models::CustomerCreateParams::reporting_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerCreateParams::reporting_configuration + end + + type shipping_address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + + class ShippingAddress < Orb::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: + ( + city: String?, + country: String?, + line1: String?, + line2: String?, + postal_code: String?, + state: String? + ) -> void + | ( + ?Orb::Models::CustomerCreateParams::shipping_address + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerCreateParams::shipping_address + end + + type tax_configuration = + Orb::Models::CustomerCreateParams::TaxConfiguration::NewAvalaraTaxConfiguration + | Orb::Models::CustomerCreateParams::TaxConfiguration::NewTaxJarConfiguration + + class TaxConfiguration < Orb::Union + type new_avalara_tax_configuration = + { + tax_exempt: bool, + tax_provider: :avalara, + tax_exemption_code: String? + } + + class NewAvalaraTaxConfiguration < Orb::BaseModel + attr_accessor tax_exempt: bool + + attr_accessor tax_provider: :avalara + + attr_accessor tax_exemption_code: String? + + def initialize: + ( + tax_exempt: bool, + tax_exemption_code: String?, + tax_provider: :avalara + ) -> void + | ( + ?Orb::Models::CustomerCreateParams::TaxConfiguration::new_avalara_tax_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerCreateParams::TaxConfiguration::new_avalara_tax_configuration + end + + type new_tax_jar_configuration = + { tax_exempt: bool, tax_provider: :taxjar } + + class NewTaxJarConfiguration < Orb::BaseModel + attr_accessor tax_exempt: bool + + attr_accessor tax_provider: :taxjar + + def initialize: + (tax_exempt: bool, tax_provider: :taxjar) -> void + | ( + ?Orb::Models::CustomerCreateParams::TaxConfiguration::new_tax_jar_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerCreateParams::TaxConfiguration::new_tax_jar_configuration + end + + private def self.variants: -> [[:avalara, Orb::Models::CustomerCreateParams::TaxConfiguration::NewAvalaraTaxConfiguration], [:taxjar, Orb::Models::CustomerCreateParams::TaxConfiguration::NewTaxJarConfiguration]] + end + + type tax_id = + { + country: Orb::Models::CustomerCreateParams::TaxID::country, + type: Orb::Models::CustomerCreateParams::TaxID::type_, + value: String + } + + class TaxID < Orb::BaseModel + attr_accessor country: Orb::Models::CustomerCreateParams::TaxID::country + + attr_accessor type: Orb::Models::CustomerCreateParams::TaxID::type_ + + attr_accessor value: String + + def initialize: + ( + country: Orb::Models::CustomerCreateParams::TaxID::country, + type: Orb::Models::CustomerCreateParams::TaxID::type_, + value: String + ) -> void + | ( + ?Orb::Models::CustomerCreateParams::tax_id | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerCreateParams::tax_id + + type country = + :AD + | :AE + | :AR + | :AT + | :AU + | :BE + | :BG + | :BH + | :BO + | :BR + | :CA + | :CH + | :CL + | :CN + | :CO + | :CR + | :CY + | :CZ + | :DE + | :DK + | :EE + | :DO + | :EC + | :EG + | :ES + | :EU + | :FI + | :FR + | :GB + | :GE + | :GR + | :HK + | :HR + | :HU + | :ID + | :IE + | :IL + | :IN + | :IS + | :IT + | :JP + | :KE + | :KR + | :KZ + | :LI + | :LT + | :LU + | :LV + | :MT + | :MX + | :MY + | :NG + | :NL + | :NO + | :NZ + | :OM + | :PE + | :PH + | :PL + | :PT + | :RO + | :RS + | :RU + | :SA + | :SE + | :SG + | :SI + | :SK + | :SV + | :TH + | :TR + | :TW + | :UA + | :US + | :UY + | :VE + | :VN + | :ZA + + class Country < Orb::Enum + AD: :AD + AE: :AE + AR: :AR + AT: :AT + AU: :AU + BE: :BE + BG: :BG + BH: :BH + BO: :BO + BR: :BR + CA: :CA + CH: :CH + CL: :CL + CN: :CN + CO: :CO + CR: :CR + CY: :CY + CZ: :CZ + DE: :DE + DK: :DK + EE: :EE + DO: :DO + EC: :EC + EG: :EG + ES: :ES + EU: :EU + FI: :FI + FR: :FR + GB: :GB + GE: :GE + GR: :GR + HK: :HK + HR: :HR + HU: :HU + ID: :ID + IE: :IE + IL: :IL + IN: :IN + IS: :IS + IT: :IT + JP: :JP + KE: :KE + KR: :KR + KZ: :KZ + LI: :LI + LT: :LT + LU: :LU + LV: :LV + MT: :MT + MX: :MX + MY: :MY + NG: :NG + NL: :NL + NO: :NO + NZ: :NZ + OM: :OM + PE: :PE + PH: :PH + PL: :PL + PT: :PT + RO: :RO + RS: :RS + RU: :RU + SA: :SA + SE: :SE + SG: :SG + SI: :SI + SK: :SK + SV: :SV + TH: :TH + TR: :TR + TW: :TW + UA: :UA + US: :US + UY: :UY + VE: :VE + VN: :VN + ZA: :ZA + + def self.values: -> Array[Orb::Models::CustomerCreateParams::TaxID::country] + end + + type type_ = + :ad_nrt + | :ae_trn + | :ar_cuit + | :eu_vat + | :au_abn + | :au_arn + | :bg_uic + | :bh_vat + | :bo_tin + | :br_cnpj + | :br_cpf + | :ca_bn + | :ca_gst_hst + | :ca_pst_bc + | :ca_pst_mb + | :ca_pst_sk + | :ca_qst + | :ch_vat + | :cl_tin + | :cn_tin + | :co_nit + | :cr_tin + | :do_rcn + | :ec_ruc + | :eg_tin + | :es_cif + | :eu_oss_vat + | :gb_vat + | :ge_vat + | :hk_br + | :hu_tin + | :id_npwp + | :il_vat + | :in_gst + | :is_vat + | :jp_cn + | :jp_rn + | :jp_trn + | :ke_pin + | :kr_brn + | :kz_bin + | :li_uid + | :mx_rfc + | :my_frp + | :my_itn + | :my_sst + | :ng_tin + | :no_vat + | :no_voec + | :nz_gst + | :om_vat + | :pe_ruc + | :ph_tin + | :ro_tin + | :rs_pib + | :ru_inn + | :ru_kpp + | :sa_vat + | :sg_gst + | :sg_uen + | :si_tin + | :sv_nit + | :th_vat + | :tr_tin + | :tw_vat + | :ua_vat + | :us_ein + | :uy_ruc + | :ve_rif + | :vn_tin + | :za_vat + + class Type < Orb::Enum + AD_NRT: :ad_nrt + AE_TRN: :ae_trn + AR_CUIT: :ar_cuit + EU_VAT: :eu_vat + AU_ABN: :au_abn + AU_ARN: :au_arn + BG_UIC: :bg_uic + BH_VAT: :bh_vat + BO_TIN: :bo_tin + BR_CNPJ: :br_cnpj + BR_CPF: :br_cpf + CA_BN: :ca_bn + CA_GST_HST: :ca_gst_hst + CA_PST_BC: :ca_pst_bc + CA_PST_MB: :ca_pst_mb + CA_PST_SK: :ca_pst_sk + CA_QST: :ca_qst + CH_VAT: :ch_vat + CL_TIN: :cl_tin + CN_TIN: :cn_tin + CO_NIT: :co_nit + CR_TIN: :cr_tin + DO_RCN: :do_rcn + EC_RUC: :ec_ruc + EG_TIN: :eg_tin + ES_CIF: :es_cif + EU_OSS_VAT: :eu_oss_vat + GB_VAT: :gb_vat + GE_VAT: :ge_vat + HK_BR: :hk_br + HU_TIN: :hu_tin + ID_NPWP: :id_npwp + IL_VAT: :il_vat + IN_GST: :in_gst + IS_VAT: :is_vat + JP_CN: :jp_cn + JP_RN: :jp_rn + JP_TRN: :jp_trn + KE_PIN: :ke_pin + KR_BRN: :kr_brn + KZ_BIN: :kz_bin + LI_UID: :li_uid + MX_RFC: :mx_rfc + MY_FRP: :my_frp + MY_ITN: :my_itn + MY_SST: :my_sst + NG_TIN: :ng_tin + NO_VAT: :no_vat + NO_VOEC: :no_voec + NZ_GST: :nz_gst + OM_VAT: :om_vat + PE_RUC: :pe_ruc + PH_TIN: :ph_tin + RO_TIN: :ro_tin + RS_PIB: :rs_pib + RU_INN: :ru_inn + RU_KPP: :ru_kpp + SA_VAT: :sa_vat + SG_GST: :sg_gst + SG_UEN: :sg_uen + SI_TIN: :si_tin + SV_NIT: :sv_nit + TH_VAT: :th_vat + TR_TIN: :tr_tin + TW_VAT: :tw_vat + UA_VAT: :ua_vat + US_EIN: :us_ein + UY_RUC: :uy_ruc + VE_RIF: :ve_rif + VN_TIN: :vn_tin + ZA_VAT: :za_vat + + def self.values: -> Array[Orb::Models::CustomerCreateParams::TaxID::type_] + end + end + end + end +end diff --git a/sig/orb/models/customer_delete_params.rbs b/sig/orb/models/customer_delete_params.rbs new file mode 100644 index 00000000..a919e759 --- /dev/null +++ b/sig/orb/models/customer_delete_params.rbs @@ -0,0 +1,16 @@ +module Orb + module Models + type customer_delete_params = { } & Orb::request_parameters + + class CustomerDeleteParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | (?Orb::Models::customer_delete_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::customer_delete_params + end + end +end diff --git a/sig/orb/models/customer_fetch_by_external_id_params.rbs b/sig/orb/models/customer_fetch_by_external_id_params.rbs new file mode 100644 index 00000000..aa50b39f --- /dev/null +++ b/sig/orb/models/customer_fetch_by_external_id_params.rbs @@ -0,0 +1,19 @@ +module Orb + module Models + type customer_fetch_by_external_id_params = { } & Orb::request_parameters + + class CustomerFetchByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::customer_fetch_by_external_id_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::customer_fetch_by_external_id_params + end + end +end diff --git a/sig/orb/models/customer_fetch_params.rbs b/sig/orb/models/customer_fetch_params.rbs new file mode 100644 index 00000000..ca91b695 --- /dev/null +++ b/sig/orb/models/customer_fetch_params.rbs @@ -0,0 +1,16 @@ +module Orb + module Models + type customer_fetch_params = { } & Orb::request_parameters + + class CustomerFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | (?Orb::Models::customer_fetch_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::customer_fetch_params + end + end +end diff --git a/sig/orb/models/customer_list_params.rbs b/sig/orb/models/customer_list_params.rbs new file mode 100644 index 00000000..727d7de4 --- /dev/null +++ b/sig/orb/models/customer_list_params.rbs @@ -0,0 +1,47 @@ +module Orb + module Models + type customer_list_params = + { + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + cursor: String?, + limit: Integer + } + & Orb::request_parameters + + class CustomerListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor created_at_gt: Time? + + attr_accessor created_at_gte: Time? + + attr_accessor created_at_lt: Time? + + attr_accessor created_at_lte: Time? + + attr_accessor cursor: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + def initialize: + ( + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::customer_list_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::customer_list_params + end + end +end diff --git a/sig/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbs b/sig/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbs new file mode 100644 index 00000000..0647fc4e --- /dev/null +++ b/sig/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbs @@ -0,0 +1,20 @@ +module Orb + module Models + type customer_sync_payment_methods_from_gateway_by_external_customer_id_params = + { } & Orb::request_parameters + + class CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::customer_sync_payment_methods_from_gateway_by_external_customer_id_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::customer_sync_payment_methods_from_gateway_by_external_customer_id_params + end + end +end diff --git a/sig/orb/models/customer_sync_payment_methods_from_gateway_params.rbs b/sig/orb/models/customer_sync_payment_methods_from_gateway_params.rbs new file mode 100644 index 00000000..fe1e54f9 --- /dev/null +++ b/sig/orb/models/customer_sync_payment_methods_from_gateway_params.rbs @@ -0,0 +1,20 @@ +module Orb + module Models + type customer_sync_payment_methods_from_gateway_params = + { } & Orb::request_parameters + + class CustomerSyncPaymentMethodsFromGatewayParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::customer_sync_payment_methods_from_gateway_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::customer_sync_payment_methods_from_gateway_params + end + end +end diff --git a/sig/orb/models/customer_update_by_external_id_params.rbs b/sig/orb/models/customer_update_by_external_id_params.rbs new file mode 100644 index 00000000..9f0a5ab4 --- /dev/null +++ b/sig/orb/models/customer_update_by_external_id_params.rbs @@ -0,0 +1,632 @@ +module Orb + module Models + type customer_update_by_external_id_params = + { + accounting_sync_configuration: Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration?, + additional_emails: Array[String]?, + auto_collection: bool?, + billing_address: Orb::Models::CustomerUpdateByExternalIDParams::BillingAddress?, + currency: String?, + email: String?, + email_delivery: bool?, + external_customer_id: String?, + metadata: Hash[Symbol, String?]?, + name: String?, + payment_provider: Orb::Models::CustomerUpdateByExternalIDParams::payment_provider?, + payment_provider_id: String?, + reporting_configuration: Orb::Models::CustomerUpdateByExternalIDParams::ReportingConfiguration?, + shipping_address: Orb::Models::CustomerUpdateByExternalIDParams::ShippingAddress?, + tax_configuration: Orb::Models::CustomerUpdateByExternalIDParams::tax_configuration?, + tax_id: Orb::Models::CustomerUpdateByExternalIDParams::TaxID? + } + & Orb::request_parameters + + class CustomerUpdateByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor accounting_sync_configuration: Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration? + + attr_accessor additional_emails: Array[String]? + + attr_accessor auto_collection: bool? + + attr_accessor billing_address: Orb::Models::CustomerUpdateByExternalIDParams::BillingAddress? + + attr_accessor currency: String? + + attr_accessor email: String? + + attr_accessor email_delivery: bool? + + attr_accessor external_customer_id: String? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor name: String? + + attr_accessor payment_provider: Orb::Models::CustomerUpdateByExternalIDParams::payment_provider? + + attr_accessor payment_provider_id: String? + + attr_accessor reporting_configuration: Orb::Models::CustomerUpdateByExternalIDParams::ReportingConfiguration? + + attr_accessor shipping_address: Orb::Models::CustomerUpdateByExternalIDParams::ShippingAddress? + + attr_accessor tax_configuration: Orb::Models::CustomerUpdateByExternalIDParams::tax_configuration? + + attr_accessor tax_id: Orb::Models::CustomerUpdateByExternalIDParams::TaxID? + + def initialize: + ( + accounting_sync_configuration: Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration?, + additional_emails: Array[String]?, + auto_collection: bool?, + billing_address: Orb::Models::CustomerUpdateByExternalIDParams::BillingAddress?, + currency: String?, + email: String?, + email_delivery: bool?, + external_customer_id: String?, + metadata: Hash[Symbol, String?]?, + name: String?, + payment_provider: Orb::Models::CustomerUpdateByExternalIDParams::payment_provider?, + payment_provider_id: String?, + reporting_configuration: Orb::Models::CustomerUpdateByExternalIDParams::ReportingConfiguration?, + shipping_address: Orb::Models::CustomerUpdateByExternalIDParams::ShippingAddress?, + tax_configuration: Orb::Models::CustomerUpdateByExternalIDParams::tax_configuration?, + tax_id: Orb::Models::CustomerUpdateByExternalIDParams::TaxID?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::customer_update_by_external_id_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::customer_update_by_external_id_params + + type accounting_sync_configuration = + { + accounting_providers: Array[Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration::AccountingProvider]?, + excluded: bool? + } + + class AccountingSyncConfiguration < Orb::BaseModel + attr_accessor accounting_providers: Array[Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration::AccountingProvider]? + + attr_accessor excluded: bool? + + def initialize: + ( + accounting_providers: Array[Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration::AccountingProvider]?, + excluded: bool? + ) -> void + | ( + ?Orb::Models::CustomerUpdateByExternalIDParams::accounting_sync_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerUpdateByExternalIDParams::accounting_sync_configuration + + type accounting_provider = + { external_provider_id: String, provider_type: String } + + class AccountingProvider < Orb::BaseModel + attr_accessor external_provider_id: String + + attr_accessor provider_type: String + + def initialize: + (external_provider_id: String, provider_type: String) -> void + | ( + ?Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration::accounting_provider + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration::accounting_provider + end + end + + type billing_address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + + class BillingAddress < Orb::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: + ( + city: String?, + country: String?, + line1: String?, + line2: String?, + postal_code: String?, + state: String? + ) -> void + | ( + ?Orb::Models::CustomerUpdateByExternalIDParams::billing_address + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerUpdateByExternalIDParams::billing_address + end + + type payment_provider = + :quickbooks | :"bill.com" | :stripe_charge | :stripe_invoice | :netsuite + + class PaymentProvider < Orb::Enum + QUICKBOOKS: :quickbooks + BILL_COM: :"bill.com" + STRIPE_CHARGE: :stripe_charge + STRIPE_INVOICE: :stripe_invoice + NETSUITE: :netsuite + + def self.values: -> Array[Orb::Models::CustomerUpdateByExternalIDParams::payment_provider] + end + + type reporting_configuration = { exempt: bool } + + class ReportingConfiguration < Orb::BaseModel + attr_accessor exempt: bool + + def initialize: + (exempt: bool) -> void + | ( + ?Orb::Models::CustomerUpdateByExternalIDParams::reporting_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerUpdateByExternalIDParams::reporting_configuration + end + + type shipping_address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + + class ShippingAddress < Orb::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: + ( + city: String?, + country: String?, + line1: String?, + line2: String?, + postal_code: String?, + state: String? + ) -> void + | ( + ?Orb::Models::CustomerUpdateByExternalIDParams::shipping_address + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerUpdateByExternalIDParams::shipping_address + end + + type tax_configuration = + Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewAvalaraTaxConfiguration + | Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewTaxJarConfiguration + + class TaxConfiguration < Orb::Union + type new_avalara_tax_configuration = + { + tax_exempt: bool, + tax_provider: :avalara, + tax_exemption_code: String? + } + + class NewAvalaraTaxConfiguration < Orb::BaseModel + attr_accessor tax_exempt: bool + + attr_accessor tax_provider: :avalara + + attr_accessor tax_exemption_code: String? + + def initialize: + ( + tax_exempt: bool, + tax_exemption_code: String?, + tax_provider: :avalara + ) -> void + | ( + ?Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::new_avalara_tax_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::new_avalara_tax_configuration + end + + type new_tax_jar_configuration = + { tax_exempt: bool, tax_provider: :taxjar } + + class NewTaxJarConfiguration < Orb::BaseModel + attr_accessor tax_exempt: bool + + attr_accessor tax_provider: :taxjar + + def initialize: + (tax_exempt: bool, tax_provider: :taxjar) -> void + | ( + ?Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::new_tax_jar_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::new_tax_jar_configuration + end + + private def self.variants: -> [[:avalara, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewAvalaraTaxConfiguration], [:taxjar, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::NewTaxJarConfiguration]] + end + + type tax_id = + { + country: Orb::Models::CustomerUpdateByExternalIDParams::TaxID::country, + type: Orb::Models::CustomerUpdateByExternalIDParams::TaxID::type_, + value: String + } + + class TaxID < Orb::BaseModel + attr_accessor country: Orb::Models::CustomerUpdateByExternalIDParams::TaxID::country + + attr_accessor type: Orb::Models::CustomerUpdateByExternalIDParams::TaxID::type_ + + attr_accessor value: String + + def initialize: + ( + country: Orb::Models::CustomerUpdateByExternalIDParams::TaxID::country, + type: Orb::Models::CustomerUpdateByExternalIDParams::TaxID::type_, + value: String + ) -> void + | ( + ?Orb::Models::CustomerUpdateByExternalIDParams::tax_id + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerUpdateByExternalIDParams::tax_id + + type country = + :AD + | :AE + | :AR + | :AT + | :AU + | :BE + | :BG + | :BH + | :BO + | :BR + | :CA + | :CH + | :CL + | :CN + | :CO + | :CR + | :CY + | :CZ + | :DE + | :DK + | :EE + | :DO + | :EC + | :EG + | :ES + | :EU + | :FI + | :FR + | :GB + | :GE + | :GR + | :HK + | :HR + | :HU + | :ID + | :IE + | :IL + | :IN + | :IS + | :IT + | :JP + | :KE + | :KR + | :KZ + | :LI + | :LT + | :LU + | :LV + | :MT + | :MX + | :MY + | :NG + | :NL + | :NO + | :NZ + | :OM + | :PE + | :PH + | :PL + | :PT + | :RO + | :RS + | :RU + | :SA + | :SE + | :SG + | :SI + | :SK + | :SV + | :TH + | :TR + | :TW + | :UA + | :US + | :UY + | :VE + | :VN + | :ZA + + class Country < Orb::Enum + AD: :AD + AE: :AE + AR: :AR + AT: :AT + AU: :AU + BE: :BE + BG: :BG + BH: :BH + BO: :BO + BR: :BR + CA: :CA + CH: :CH + CL: :CL + CN: :CN + CO: :CO + CR: :CR + CY: :CY + CZ: :CZ + DE: :DE + DK: :DK + EE: :EE + DO: :DO + EC: :EC + EG: :EG + ES: :ES + EU: :EU + FI: :FI + FR: :FR + GB: :GB + GE: :GE + GR: :GR + HK: :HK + HR: :HR + HU: :HU + ID: :ID + IE: :IE + IL: :IL + IN: :IN + IS: :IS + IT: :IT + JP: :JP + KE: :KE + KR: :KR + KZ: :KZ + LI: :LI + LT: :LT + LU: :LU + LV: :LV + MT: :MT + MX: :MX + MY: :MY + NG: :NG + NL: :NL + NO: :NO + NZ: :NZ + OM: :OM + PE: :PE + PH: :PH + PL: :PL + PT: :PT + RO: :RO + RS: :RS + RU: :RU + SA: :SA + SE: :SE + SG: :SG + SI: :SI + SK: :SK + SV: :SV + TH: :TH + TR: :TR + TW: :TW + UA: :UA + US: :US + UY: :UY + VE: :VE + VN: :VN + ZA: :ZA + + def self.values: -> Array[Orb::Models::CustomerUpdateByExternalIDParams::TaxID::country] + end + + type type_ = + :ad_nrt + | :ae_trn + | :ar_cuit + | :eu_vat + | :au_abn + | :au_arn + | :bg_uic + | :bh_vat + | :bo_tin + | :br_cnpj + | :br_cpf + | :ca_bn + | :ca_gst_hst + | :ca_pst_bc + | :ca_pst_mb + | :ca_pst_sk + | :ca_qst + | :ch_vat + | :cl_tin + | :cn_tin + | :co_nit + | :cr_tin + | :do_rcn + | :ec_ruc + | :eg_tin + | :es_cif + | :eu_oss_vat + | :gb_vat + | :ge_vat + | :hk_br + | :hu_tin + | :id_npwp + | :il_vat + | :in_gst + | :is_vat + | :jp_cn + | :jp_rn + | :jp_trn + | :ke_pin + | :kr_brn + | :kz_bin + | :li_uid + | :mx_rfc + | :my_frp + | :my_itn + | :my_sst + | :ng_tin + | :no_vat + | :no_voec + | :nz_gst + | :om_vat + | :pe_ruc + | :ph_tin + | :ro_tin + | :rs_pib + | :ru_inn + | :ru_kpp + | :sa_vat + | :sg_gst + | :sg_uen + | :si_tin + | :sv_nit + | :th_vat + | :tr_tin + | :tw_vat + | :ua_vat + | :us_ein + | :uy_ruc + | :ve_rif + | :vn_tin + | :za_vat + + class Type < Orb::Enum + AD_NRT: :ad_nrt + AE_TRN: :ae_trn + AR_CUIT: :ar_cuit + EU_VAT: :eu_vat + AU_ABN: :au_abn + AU_ARN: :au_arn + BG_UIC: :bg_uic + BH_VAT: :bh_vat + BO_TIN: :bo_tin + BR_CNPJ: :br_cnpj + BR_CPF: :br_cpf + CA_BN: :ca_bn + CA_GST_HST: :ca_gst_hst + CA_PST_BC: :ca_pst_bc + CA_PST_MB: :ca_pst_mb + CA_PST_SK: :ca_pst_sk + CA_QST: :ca_qst + CH_VAT: :ch_vat + CL_TIN: :cl_tin + CN_TIN: :cn_tin + CO_NIT: :co_nit + CR_TIN: :cr_tin + DO_RCN: :do_rcn + EC_RUC: :ec_ruc + EG_TIN: :eg_tin + ES_CIF: :es_cif + EU_OSS_VAT: :eu_oss_vat + GB_VAT: :gb_vat + GE_VAT: :ge_vat + HK_BR: :hk_br + HU_TIN: :hu_tin + ID_NPWP: :id_npwp + IL_VAT: :il_vat + IN_GST: :in_gst + IS_VAT: :is_vat + JP_CN: :jp_cn + JP_RN: :jp_rn + JP_TRN: :jp_trn + KE_PIN: :ke_pin + KR_BRN: :kr_brn + KZ_BIN: :kz_bin + LI_UID: :li_uid + MX_RFC: :mx_rfc + MY_FRP: :my_frp + MY_ITN: :my_itn + MY_SST: :my_sst + NG_TIN: :ng_tin + NO_VAT: :no_vat + NO_VOEC: :no_voec + NZ_GST: :nz_gst + OM_VAT: :om_vat + PE_RUC: :pe_ruc + PH_TIN: :ph_tin + RO_TIN: :ro_tin + RS_PIB: :rs_pib + RU_INN: :ru_inn + RU_KPP: :ru_kpp + SA_VAT: :sa_vat + SG_GST: :sg_gst + SG_UEN: :sg_uen + SI_TIN: :si_tin + SV_NIT: :sv_nit + TH_VAT: :th_vat + TR_TIN: :tr_tin + TW_VAT: :tw_vat + UA_VAT: :ua_vat + US_EIN: :us_ein + UY_RUC: :uy_ruc + VE_RIF: :ve_rif + VN_TIN: :vn_tin + ZA_VAT: :za_vat + + def self.values: -> Array[Orb::Models::CustomerUpdateByExternalIDParams::TaxID::type_] + end + end + end + end +end diff --git a/sig/orb/models/customer_update_params.rbs b/sig/orb/models/customer_update_params.rbs new file mode 100644 index 00000000..86438f98 --- /dev/null +++ b/sig/orb/models/customer_update_params.rbs @@ -0,0 +1,628 @@ +module Orb + module Models + type customer_update_params = + { + accounting_sync_configuration: Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration?, + additional_emails: Array[String]?, + auto_collection: bool?, + billing_address: Orb::Models::CustomerUpdateParams::BillingAddress?, + currency: String?, + email: String?, + email_delivery: bool?, + external_customer_id: String?, + metadata: Hash[Symbol, String?]?, + name: String?, + payment_provider: Orb::Models::CustomerUpdateParams::payment_provider?, + payment_provider_id: String?, + reporting_configuration: Orb::Models::CustomerUpdateParams::ReportingConfiguration?, + shipping_address: Orb::Models::CustomerUpdateParams::ShippingAddress?, + tax_configuration: Orb::Models::CustomerUpdateParams::tax_configuration?, + tax_id: Orb::Models::CustomerUpdateParams::TaxID? + } + & Orb::request_parameters + + class CustomerUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor accounting_sync_configuration: Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration? + + attr_accessor additional_emails: Array[String]? + + attr_accessor auto_collection: bool? + + attr_accessor billing_address: Orb::Models::CustomerUpdateParams::BillingAddress? + + attr_accessor currency: String? + + attr_accessor email: String? + + attr_accessor email_delivery: bool? + + attr_accessor external_customer_id: String? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor name: String? + + attr_accessor payment_provider: Orb::Models::CustomerUpdateParams::payment_provider? + + attr_accessor payment_provider_id: String? + + attr_accessor reporting_configuration: Orb::Models::CustomerUpdateParams::ReportingConfiguration? + + attr_accessor shipping_address: Orb::Models::CustomerUpdateParams::ShippingAddress? + + attr_accessor tax_configuration: Orb::Models::CustomerUpdateParams::tax_configuration? + + attr_accessor tax_id: Orb::Models::CustomerUpdateParams::TaxID? + + def initialize: + ( + accounting_sync_configuration: Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration?, + additional_emails: Array[String]?, + auto_collection: bool?, + billing_address: Orb::Models::CustomerUpdateParams::BillingAddress?, + currency: String?, + email: String?, + email_delivery: bool?, + external_customer_id: String?, + metadata: Hash[Symbol, String?]?, + name: String?, + payment_provider: Orb::Models::CustomerUpdateParams::payment_provider?, + payment_provider_id: String?, + reporting_configuration: Orb::Models::CustomerUpdateParams::ReportingConfiguration?, + shipping_address: Orb::Models::CustomerUpdateParams::ShippingAddress?, + tax_configuration: Orb::Models::CustomerUpdateParams::tax_configuration?, + tax_id: Orb::Models::CustomerUpdateParams::TaxID?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::customer_update_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::customer_update_params + + type accounting_sync_configuration = + { + accounting_providers: Array[Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration::AccountingProvider]?, + excluded: bool? + } + + class AccountingSyncConfiguration < Orb::BaseModel + attr_accessor accounting_providers: Array[Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration::AccountingProvider]? + + attr_accessor excluded: bool? + + def initialize: + ( + accounting_providers: Array[Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration::AccountingProvider]?, + excluded: bool? + ) -> void + | ( + ?Orb::Models::CustomerUpdateParams::accounting_sync_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerUpdateParams::accounting_sync_configuration + + type accounting_provider = + { external_provider_id: String, provider_type: String } + + class AccountingProvider < Orb::BaseModel + attr_accessor external_provider_id: String + + attr_accessor provider_type: String + + def initialize: + (external_provider_id: String, provider_type: String) -> void + | ( + ?Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration::accounting_provider + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration::accounting_provider + end + end + + type billing_address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + + class BillingAddress < Orb::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: + ( + city: String?, + country: String?, + line1: String?, + line2: String?, + postal_code: String?, + state: String? + ) -> void + | ( + ?Orb::Models::CustomerUpdateParams::billing_address + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerUpdateParams::billing_address + end + + type payment_provider = + :quickbooks | :"bill.com" | :stripe_charge | :stripe_invoice | :netsuite + + class PaymentProvider < Orb::Enum + QUICKBOOKS: :quickbooks + BILL_COM: :"bill.com" + STRIPE_CHARGE: :stripe_charge + STRIPE_INVOICE: :stripe_invoice + NETSUITE: :netsuite + + def self.values: -> Array[Orb::Models::CustomerUpdateParams::payment_provider] + end + + type reporting_configuration = { exempt: bool } + + class ReportingConfiguration < Orb::BaseModel + attr_accessor exempt: bool + + def initialize: + (exempt: bool) -> void + | ( + ?Orb::Models::CustomerUpdateParams::reporting_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerUpdateParams::reporting_configuration + end + + type shipping_address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + + class ShippingAddress < Orb::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: + ( + city: String?, + country: String?, + line1: String?, + line2: String?, + postal_code: String?, + state: String? + ) -> void + | ( + ?Orb::Models::CustomerUpdateParams::shipping_address + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerUpdateParams::shipping_address + end + + type tax_configuration = + Orb::Models::CustomerUpdateParams::TaxConfiguration::NewAvalaraTaxConfiguration + | Orb::Models::CustomerUpdateParams::TaxConfiguration::NewTaxJarConfiguration + + class TaxConfiguration < Orb::Union + type new_avalara_tax_configuration = + { + tax_exempt: bool, + tax_provider: :avalara, + tax_exemption_code: String? + } + + class NewAvalaraTaxConfiguration < Orb::BaseModel + attr_accessor tax_exempt: bool + + attr_accessor tax_provider: :avalara + + attr_accessor tax_exemption_code: String? + + def initialize: + ( + tax_exempt: bool, + tax_exemption_code: String?, + tax_provider: :avalara + ) -> void + | ( + ?Orb::Models::CustomerUpdateParams::TaxConfiguration::new_avalara_tax_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerUpdateParams::TaxConfiguration::new_avalara_tax_configuration + end + + type new_tax_jar_configuration = + { tax_exempt: bool, tax_provider: :taxjar } + + class NewTaxJarConfiguration < Orb::BaseModel + attr_accessor tax_exempt: bool + + attr_accessor tax_provider: :taxjar + + def initialize: + (tax_exempt: bool, tax_provider: :taxjar) -> void + | ( + ?Orb::Models::CustomerUpdateParams::TaxConfiguration::new_tax_jar_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerUpdateParams::TaxConfiguration::new_tax_jar_configuration + end + + private def self.variants: -> [[:avalara, Orb::Models::CustomerUpdateParams::TaxConfiguration::NewAvalaraTaxConfiguration], [:taxjar, Orb::Models::CustomerUpdateParams::TaxConfiguration::NewTaxJarConfiguration]] + end + + type tax_id = + { + country: Orb::Models::CustomerUpdateParams::TaxID::country, + type: Orb::Models::CustomerUpdateParams::TaxID::type_, + value: String + } + + class TaxID < Orb::BaseModel + attr_accessor country: Orb::Models::CustomerUpdateParams::TaxID::country + + attr_accessor type: Orb::Models::CustomerUpdateParams::TaxID::type_ + + attr_accessor value: String + + def initialize: + ( + country: Orb::Models::CustomerUpdateParams::TaxID::country, + type: Orb::Models::CustomerUpdateParams::TaxID::type_, + value: String + ) -> void + | ( + ?Orb::Models::CustomerUpdateParams::tax_id | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::CustomerUpdateParams::tax_id + + type country = + :AD + | :AE + | :AR + | :AT + | :AU + | :BE + | :BG + | :BH + | :BO + | :BR + | :CA + | :CH + | :CL + | :CN + | :CO + | :CR + | :CY + | :CZ + | :DE + | :DK + | :EE + | :DO + | :EC + | :EG + | :ES + | :EU + | :FI + | :FR + | :GB + | :GE + | :GR + | :HK + | :HR + | :HU + | :ID + | :IE + | :IL + | :IN + | :IS + | :IT + | :JP + | :KE + | :KR + | :KZ + | :LI + | :LT + | :LU + | :LV + | :MT + | :MX + | :MY + | :NG + | :NL + | :NO + | :NZ + | :OM + | :PE + | :PH + | :PL + | :PT + | :RO + | :RS + | :RU + | :SA + | :SE + | :SG + | :SI + | :SK + | :SV + | :TH + | :TR + | :TW + | :UA + | :US + | :UY + | :VE + | :VN + | :ZA + + class Country < Orb::Enum + AD: :AD + AE: :AE + AR: :AR + AT: :AT + AU: :AU + BE: :BE + BG: :BG + BH: :BH + BO: :BO + BR: :BR + CA: :CA + CH: :CH + CL: :CL + CN: :CN + CO: :CO + CR: :CR + CY: :CY + CZ: :CZ + DE: :DE + DK: :DK + EE: :EE + DO: :DO + EC: :EC + EG: :EG + ES: :ES + EU: :EU + FI: :FI + FR: :FR + GB: :GB + GE: :GE + GR: :GR + HK: :HK + HR: :HR + HU: :HU + ID: :ID + IE: :IE + IL: :IL + IN: :IN + IS: :IS + IT: :IT + JP: :JP + KE: :KE + KR: :KR + KZ: :KZ + LI: :LI + LT: :LT + LU: :LU + LV: :LV + MT: :MT + MX: :MX + MY: :MY + NG: :NG + NL: :NL + NO: :NO + NZ: :NZ + OM: :OM + PE: :PE + PH: :PH + PL: :PL + PT: :PT + RO: :RO + RS: :RS + RU: :RU + SA: :SA + SE: :SE + SG: :SG + SI: :SI + SK: :SK + SV: :SV + TH: :TH + TR: :TR + TW: :TW + UA: :UA + US: :US + UY: :UY + VE: :VE + VN: :VN + ZA: :ZA + + def self.values: -> Array[Orb::Models::CustomerUpdateParams::TaxID::country] + end + + type type_ = + :ad_nrt + | :ae_trn + | :ar_cuit + | :eu_vat + | :au_abn + | :au_arn + | :bg_uic + | :bh_vat + | :bo_tin + | :br_cnpj + | :br_cpf + | :ca_bn + | :ca_gst_hst + | :ca_pst_bc + | :ca_pst_mb + | :ca_pst_sk + | :ca_qst + | :ch_vat + | :cl_tin + | :cn_tin + | :co_nit + | :cr_tin + | :do_rcn + | :ec_ruc + | :eg_tin + | :es_cif + | :eu_oss_vat + | :gb_vat + | :ge_vat + | :hk_br + | :hu_tin + | :id_npwp + | :il_vat + | :in_gst + | :is_vat + | :jp_cn + | :jp_rn + | :jp_trn + | :ke_pin + | :kr_brn + | :kz_bin + | :li_uid + | :mx_rfc + | :my_frp + | :my_itn + | :my_sst + | :ng_tin + | :no_vat + | :no_voec + | :nz_gst + | :om_vat + | :pe_ruc + | :ph_tin + | :ro_tin + | :rs_pib + | :ru_inn + | :ru_kpp + | :sa_vat + | :sg_gst + | :sg_uen + | :si_tin + | :sv_nit + | :th_vat + | :tr_tin + | :tw_vat + | :ua_vat + | :us_ein + | :uy_ruc + | :ve_rif + | :vn_tin + | :za_vat + + class Type < Orb::Enum + AD_NRT: :ad_nrt + AE_TRN: :ae_trn + AR_CUIT: :ar_cuit + EU_VAT: :eu_vat + AU_ABN: :au_abn + AU_ARN: :au_arn + BG_UIC: :bg_uic + BH_VAT: :bh_vat + BO_TIN: :bo_tin + BR_CNPJ: :br_cnpj + BR_CPF: :br_cpf + CA_BN: :ca_bn + CA_GST_HST: :ca_gst_hst + CA_PST_BC: :ca_pst_bc + CA_PST_MB: :ca_pst_mb + CA_PST_SK: :ca_pst_sk + CA_QST: :ca_qst + CH_VAT: :ch_vat + CL_TIN: :cl_tin + CN_TIN: :cn_tin + CO_NIT: :co_nit + CR_TIN: :cr_tin + DO_RCN: :do_rcn + EC_RUC: :ec_ruc + EG_TIN: :eg_tin + ES_CIF: :es_cif + EU_OSS_VAT: :eu_oss_vat + GB_VAT: :gb_vat + GE_VAT: :ge_vat + HK_BR: :hk_br + HU_TIN: :hu_tin + ID_NPWP: :id_npwp + IL_VAT: :il_vat + IN_GST: :in_gst + IS_VAT: :is_vat + JP_CN: :jp_cn + JP_RN: :jp_rn + JP_TRN: :jp_trn + KE_PIN: :ke_pin + KR_BRN: :kr_brn + KZ_BIN: :kz_bin + LI_UID: :li_uid + MX_RFC: :mx_rfc + MY_FRP: :my_frp + MY_ITN: :my_itn + MY_SST: :my_sst + NG_TIN: :ng_tin + NO_VAT: :no_vat + NO_VOEC: :no_voec + NZ_GST: :nz_gst + OM_VAT: :om_vat + PE_RUC: :pe_ruc + PH_TIN: :ph_tin + RO_TIN: :ro_tin + RS_PIB: :rs_pib + RU_INN: :ru_inn + RU_KPP: :ru_kpp + SA_VAT: :sa_vat + SG_GST: :sg_gst + SG_UEN: :sg_uen + SI_TIN: :si_tin + SV_NIT: :sv_nit + TH_VAT: :th_vat + TR_TIN: :tr_tin + TW_VAT: :tw_vat + UA_VAT: :ua_vat + US_EIN: :us_ein + UY_RUC: :uy_ruc + VE_RIF: :ve_rif + VN_TIN: :vn_tin + ZA_VAT: :za_vat + + def self.values: -> Array[Orb::Models::CustomerUpdateParams::TaxID::type_] + end + end + end + end +end diff --git a/sig/orb/models/customers/balance_transaction_create_params.rbs b/sig/orb/models/customers/balance_transaction_create_params.rbs new file mode 100644 index 00000000..fedb2f6b --- /dev/null +++ b/sig/orb/models/customers/balance_transaction_create_params.rbs @@ -0,0 +1,47 @@ +module Orb + module Models + module Customers + type balance_transaction_create_params = + { + amount: String, + type: Orb::Models::Customers::BalanceTransactionCreateParams::type_, + description: String? + } + & Orb::request_parameters + + class BalanceTransactionCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor amount: String + + attr_accessor type: Orb::Models::Customers::BalanceTransactionCreateParams::type_ + + attr_accessor description: String? + + def initialize: + ( + amount: String, + type: Orb::Models::Customers::BalanceTransactionCreateParams::type_, + description: String?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Customers::balance_transaction_create_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::balance_transaction_create_params + + type type_ = :increment | :decrement + + class Type < Orb::Enum + INCREMENT: :increment + DECREMENT: :decrement + + def self.values: -> Array[Orb::Models::Customers::BalanceTransactionCreateParams::type_] + end + end + end + end +end diff --git a/sig/orb/models/customers/balance_transaction_create_response.rbs b/sig/orb/models/customers/balance_transaction_create_response.rbs new file mode 100644 index 00000000..7f24d7b6 --- /dev/null +++ b/sig/orb/models/customers/balance_transaction_create_response.rbs @@ -0,0 +1,123 @@ +module Orb + module Models + module Customers + type balance_transaction_create_response = + { + id: String, + action: Orb::Models::Customers::BalanceTransactionCreateResponse::action, + amount: String, + created_at: Time, + credit_note: Orb::Models::Customers::BalanceTransactionCreateResponse::CreditNote?, + description: String?, + ending_balance: String, + invoice: Orb::Models::Customers::BalanceTransactionCreateResponse::Invoice?, + starting_balance: String, + type: Orb::Models::Customers::BalanceTransactionCreateResponse::type_ + } + + class BalanceTransactionCreateResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor action: Orb::Models::Customers::BalanceTransactionCreateResponse::action + + attr_accessor amount: String + + attr_accessor created_at: Time + + attr_accessor credit_note: Orb::Models::Customers::BalanceTransactionCreateResponse::CreditNote? + + attr_accessor description: String? + + attr_accessor ending_balance: String + + attr_accessor invoice: Orb::Models::Customers::BalanceTransactionCreateResponse::Invoice? + + attr_accessor starting_balance: String + + attr_accessor type: Orb::Models::Customers::BalanceTransactionCreateResponse::type_ + + def initialize: + ( + id: String, + action: Orb::Models::Customers::BalanceTransactionCreateResponse::action, + amount: String, + created_at: Time, + credit_note: Orb::Models::Customers::BalanceTransactionCreateResponse::CreditNote?, + description: String?, + ending_balance: String, + invoice: Orb::Models::Customers::BalanceTransactionCreateResponse::Invoice?, + starting_balance: String, + type: Orb::Models::Customers::BalanceTransactionCreateResponse::type_ + ) -> void + | ( + ?Orb::Models::Customers::balance_transaction_create_response + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::balance_transaction_create_response + + type action = + :applied_to_invoice + | :manual_adjustment + | :prorated_refund + | :revert_prorated_refund + | :return_from_voiding + | :credit_note_applied + | :credit_note_voided + | :overpayment_refund + + class Action < Orb::Enum + APPLIED_TO_INVOICE: :applied_to_invoice + MANUAL_ADJUSTMENT: :manual_adjustment + PRORATED_REFUND: :prorated_refund + REVERT_PRORATED_REFUND: :revert_prorated_refund + RETURN_FROM_VOIDING: :return_from_voiding + CREDIT_NOTE_APPLIED: :credit_note_applied + CREDIT_NOTE_VOIDED: :credit_note_voided + OVERPAYMENT_REFUND: :overpayment_refund + + def self.values: -> Array[Orb::Models::Customers::BalanceTransactionCreateResponse::action] + end + + type credit_note = { id: String } + + class CreditNote < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Customers::BalanceTransactionCreateResponse::credit_note + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::BalanceTransactionCreateResponse::credit_note + end + + type invoice = { id: String } + + class Invoice < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Customers::BalanceTransactionCreateResponse::invoice + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::BalanceTransactionCreateResponse::invoice + end + + type type_ = :increment | :decrement + + class Type < Orb::Enum + INCREMENT: :increment + DECREMENT: :decrement + + def self.values: -> Array[Orb::Models::Customers::BalanceTransactionCreateResponse::type_] + end + end + end + end +end diff --git a/sig/orb/models/customers/balance_transaction_list_params.rbs b/sig/orb/models/customers/balance_transaction_list_params.rbs new file mode 100644 index 00000000..8efe8de8 --- /dev/null +++ b/sig/orb/models/customers/balance_transaction_list_params.rbs @@ -0,0 +1,52 @@ +module Orb + module Models + module Customers + type balance_transaction_list_params = + { + cursor: String?, + limit: Integer, + operation_time_gt: Time?, + operation_time_gte: Time?, + operation_time_lt: Time?, + operation_time_lte: Time? + } + & Orb::request_parameters + + class BalanceTransactionListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor cursor: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + attr_accessor operation_time_gt: Time? + + attr_accessor operation_time_gte: Time? + + attr_accessor operation_time_lt: Time? + + attr_accessor operation_time_lte: Time? + + def initialize: + ( + cursor: String?, + limit: Integer, + operation_time_gt: Time?, + operation_time_gte: Time?, + operation_time_lt: Time?, + operation_time_lte: Time?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Customers::balance_transaction_list_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::balance_transaction_list_params + end + end + end +end diff --git a/sig/orb/models/customers/balance_transaction_list_response.rbs b/sig/orb/models/customers/balance_transaction_list_response.rbs new file mode 100644 index 00000000..3c182cb8 --- /dev/null +++ b/sig/orb/models/customers/balance_transaction_list_response.rbs @@ -0,0 +1,123 @@ +module Orb + module Models + module Customers + type balance_transaction_list_response = + { + id: String, + action: Orb::Models::Customers::BalanceTransactionListResponse::action, + amount: String, + created_at: Time, + credit_note: Orb::Models::Customers::BalanceTransactionListResponse::CreditNote?, + description: String?, + ending_balance: String, + invoice: Orb::Models::Customers::BalanceTransactionListResponse::Invoice?, + starting_balance: String, + type: Orb::Models::Customers::BalanceTransactionListResponse::type_ + } + + class BalanceTransactionListResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor action: Orb::Models::Customers::BalanceTransactionListResponse::action + + attr_accessor amount: String + + attr_accessor created_at: Time + + attr_accessor credit_note: Orb::Models::Customers::BalanceTransactionListResponse::CreditNote? + + attr_accessor description: String? + + attr_accessor ending_balance: String + + attr_accessor invoice: Orb::Models::Customers::BalanceTransactionListResponse::Invoice? + + attr_accessor starting_balance: String + + attr_accessor type: Orb::Models::Customers::BalanceTransactionListResponse::type_ + + def initialize: + ( + id: String, + action: Orb::Models::Customers::BalanceTransactionListResponse::action, + amount: String, + created_at: Time, + credit_note: Orb::Models::Customers::BalanceTransactionListResponse::CreditNote?, + description: String?, + ending_balance: String, + invoice: Orb::Models::Customers::BalanceTransactionListResponse::Invoice?, + starting_balance: String, + type: Orb::Models::Customers::BalanceTransactionListResponse::type_ + ) -> void + | ( + ?Orb::Models::Customers::balance_transaction_list_response + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::balance_transaction_list_response + + type action = + :applied_to_invoice + | :manual_adjustment + | :prorated_refund + | :revert_prorated_refund + | :return_from_voiding + | :credit_note_applied + | :credit_note_voided + | :overpayment_refund + + class Action < Orb::Enum + APPLIED_TO_INVOICE: :applied_to_invoice + MANUAL_ADJUSTMENT: :manual_adjustment + PRORATED_REFUND: :prorated_refund + REVERT_PRORATED_REFUND: :revert_prorated_refund + RETURN_FROM_VOIDING: :return_from_voiding + CREDIT_NOTE_APPLIED: :credit_note_applied + CREDIT_NOTE_VOIDED: :credit_note_voided + OVERPAYMENT_REFUND: :overpayment_refund + + def self.values: -> Array[Orb::Models::Customers::BalanceTransactionListResponse::action] + end + + type credit_note = { id: String } + + class CreditNote < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Customers::BalanceTransactionListResponse::credit_note + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::BalanceTransactionListResponse::credit_note + end + + type invoice = { id: String } + + class Invoice < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Customers::BalanceTransactionListResponse::invoice + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::BalanceTransactionListResponse::invoice + end + + type type_ = :increment | :decrement + + class Type < Orb::Enum + INCREMENT: :increment + DECREMENT: :decrement + + def self.values: -> Array[Orb::Models::Customers::BalanceTransactionListResponse::type_] + end + end + end + end +end diff --git a/sig/orb/models/customers/cost_list_by_external_id_params.rbs b/sig/orb/models/customers/cost_list_by_external_id_params.rbs new file mode 100644 index 00000000..7d9dbc53 --- /dev/null +++ b/sig/orb/models/customers/cost_list_by_external_id_params.rbs @@ -0,0 +1,51 @@ +module Orb + module Models + module Customers + type cost_list_by_external_id_params = + { + currency: String?, + timeframe_end: Time?, + timeframe_start: Time?, + view_mode: Orb::Models::Customers::CostListByExternalIDParams::view_mode? + } + & Orb::request_parameters + + class CostListByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor currency: String? + + attr_accessor timeframe_end: Time? + + attr_accessor timeframe_start: Time? + + attr_accessor view_mode: Orb::Models::Customers::CostListByExternalIDParams::view_mode? + + def initialize: + ( + currency: String?, + timeframe_end: Time?, + timeframe_start: Time?, + view_mode: Orb::Models::Customers::CostListByExternalIDParams::view_mode?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Customers::cost_list_by_external_id_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::cost_list_by_external_id_params + + type view_mode = :periodic | :cumulative + + class ViewMode < Orb::Enum + PERIODIC: :periodic + CUMULATIVE: :cumulative + + def self.values: -> Array[Orb::Models::Customers::CostListByExternalIDParams::view_mode] + end + end + end + end +end diff --git a/sig/orb/models/customers/cost_list_by_external_id_response.rbs b/sig/orb/models/customers/cost_list_by_external_id_response.rbs new file mode 100644 index 00000000..19f3f0d0 --- /dev/null +++ b/sig/orb/models/customers/cost_list_by_external_id_response.rbs @@ -0,0 +1,93 @@ +module Orb + module Models + module Customers + type cost_list_by_external_id_response = + { + data: Array[Orb::Models::Customers::CostListByExternalIDResponse::Data] + } + + class CostListByExternalIDResponse < Orb::BaseModel + attr_accessor data: Array[Orb::Models::Customers::CostListByExternalIDResponse::Data] + + def initialize: + ( + data: Array[Orb::Models::Customers::CostListByExternalIDResponse::Data] + ) -> void + | ( + ?Orb::Models::Customers::cost_list_by_external_id_response + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::cost_list_by_external_id_response + + type data = + { + per_price_costs: Array[Orb::Models::Customers::CostListByExternalIDResponse::Data::PerPriceCost], + subtotal: String, + timeframe_end: Time, + timeframe_start: Time, + total: String + } + + class Data < Orb::BaseModel + attr_accessor per_price_costs: Array[Orb::Models::Customers::CostListByExternalIDResponse::Data::PerPriceCost] + + attr_accessor subtotal: String + + attr_accessor timeframe_end: Time + + attr_accessor timeframe_start: Time + + attr_accessor total: String + + def initialize: + ( + per_price_costs: Array[Orb::Models::Customers::CostListByExternalIDResponse::Data::PerPriceCost], + subtotal: String, + timeframe_end: Time, + timeframe_start: Time, + total: String + ) -> void + | ( + ?Orb::Models::Customers::CostListByExternalIDResponse::data + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::CostListByExternalIDResponse::data + + type per_price_cost = + { + price: Orb::Models::price, + subtotal: String, + total: String, + quantity: Float? + } + + class PerPriceCost < Orb::BaseModel + attr_accessor price: Orb::Models::price + + attr_accessor subtotal: String + + attr_accessor total: String + + attr_accessor quantity: Float? + + def initialize: + ( + price: Orb::Models::price, + subtotal: String, + total: String, + quantity: Float? + ) -> void + | ( + ?Orb::Models::Customers::CostListByExternalIDResponse::Data::per_price_cost + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::CostListByExternalIDResponse::Data::per_price_cost + end + end + end + end + end +end diff --git a/sig/orb/models/customers/cost_list_params.rbs b/sig/orb/models/customers/cost_list_params.rbs new file mode 100644 index 00000000..296d1d04 --- /dev/null +++ b/sig/orb/models/customers/cost_list_params.rbs @@ -0,0 +1,50 @@ +module Orb + module Models + module Customers + type cost_list_params = + { + currency: String?, + timeframe_end: Time?, + timeframe_start: Time?, + view_mode: Orb::Models::Customers::CostListParams::view_mode? + } + & Orb::request_parameters + + class CostListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor currency: String? + + attr_accessor timeframe_end: Time? + + attr_accessor timeframe_start: Time? + + attr_accessor view_mode: Orb::Models::Customers::CostListParams::view_mode? + + def initialize: + ( + currency: String?, + timeframe_end: Time?, + timeframe_start: Time?, + view_mode: Orb::Models::Customers::CostListParams::view_mode?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Customers::cost_list_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::cost_list_params + + type view_mode = :periodic | :cumulative + + class ViewMode < Orb::Enum + PERIODIC: :periodic + CUMULATIVE: :cumulative + + def self.values: -> Array[Orb::Models::Customers::CostListParams::view_mode] + end + end + end + end +end diff --git a/sig/orb/models/customers/cost_list_response.rbs b/sig/orb/models/customers/cost_list_response.rbs new file mode 100644 index 00000000..cdd6c31b --- /dev/null +++ b/sig/orb/models/customers/cost_list_response.rbs @@ -0,0 +1,88 @@ +module Orb + module Models + module Customers + type cost_list_response = + { data: Array[Orb::Models::Customers::CostListResponse::Data] } + + class CostListResponse < Orb::BaseModel + attr_accessor data: Array[Orb::Models::Customers::CostListResponse::Data] + + def initialize: + (data: Array[Orb::Models::Customers::CostListResponse::Data]) -> void + | ( + ?Orb::Models::Customers::cost_list_response | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::cost_list_response + + type data = + { + per_price_costs: Array[Orb::Models::Customers::CostListResponse::Data::PerPriceCost], + subtotal: String, + timeframe_end: Time, + timeframe_start: Time, + total: String + } + + class Data < Orb::BaseModel + attr_accessor per_price_costs: Array[Orb::Models::Customers::CostListResponse::Data::PerPriceCost] + + attr_accessor subtotal: String + + attr_accessor timeframe_end: Time + + attr_accessor timeframe_start: Time + + attr_accessor total: String + + def initialize: + ( + per_price_costs: Array[Orb::Models::Customers::CostListResponse::Data::PerPriceCost], + subtotal: String, + timeframe_end: Time, + timeframe_start: Time, + total: String + ) -> void + | ( + ?Orb::Models::Customers::CostListResponse::data + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::CostListResponse::data + + type per_price_cost = + { + price: Orb::Models::price, + subtotal: String, + total: String, + quantity: Float? + } + + class PerPriceCost < Orb::BaseModel + attr_accessor price: Orb::Models::price + + attr_accessor subtotal: String + + attr_accessor total: String + + attr_accessor quantity: Float? + + def initialize: + ( + price: Orb::Models::price, + subtotal: String, + total: String, + quantity: Float? + ) -> void + | ( + ?Orb::Models::Customers::CostListResponse::Data::per_price_cost + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::CostListResponse::Data::per_price_cost + end + end + end + end + end +end diff --git a/sig/orb/models/customers/credit_list_by_external_id_params.rbs b/sig/orb/models/customers/credit_list_by_external_id_params.rbs new file mode 100644 index 00000000..2c987abb --- /dev/null +++ b/sig/orb/models/customers/credit_list_by_external_id_params.rbs @@ -0,0 +1,46 @@ +module Orb + module Models + module Customers + type credit_list_by_external_id_params = + { + currency: String?, + cursor: String?, + include_all_blocks: bool, + limit: Integer + } + & Orb::request_parameters + + class CreditListByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor currency: String? + + attr_accessor cursor: String? + + attr_reader include_all_blocks: bool? + + def include_all_blocks=: (bool) -> void + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + def initialize: + ( + currency: String?, + cursor: String?, + include_all_blocks: bool, + limit: Integer, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Customers::credit_list_by_external_id_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::credit_list_by_external_id_params + end + end + end +end diff --git a/sig/orb/models/customers/credit_list_by_external_id_response.rbs b/sig/orb/models/customers/credit_list_by_external_id_response.rbs new file mode 100644 index 00000000..bbc6c84d --- /dev/null +++ b/sig/orb/models/customers/credit_list_by_external_id_response.rbs @@ -0,0 +1,58 @@ +module Orb + module Models + module Customers + type credit_list_by_external_id_response = + { + id: String, + balance: Float, + effective_date: Time?, + expiry_date: Time?, + maximum_initial_balance: Float?, + per_unit_cost_basis: String?, + status: Orb::Models::Customers::CreditListByExternalIDResponse::status + } + + class CreditListByExternalIDResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor balance: Float + + attr_accessor effective_date: Time? + + attr_accessor expiry_date: Time? + + attr_accessor maximum_initial_balance: Float? + + attr_accessor per_unit_cost_basis: String? + + attr_accessor status: Orb::Models::Customers::CreditListByExternalIDResponse::status + + def initialize: + ( + id: String, + balance: Float, + effective_date: Time?, + expiry_date: Time?, + maximum_initial_balance: Float?, + per_unit_cost_basis: String?, + status: Orb::Models::Customers::CreditListByExternalIDResponse::status + ) -> void + | ( + ?Orb::Models::Customers::credit_list_by_external_id_response + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::credit_list_by_external_id_response + + type status = :active | :pending_payment + + class Status < Orb::Enum + ACTIVE: :active + PENDING_PAYMENT: :pending_payment + + def self.values: -> Array[Orb::Models::Customers::CreditListByExternalIDResponse::status] + end + end + end + end +end diff --git a/sig/orb/models/customers/credit_list_params.rbs b/sig/orb/models/customers/credit_list_params.rbs new file mode 100644 index 00000000..91573372 --- /dev/null +++ b/sig/orb/models/customers/credit_list_params.rbs @@ -0,0 +1,45 @@ +module Orb + module Models + module Customers + type credit_list_params = + { + currency: String?, + cursor: String?, + include_all_blocks: bool, + limit: Integer + } + & Orb::request_parameters + + class CreditListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor currency: String? + + attr_accessor cursor: String? + + attr_reader include_all_blocks: bool? + + def include_all_blocks=: (bool) -> void + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + def initialize: + ( + currency: String?, + cursor: String?, + include_all_blocks: bool, + limit: Integer, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Customers::credit_list_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::credit_list_params + end + end + end +end diff --git a/sig/orb/models/customers/credit_list_response.rbs b/sig/orb/models/customers/credit_list_response.rbs new file mode 100644 index 00000000..4bb2d530 --- /dev/null +++ b/sig/orb/models/customers/credit_list_response.rbs @@ -0,0 +1,57 @@ +module Orb + module Models + module Customers + type credit_list_response = + { + id: String, + balance: Float, + effective_date: Time?, + expiry_date: Time?, + maximum_initial_balance: Float?, + per_unit_cost_basis: String?, + status: Orb::Models::Customers::CreditListResponse::status + } + + class CreditListResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor balance: Float + + attr_accessor effective_date: Time? + + attr_accessor expiry_date: Time? + + attr_accessor maximum_initial_balance: Float? + + attr_accessor per_unit_cost_basis: String? + + attr_accessor status: Orb::Models::Customers::CreditListResponse::status + + def initialize: + ( + id: String, + balance: Float, + effective_date: Time?, + expiry_date: Time?, + maximum_initial_balance: Float?, + per_unit_cost_basis: String?, + status: Orb::Models::Customers::CreditListResponse::status + ) -> void + | ( + ?Orb::Models::Customers::credit_list_response | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::credit_list_response + + type status = :active | :pending_payment + + class Status < Orb::Enum + ACTIVE: :active + PENDING_PAYMENT: :pending_payment + + def self.values: -> Array[Orb::Models::Customers::CreditListResponse::status] + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs b/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs new file mode 100644 index 00000000..c88fd56a --- /dev/null +++ b/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs @@ -0,0 +1,126 @@ +module Orb + module Models + module Customers + module Credits + type ledger_create_entry_by_external_id_params = + { + amount: Float, + entry_type: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::entry_type, + currency: String?, + description: String?, + effective_date: Time?, + expiry_date: Time?, + invoice_settings: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings?, + metadata: Hash[Symbol, String?]?, + per_unit_cost_basis: String?, + target_expiry_date: Date, + block_id: String, + void_reason: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::void_reason? + } + & Orb::request_parameters + + class LedgerCreateEntryByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor amount: Float + + attr_accessor entry_type: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::entry_type + + attr_accessor currency: String? + + attr_accessor description: String? + + attr_accessor effective_date: Time? + + attr_accessor expiry_date: Time? + + attr_accessor invoice_settings: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor per_unit_cost_basis: String? + + attr_accessor target_expiry_date: Date + + attr_accessor block_id: String + + attr_accessor void_reason: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::void_reason? + + def initialize: + ( + amount: Float, + entry_type: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::entry_type, + expiry_date: Time?, + target_expiry_date: Date, + block_id: String, + currency: String?, + description: String?, + effective_date: Time?, + invoice_settings: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings?, + metadata: Hash[Symbol, String?]?, + per_unit_cost_basis: String?, + void_reason: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::void_reason?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Customers::Credits::ledger_create_entry_by_external_id_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::ledger_create_entry_by_external_id_params + + type entry_type = :amendment + + class EntryType < Orb::Enum + AMENDMENT: :amendment + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::entry_type] + end + + type invoice_settings = + { + auto_collection: bool, + net_terms: Integer, + memo: String?, + require_successful_payment: bool + } + + class InvoiceSettings < Orb::BaseModel + attr_accessor auto_collection: bool + + attr_accessor net_terms: Integer + + attr_accessor memo: String? + + attr_reader require_successful_payment: bool? + + def require_successful_payment=: (bool) -> void + + def initialize: + ( + auto_collection: bool, + net_terms: Integer, + memo: String?, + require_successful_payment: bool + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::invoice_settings + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::invoice_settings + end + + type void_reason = :refund + + class VoidReason < Orb::Enum + REFUND: :refund + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::void_reason] + end + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbs b/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbs new file mode 100644 index 00000000..9a997a84 --- /dev/null +++ b/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbs @@ -0,0 +1,882 @@ +module Orb + module Models + module Customers + module Credits + type ledger_create_entry_by_external_id_response = + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry + | Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry + | Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry + | Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry + | Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry + | Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry + | Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry + + class LedgerCreateEntryByExternalIDResponse < Orb::Union + type increment_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::entry_status, + entry_type: :increment, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float + } + + class IncrementLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::entry_status + + attr_accessor entry_type: :increment + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + entry_type: :increment + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::increment_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::increment_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry::entry_status] + end + end + + type decrement_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::entry_status, + entry_type: :decrement, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + event_id: String?, + invoice_id: String?, + price_id: String? + } + + class DecrementLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::entry_status + + attr_accessor entry_type: :decrement + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + attr_accessor event_id: String? + + attr_accessor invoice_id: String? + + attr_accessor price_id: String? + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + event_id: String?, + invoice_id: String?, + price_id: String?, + entry_type: :decrement + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::decrement_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::decrement_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry::entry_status] + end + end + + type expiration_change_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::entry_status, + entry_type: :expiration_change, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + new_block_expiry_date: Time?, + starting_balance: Float + } + + class ExpirationChangeLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::entry_status + + attr_accessor entry_type: :expiration_change + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor new_block_expiry_date: Time? + + attr_accessor starting_balance: Float + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + new_block_expiry_date: Time?, + starting_balance: Float, + entry_type: :expiration_change + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::expiration_change_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::expiration_change_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry::entry_status] + end + end + + type credit_block_expiry_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::entry_status, + entry_type: :credit_block_expiry, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float + } + + class CreditBlockExpiryLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::entry_status + + attr_accessor entry_type: :credit_block_expiry + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + entry_type: :credit_block_expiry + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::credit_block_expiry_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::credit_block_expiry_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry::entry_status] + end + end + + type void_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::entry_status, + entry_type: :void, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + void_amount: Float, + void_reason: String? + } + + class VoidLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::entry_status + + attr_accessor entry_type: :void + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + attr_accessor void_amount: Float + + attr_accessor void_reason: String? + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + void_amount: Float, + void_reason: String?, + entry_type: :void + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::void_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::void_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry::entry_status] + end + end + + type void_initiated_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::entry_status, + entry_type: :void_initiated, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + new_block_expiry_date: Time, + starting_balance: Float, + void_amount: Float, + void_reason: String? + } + + class VoidInitiatedLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::entry_status + + attr_accessor entry_type: :void_initiated + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor new_block_expiry_date: Time + + attr_accessor starting_balance: Float + + attr_accessor void_amount: Float + + attr_accessor void_reason: String? + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + new_block_expiry_date: Time, + starting_balance: Float, + void_amount: Float, + void_reason: String?, + entry_type: :void_initiated + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::void_initiated_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::void_initiated_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry::entry_status] + end + end + + type amendment_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::entry_status, + entry_type: :amendment, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float + } + + class AmendmentLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::entry_status + + attr_accessor entry_type: :amendment + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + entry_type: :amendment + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::amendment_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::amendment_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry::entry_status] + end + end + + private def self.variants: -> [[:increment, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::IncrementLedgerEntry], [:decrement, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::DecrementLedgerEntry], [:expiration_change, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::ExpirationChangeLedgerEntry], [:credit_block_expiry, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::CreditBlockExpiryLedgerEntry], [:void, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidLedgerEntry], [:void_initiated, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::VoidInitiatedLedgerEntry], [:amendment, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse::AmendmentLedgerEntry]] + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/ledger_create_entry_params.rbs b/sig/orb/models/customers/credits/ledger_create_entry_params.rbs new file mode 100644 index 00000000..b2b62464 --- /dev/null +++ b/sig/orb/models/customers/credits/ledger_create_entry_params.rbs @@ -0,0 +1,126 @@ +module Orb + module Models + module Customers + module Credits + type ledger_create_entry_params = + { + amount: Float, + entry_type: Orb::Models::Customers::Credits::LedgerCreateEntryParams::entry_type, + currency: String?, + description: String?, + effective_date: Time?, + expiry_date: Time?, + invoice_settings: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings?, + metadata: Hash[Symbol, String?]?, + per_unit_cost_basis: String?, + target_expiry_date: Date, + block_id: String, + void_reason: Orb::Models::Customers::Credits::LedgerCreateEntryParams::void_reason? + } + & Orb::request_parameters + + class LedgerCreateEntryParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor amount: Float + + attr_accessor entry_type: Orb::Models::Customers::Credits::LedgerCreateEntryParams::entry_type + + attr_accessor currency: String? + + attr_accessor description: String? + + attr_accessor effective_date: Time? + + attr_accessor expiry_date: Time? + + attr_accessor invoice_settings: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor per_unit_cost_basis: String? + + attr_accessor target_expiry_date: Date + + attr_accessor block_id: String + + attr_accessor void_reason: Orb::Models::Customers::Credits::LedgerCreateEntryParams::void_reason? + + def initialize: + ( + amount: Float, + entry_type: Orb::Models::Customers::Credits::LedgerCreateEntryParams::entry_type, + expiry_date: Time?, + target_expiry_date: Date, + block_id: String, + currency: String?, + description: String?, + effective_date: Time?, + invoice_settings: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings?, + metadata: Hash[Symbol, String?]?, + per_unit_cost_basis: String?, + void_reason: Orb::Models::Customers::Credits::LedgerCreateEntryParams::void_reason?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Customers::Credits::ledger_create_entry_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::ledger_create_entry_params + + type entry_type = :amendment + + class EntryType < Orb::Enum + AMENDMENT: :amendment + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryParams::entry_type] + end + + type invoice_settings = + { + auto_collection: bool, + net_terms: Integer, + memo: String?, + require_successful_payment: bool + } + + class InvoiceSettings < Orb::BaseModel + attr_accessor auto_collection: bool + + attr_accessor net_terms: Integer + + attr_accessor memo: String? + + attr_reader require_successful_payment: bool? + + def require_successful_payment=: (bool) -> void + + def initialize: + ( + auto_collection: bool, + net_terms: Integer, + memo: String?, + require_successful_payment: bool + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryParams::invoice_settings + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryParams::invoice_settings + end + + type void_reason = :refund + + class VoidReason < Orb::Enum + REFUND: :refund + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryParams::void_reason] + end + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/ledger_create_entry_response.rbs b/sig/orb/models/customers/credits/ledger_create_entry_response.rbs new file mode 100644 index 00000000..fb829149 --- /dev/null +++ b/sig/orb/models/customers/credits/ledger_create_entry_response.rbs @@ -0,0 +1,882 @@ +module Orb + module Models + module Customers + module Credits + type ledger_create_entry_response = + Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry + | Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry + | Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry + | Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry + | Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry + | Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry + | Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry + + class LedgerCreateEntryResponse < Orb::Union + type increment_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::entry_status, + entry_type: :increment, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float + } + + class IncrementLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::entry_status + + attr_accessor entry_type: :increment + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + entry_type: :increment + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::increment_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::increment_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry::entry_status] + end + end + + type decrement_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::entry_status, + entry_type: :decrement, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + event_id: String?, + invoice_id: String?, + price_id: String? + } + + class DecrementLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::entry_status + + attr_accessor entry_type: :decrement + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + attr_accessor event_id: String? + + attr_accessor invoice_id: String? + + attr_accessor price_id: String? + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + event_id: String?, + invoice_id: String?, + price_id: String?, + entry_type: :decrement + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::decrement_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::decrement_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry::entry_status] + end + end + + type expiration_change_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::entry_status, + entry_type: :expiration_change, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + new_block_expiry_date: Time?, + starting_balance: Float + } + + class ExpirationChangeLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::entry_status + + attr_accessor entry_type: :expiration_change + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor new_block_expiry_date: Time? + + attr_accessor starting_balance: Float + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + new_block_expiry_date: Time?, + starting_balance: Float, + entry_type: :expiration_change + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::expiration_change_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::expiration_change_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry::entry_status] + end + end + + type credit_block_expiry_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::entry_status, + entry_type: :credit_block_expiry, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float + } + + class CreditBlockExpiryLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::entry_status + + attr_accessor entry_type: :credit_block_expiry + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + entry_type: :credit_block_expiry + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::credit_block_expiry_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::credit_block_expiry_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry::entry_status] + end + end + + type void_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::entry_status, + entry_type: :void, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + void_amount: Float, + void_reason: String? + } + + class VoidLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::entry_status + + attr_accessor entry_type: :void + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + attr_accessor void_amount: Float + + attr_accessor void_reason: String? + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + void_amount: Float, + void_reason: String?, + entry_type: :void + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::void_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::void_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry::entry_status] + end + end + + type void_initiated_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::entry_status, + entry_type: :void_initiated, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + new_block_expiry_date: Time, + starting_balance: Float, + void_amount: Float, + void_reason: String? + } + + class VoidInitiatedLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::entry_status + + attr_accessor entry_type: :void_initiated + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor new_block_expiry_date: Time + + attr_accessor starting_balance: Float + + attr_accessor void_amount: Float + + attr_accessor void_reason: String? + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + new_block_expiry_date: Time, + starting_balance: Float, + void_amount: Float, + void_reason: String?, + entry_type: :void_initiated + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::void_initiated_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::void_initiated_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry::entry_status] + end + end + + type amendment_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::entry_status, + entry_type: :amendment, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float + } + + class AmendmentLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::entry_status + + attr_accessor entry_type: :amendment + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + entry_type: :amendment + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::amendment_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::amendment_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry::entry_status] + end + end + + private def self.variants: -> [[:increment, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::IncrementLedgerEntry], [:decrement, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::DecrementLedgerEntry], [:expiration_change, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::ExpirationChangeLedgerEntry], [:credit_block_expiry, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::CreditBlockExpiryLedgerEntry], [:void, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidLedgerEntry], [:void_initiated, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::VoidInitiatedLedgerEntry], [:amendment, Orb::Models::Customers::Credits::LedgerCreateEntryResponse::AmendmentLedgerEntry]] + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/ledger_list_by_external_id_params.rbs b/sig/orb/models/customers/credits/ledger_list_by_external_id_params.rbs new file mode 100644 index 00000000..abdb4550 --- /dev/null +++ b/sig/orb/models/customers/credits/ledger_list_by_external_id_params.rbs @@ -0,0 +1,100 @@ +module Orb + module Models + module Customers + module Credits + type ledger_list_by_external_id_params = + { + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + currency: String?, + cursor: String?, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDParams::entry_status?, + entry_type: Orb::Models::Customers::Credits::LedgerListByExternalIDParams::entry_type?, + limit: Integer, + minimum_amount: String? + } + & Orb::request_parameters + + class LedgerListByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor created_at_gt: Time? + + attr_accessor created_at_gte: Time? + + attr_accessor created_at_lt: Time? + + attr_accessor created_at_lte: Time? + + attr_accessor currency: String? + + attr_accessor cursor: String? + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDParams::entry_status? + + attr_accessor entry_type: Orb::Models::Customers::Credits::LedgerListByExternalIDParams::entry_type? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + attr_accessor minimum_amount: String? + + def initialize: + ( + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + currency: String?, + cursor: String?, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDParams::entry_status?, + entry_type: Orb::Models::Customers::Credits::LedgerListByExternalIDParams::entry_type?, + limit: Integer, + minimum_amount: String?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Customers::Credits::ledger_list_by_external_id_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::ledger_list_by_external_id_params + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListByExternalIDParams::entry_status] + end + + type entry_type = + :increment + | :decrement + | :expiration_change + | :credit_block_expiry + | :void + | :void_initiated + | :amendment + + class EntryType < Orb::Enum + INCREMENT: :increment + DECREMENT: :decrement + EXPIRATION_CHANGE: :expiration_change + CREDIT_BLOCK_EXPIRY: :credit_block_expiry + VOID: :void + VOID_INITIATED: :void_initiated + AMENDMENT: :amendment + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListByExternalIDParams::entry_type] + end + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/ledger_list_by_external_id_response.rbs b/sig/orb/models/customers/credits/ledger_list_by_external_id_response.rbs new file mode 100644 index 00000000..a800851c --- /dev/null +++ b/sig/orb/models/customers/credits/ledger_list_by_external_id_response.rbs @@ -0,0 +1,882 @@ +module Orb + module Models + module Customers + module Credits + type ledger_list_by_external_id_response = + Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry + | Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry + | Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry + | Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry + | Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry + | Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry + | Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry + + class LedgerListByExternalIDResponse < Orb::Union + type increment_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::entry_status, + entry_type: :increment, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float + } + + class IncrementLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::entry_status + + attr_accessor entry_type: :increment + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + entry_type: :increment + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::increment_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::increment_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry::entry_status] + end + end + + type decrement_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::entry_status, + entry_type: :decrement, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + event_id: String?, + invoice_id: String?, + price_id: String? + } + + class DecrementLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::entry_status + + attr_accessor entry_type: :decrement + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + attr_accessor event_id: String? + + attr_accessor invoice_id: String? + + attr_accessor price_id: String? + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + event_id: String?, + invoice_id: String?, + price_id: String?, + entry_type: :decrement + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::decrement_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::decrement_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry::entry_status] + end + end + + type expiration_change_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::entry_status, + entry_type: :expiration_change, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + new_block_expiry_date: Time?, + starting_balance: Float + } + + class ExpirationChangeLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::entry_status + + attr_accessor entry_type: :expiration_change + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor new_block_expiry_date: Time? + + attr_accessor starting_balance: Float + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + new_block_expiry_date: Time?, + starting_balance: Float, + entry_type: :expiration_change + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::expiration_change_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::expiration_change_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry::entry_status] + end + end + + type credit_block_expiry_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::entry_status, + entry_type: :credit_block_expiry, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float + } + + class CreditBlockExpiryLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::entry_status + + attr_accessor entry_type: :credit_block_expiry + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + entry_type: :credit_block_expiry + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::credit_block_expiry_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::credit_block_expiry_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry::entry_status] + end + end + + type void_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::entry_status, + entry_type: :void, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + void_amount: Float, + void_reason: String? + } + + class VoidLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::entry_status + + attr_accessor entry_type: :void + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + attr_accessor void_amount: Float + + attr_accessor void_reason: String? + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + void_amount: Float, + void_reason: String?, + entry_type: :void + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::void_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::void_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry::entry_status] + end + end + + type void_initiated_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::entry_status, + entry_type: :void_initiated, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + new_block_expiry_date: Time, + starting_balance: Float, + void_amount: Float, + void_reason: String? + } + + class VoidInitiatedLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::entry_status + + attr_accessor entry_type: :void_initiated + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor new_block_expiry_date: Time + + attr_accessor starting_balance: Float + + attr_accessor void_amount: Float + + attr_accessor void_reason: String? + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + new_block_expiry_date: Time, + starting_balance: Float, + void_amount: Float, + void_reason: String?, + entry_type: :void_initiated + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::void_initiated_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::void_initiated_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry::entry_status] + end + end + + type amendment_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::entry_status, + entry_type: :amendment, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float + } + + class AmendmentLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::entry_status + + attr_accessor entry_type: :amendment + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + entry_type: :amendment + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::amendment_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::amendment_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry::entry_status] + end + end + + private def self.variants: -> [[:increment, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::IncrementLedgerEntry], [:decrement, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::DecrementLedgerEntry], [:expiration_change, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::ExpirationChangeLedgerEntry], [:credit_block_expiry, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::CreditBlockExpiryLedgerEntry], [:void, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidLedgerEntry], [:void_initiated, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::VoidInitiatedLedgerEntry], [:amendment, Orb::Models::Customers::Credits::LedgerListByExternalIDResponse::AmendmentLedgerEntry]] + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/ledger_list_params.rbs b/sig/orb/models/customers/credits/ledger_list_params.rbs new file mode 100644 index 00000000..709d62a0 --- /dev/null +++ b/sig/orb/models/customers/credits/ledger_list_params.rbs @@ -0,0 +1,100 @@ +module Orb + module Models + module Customers + module Credits + type ledger_list_params = + { + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + currency: String?, + cursor: String?, + entry_status: Orb::Models::Customers::Credits::LedgerListParams::entry_status?, + entry_type: Orb::Models::Customers::Credits::LedgerListParams::entry_type?, + limit: Integer, + minimum_amount: String? + } + & Orb::request_parameters + + class LedgerListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor created_at_gt: Time? + + attr_accessor created_at_gte: Time? + + attr_accessor created_at_lt: Time? + + attr_accessor created_at_lte: Time? + + attr_accessor currency: String? + + attr_accessor cursor: String? + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerListParams::entry_status? + + attr_accessor entry_type: Orb::Models::Customers::Credits::LedgerListParams::entry_type? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + attr_accessor minimum_amount: String? + + def initialize: + ( + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + currency: String?, + cursor: String?, + entry_status: Orb::Models::Customers::Credits::LedgerListParams::entry_status?, + entry_type: Orb::Models::Customers::Credits::LedgerListParams::entry_type?, + limit: Integer, + minimum_amount: String?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Customers::Credits::ledger_list_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::ledger_list_params + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListParams::entry_status] + end + + type entry_type = + :increment + | :decrement + | :expiration_change + | :credit_block_expiry + | :void + | :void_initiated + | :amendment + + class EntryType < Orb::Enum + INCREMENT: :increment + DECREMENT: :decrement + EXPIRATION_CHANGE: :expiration_change + CREDIT_BLOCK_EXPIRY: :credit_block_expiry + VOID: :void + VOID_INITIATED: :void_initiated + AMENDMENT: :amendment + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListParams::entry_type] + end + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/ledger_list_response.rbs b/sig/orb/models/customers/credits/ledger_list_response.rbs new file mode 100644 index 00000000..f2050b0a --- /dev/null +++ b/sig/orb/models/customers/credits/ledger_list_response.rbs @@ -0,0 +1,882 @@ +module Orb + module Models + module Customers + module Credits + type ledger_list_response = + Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry + | Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry + | Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry + | Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry + | Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry + | Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry + | Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry + + class LedgerListResponse < Orb::Union + type increment_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::entry_status, + entry_type: :increment, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float + } + + class IncrementLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::entry_status + + attr_accessor entry_type: :increment + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + entry_type: :increment + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::increment_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::increment_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry::entry_status] + end + end + + type decrement_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::entry_status, + entry_type: :decrement, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + event_id: String?, + invoice_id: String?, + price_id: String? + } + + class DecrementLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::entry_status + + attr_accessor entry_type: :decrement + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + attr_accessor event_id: String? + + attr_accessor invoice_id: String? + + attr_accessor price_id: String? + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + event_id: String?, + invoice_id: String?, + price_id: String?, + entry_type: :decrement + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::decrement_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::decrement_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry::entry_status] + end + end + + type expiration_change_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::entry_status, + entry_type: :expiration_change, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + new_block_expiry_date: Time?, + starting_balance: Float + } + + class ExpirationChangeLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::entry_status + + attr_accessor entry_type: :expiration_change + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor new_block_expiry_date: Time? + + attr_accessor starting_balance: Float + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + new_block_expiry_date: Time?, + starting_balance: Float, + entry_type: :expiration_change + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::expiration_change_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::expiration_change_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry::entry_status] + end + end + + type credit_block_expiry_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::entry_status, + entry_type: :credit_block_expiry, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float + } + + class CreditBlockExpiryLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::entry_status + + attr_accessor entry_type: :credit_block_expiry + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + entry_type: :credit_block_expiry + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::credit_block_expiry_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::credit_block_expiry_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry::entry_status] + end + end + + type void_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::entry_status, + entry_type: :void, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + void_amount: Float, + void_reason: String? + } + + class VoidLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::entry_status + + attr_accessor entry_type: :void + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + attr_accessor void_amount: Float + + attr_accessor void_reason: String? + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + void_amount: Float, + void_reason: String?, + entry_type: :void + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::void_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::void_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry::entry_status] + end + end + + type void_initiated_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::entry_status, + entry_type: :void_initiated, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + new_block_expiry_date: Time, + starting_balance: Float, + void_amount: Float, + void_reason: String? + } + + class VoidInitiatedLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::entry_status + + attr_accessor entry_type: :void_initiated + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor new_block_expiry_date: Time + + attr_accessor starting_balance: Float + + attr_accessor void_amount: Float + + attr_accessor void_reason: String? + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + new_block_expiry_date: Time, + starting_balance: Float, + void_amount: Float, + void_reason: String?, + entry_type: :void_initiated + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::void_initiated_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::void_initiated_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry::entry_status] + end + end + + type amendment_ledger_entry = + { + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::entry_status, + entry_type: :amendment, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float + } + + class AmendmentLedgerEntry < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: Float + + attr_accessor created_at: Time + + attr_accessor credit_block: Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::CreditBlock + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::Customer + + attr_accessor description: String? + + attr_accessor ending_balance: Float + + attr_accessor entry_status: Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::entry_status + + attr_accessor entry_type: :amendment + + attr_accessor ledger_sequence_number: Integer + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor starting_balance: Float + + def initialize: + ( + id: String, + amount: Float, + created_at: Time, + credit_block: Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::CreditBlock, + currency: String, + customer: Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::Customer, + description: String?, + ending_balance: Float, + entry_status: Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::entry_status, + ledger_sequence_number: Integer, + metadata: Hash[Symbol, String], + starting_balance: Float, + entry_type: :amendment + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::amendment_ledger_entry + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::amendment_ledger_entry + + type credit_block = + { id: String, expiry_date: Time?, per_unit_cost_basis: String? } + + class CreditBlock < Orb::BaseModel + attr_accessor id: String + + attr_accessor expiry_date: Time? + + attr_accessor per_unit_cost_basis: String? + + def initialize: + ( + id: String, + expiry_date: Time?, + per_unit_cost_basis: String? + ) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::credit_block + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::credit_block + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::customer + end + + type entry_status = :committed | :pending + + class EntryStatus < Orb::Enum + COMMITTED: :committed + PENDING: :pending + + def self.values: -> Array[Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry::entry_status] + end + end + + private def self.variants: -> [[:increment, Orb::Models::Customers::Credits::LedgerListResponse::IncrementLedgerEntry], [:decrement, Orb::Models::Customers::Credits::LedgerListResponse::DecrementLedgerEntry], [:expiration_change, Orb::Models::Customers::Credits::LedgerListResponse::ExpirationChangeLedgerEntry], [:credit_block_expiry, Orb::Models::Customers::Credits::LedgerListResponse::CreditBlockExpiryLedgerEntry], [:void, Orb::Models::Customers::Credits::LedgerListResponse::VoidLedgerEntry], [:void_initiated, Orb::Models::Customers::Credits::LedgerListResponse::VoidInitiatedLedgerEntry], [:amendment, Orb::Models::Customers::Credits::LedgerListResponse::AmendmentLedgerEntry]] + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/top_up_create_by_external_id_params.rbs b/sig/orb/models/customers/credits/top_up_create_by_external_id_params.rbs new file mode 100644 index 00000000..d28be27c --- /dev/null +++ b/sig/orb/models/customers/credits/top_up_create_by_external_id_params.rbs @@ -0,0 +1,99 @@ +module Orb + module Models + module Customers + module Credits + type top_up_create_by_external_id_params = + { + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: Integer?, + expires_after_unit: Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::expires_after_unit? + } + & Orb::request_parameters + + class TopUpCreateByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor amount: String + + attr_accessor currency: String + + attr_accessor invoice_settings: Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::InvoiceSettings + + attr_accessor per_unit_cost_basis: String + + attr_accessor threshold: String + + attr_accessor expires_after: Integer? + + attr_accessor expires_after_unit: Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::expires_after_unit? + + def initialize: + ( + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: Integer?, + expires_after_unit: Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::expires_after_unit?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Customers::Credits::top_up_create_by_external_id_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::top_up_create_by_external_id_params + + type invoice_settings = + { + auto_collection: bool, + net_terms: Integer, + memo: String?, + require_successful_payment: bool + } + + class InvoiceSettings < Orb::BaseModel + attr_accessor auto_collection: bool + + attr_accessor net_terms: Integer + + attr_accessor memo: String? + + attr_reader require_successful_payment: bool? + + def require_successful_payment=: (bool) -> void + + def initialize: + ( + auto_collection: bool, + net_terms: Integer, + memo: String?, + require_successful_payment: bool + ) -> void + | ( + ?Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::invoice_settings + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::invoice_settings + end + + type expires_after_unit = :day | :month + + class ExpiresAfterUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::expires_after_unit] + end + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/top_up_create_by_external_id_response.rbs b/sig/orb/models/customers/credits/top_up_create_by_external_id_response.rbs new file mode 100644 index 00000000..7df46d2c --- /dev/null +++ b/sig/orb/models/customers/credits/top_up_create_by_external_id_response.rbs @@ -0,0 +1,98 @@ +module Orb + module Models + module Customers + module Credits + type top_up_create_by_external_id_response = + { + id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: Integer?, + expires_after_unit: Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::expires_after_unit? + } + + class TopUpCreateByExternalIDResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: String + + attr_accessor currency: String + + attr_accessor invoice_settings: Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::InvoiceSettings + + attr_accessor per_unit_cost_basis: String + + attr_accessor threshold: String + + attr_accessor expires_after: Integer? + + attr_accessor expires_after_unit: Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::expires_after_unit? + + def initialize: + ( + id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: Integer?, + expires_after_unit: Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::expires_after_unit? + ) -> void + | ( + ?Orb::Models::Customers::Credits::top_up_create_by_external_id_response + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::top_up_create_by_external_id_response + + type invoice_settings = + { + auto_collection: bool, + net_terms: Integer, + memo: String?, + require_successful_payment: bool + } + + class InvoiceSettings < Orb::BaseModel + attr_accessor auto_collection: bool + + attr_accessor net_terms: Integer + + attr_accessor memo: String? + + attr_reader require_successful_payment: bool? + + def require_successful_payment=: (bool) -> void + + def initialize: + ( + auto_collection: bool, + net_terms: Integer, + memo: String?, + require_successful_payment: bool + ) -> void + | ( + ?Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::invoice_settings + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::invoice_settings + end + + type expires_after_unit = :day | :month + + class ExpiresAfterUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse::expires_after_unit] + end + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/top_up_create_params.rbs b/sig/orb/models/customers/credits/top_up_create_params.rbs new file mode 100644 index 00000000..1434aeb4 --- /dev/null +++ b/sig/orb/models/customers/credits/top_up_create_params.rbs @@ -0,0 +1,99 @@ +module Orb + module Models + module Customers + module Credits + type top_up_create_params = + { + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateParams::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: Integer?, + expires_after_unit: Orb::Models::Customers::Credits::TopUpCreateParams::expires_after_unit? + } + & Orb::request_parameters + + class TopUpCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor amount: String + + attr_accessor currency: String + + attr_accessor invoice_settings: Orb::Models::Customers::Credits::TopUpCreateParams::InvoiceSettings + + attr_accessor per_unit_cost_basis: String + + attr_accessor threshold: String + + attr_accessor expires_after: Integer? + + attr_accessor expires_after_unit: Orb::Models::Customers::Credits::TopUpCreateParams::expires_after_unit? + + def initialize: + ( + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateParams::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: Integer?, + expires_after_unit: Orb::Models::Customers::Credits::TopUpCreateParams::expires_after_unit?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Customers::Credits::top_up_create_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::top_up_create_params + + type invoice_settings = + { + auto_collection: bool, + net_terms: Integer, + memo: String?, + require_successful_payment: bool + } + + class InvoiceSettings < Orb::BaseModel + attr_accessor auto_collection: bool + + attr_accessor net_terms: Integer + + attr_accessor memo: String? + + attr_reader require_successful_payment: bool? + + def require_successful_payment=: (bool) -> void + + def initialize: + ( + auto_collection: bool, + net_terms: Integer, + memo: String?, + require_successful_payment: bool + ) -> void + | ( + ?Orb::Models::Customers::Credits::TopUpCreateParams::invoice_settings + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::TopUpCreateParams::invoice_settings + end + + type expires_after_unit = :day | :month + + class ExpiresAfterUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Customers::Credits::TopUpCreateParams::expires_after_unit] + end + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/top_up_create_response.rbs b/sig/orb/models/customers/credits/top_up_create_response.rbs new file mode 100644 index 00000000..f439d278 --- /dev/null +++ b/sig/orb/models/customers/credits/top_up_create_response.rbs @@ -0,0 +1,98 @@ +module Orb + module Models + module Customers + module Credits + type top_up_create_response = + { + id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateResponse::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: Integer?, + expires_after_unit: Orb::Models::Customers::Credits::TopUpCreateResponse::expires_after_unit? + } + + class TopUpCreateResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: String + + attr_accessor currency: String + + attr_accessor invoice_settings: Orb::Models::Customers::Credits::TopUpCreateResponse::InvoiceSettings + + attr_accessor per_unit_cost_basis: String + + attr_accessor threshold: String + + attr_accessor expires_after: Integer? + + attr_accessor expires_after_unit: Orb::Models::Customers::Credits::TopUpCreateResponse::expires_after_unit? + + def initialize: + ( + id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateResponse::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: Integer?, + expires_after_unit: Orb::Models::Customers::Credits::TopUpCreateResponse::expires_after_unit? + ) -> void + | ( + ?Orb::Models::Customers::Credits::top_up_create_response + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::top_up_create_response + + type invoice_settings = + { + auto_collection: bool, + net_terms: Integer, + memo: String?, + require_successful_payment: bool + } + + class InvoiceSettings < Orb::BaseModel + attr_accessor auto_collection: bool + + attr_accessor net_terms: Integer + + attr_accessor memo: String? + + attr_reader require_successful_payment: bool? + + def require_successful_payment=: (bool) -> void + + def initialize: + ( + auto_collection: bool, + net_terms: Integer, + memo: String?, + require_successful_payment: bool + ) -> void + | ( + ?Orb::Models::Customers::Credits::TopUpCreateResponse::invoice_settings + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::TopUpCreateResponse::invoice_settings + end + + type expires_after_unit = :day | :month + + class ExpiresAfterUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Customers::Credits::TopUpCreateResponse::expires_after_unit] + end + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/top_up_delete_by_external_id_params.rbs b/sig/orb/models/customers/credits/top_up_delete_by_external_id_params.rbs new file mode 100644 index 00000000..5e88b948 --- /dev/null +++ b/sig/orb/models/customers/credits/top_up_delete_by_external_id_params.rbs @@ -0,0 +1,29 @@ +module Orb + module Models + module Customers + module Credits + type top_up_delete_by_external_id_params = + { external_customer_id: String } & Orb::request_parameters + + class TopUpDeleteByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor external_customer_id: String + + def initialize: + ( + external_customer_id: String, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Customers::Credits::top_up_delete_by_external_id_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::top_up_delete_by_external_id_params + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/top_up_delete_params.rbs b/sig/orb/models/customers/credits/top_up_delete_params.rbs new file mode 100644 index 00000000..d36b5675 --- /dev/null +++ b/sig/orb/models/customers/credits/top_up_delete_params.rbs @@ -0,0 +1,26 @@ +module Orb + module Models + module Customers + module Credits + type top_up_delete_params = + { customer_id: String } & Orb::request_parameters + + class TopUpDeleteParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor customer_id: String + + def initialize: + (customer_id: String, request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::Customers::Credits::top_up_delete_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::top_up_delete_params + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/top_up_list_by_external_id_params.rbs b/sig/orb/models/customers/credits/top_up_list_by_external_id_params.rbs new file mode 100644 index 00000000..0028c6a7 --- /dev/null +++ b/sig/orb/models/customers/credits/top_up_list_by_external_id_params.rbs @@ -0,0 +1,34 @@ +module Orb + module Models + module Customers + module Credits + type top_up_list_by_external_id_params = + { cursor: String?, limit: Integer } & Orb::request_parameters + + class TopUpListByExternalIDParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor cursor: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + def initialize: + ( + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Customers::Credits::top_up_list_by_external_id_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::top_up_list_by_external_id_params + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/top_up_list_by_external_id_response.rbs b/sig/orb/models/customers/credits/top_up_list_by_external_id_response.rbs new file mode 100644 index 00000000..29d24d57 --- /dev/null +++ b/sig/orb/models/customers/credits/top_up_list_by_external_id_response.rbs @@ -0,0 +1,98 @@ +module Orb + module Models + module Customers + module Credits + type top_up_list_by_external_id_response = + { + id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: Integer?, + expires_after_unit: Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::expires_after_unit? + } + + class TopUpListByExternalIDResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: String + + attr_accessor currency: String + + attr_accessor invoice_settings: Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::InvoiceSettings + + attr_accessor per_unit_cost_basis: String + + attr_accessor threshold: String + + attr_accessor expires_after: Integer? + + attr_accessor expires_after_unit: Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::expires_after_unit? + + def initialize: + ( + id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: Integer?, + expires_after_unit: Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::expires_after_unit? + ) -> void + | ( + ?Orb::Models::Customers::Credits::top_up_list_by_external_id_response + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::top_up_list_by_external_id_response + + type invoice_settings = + { + auto_collection: bool, + net_terms: Integer, + memo: String?, + require_successful_payment: bool + } + + class InvoiceSettings < Orb::BaseModel + attr_accessor auto_collection: bool + + attr_accessor net_terms: Integer + + attr_accessor memo: String? + + attr_reader require_successful_payment: bool? + + def require_successful_payment=: (bool) -> void + + def initialize: + ( + auto_collection: bool, + net_terms: Integer, + memo: String?, + require_successful_payment: bool + ) -> void + | ( + ?Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::invoice_settings + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::invoice_settings + end + + type expires_after_unit = :day | :month + + class ExpiresAfterUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Customers::Credits::TopUpListByExternalIDResponse::expires_after_unit] + end + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/top_up_list_params.rbs b/sig/orb/models/customers/credits/top_up_list_params.rbs new file mode 100644 index 00000000..75a1caf5 --- /dev/null +++ b/sig/orb/models/customers/credits/top_up_list_params.rbs @@ -0,0 +1,34 @@ +module Orb + module Models + module Customers + module Credits + type top_up_list_params = + { cursor: String?, limit: Integer } & Orb::request_parameters + + class TopUpListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor cursor: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + def initialize: + ( + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Customers::Credits::top_up_list_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::top_up_list_params + end + end + end + end +end diff --git a/sig/orb/models/customers/credits/top_up_list_response.rbs b/sig/orb/models/customers/credits/top_up_list_response.rbs new file mode 100644 index 00000000..3e253262 --- /dev/null +++ b/sig/orb/models/customers/credits/top_up_list_response.rbs @@ -0,0 +1,98 @@ +module Orb + module Models + module Customers + module Credits + type top_up_list_response = + { + id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpListResponse::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: Integer?, + expires_after_unit: Orb::Models::Customers::Credits::TopUpListResponse::expires_after_unit? + } + + class TopUpListResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: String + + attr_accessor currency: String + + attr_accessor invoice_settings: Orb::Models::Customers::Credits::TopUpListResponse::InvoiceSettings + + attr_accessor per_unit_cost_basis: String + + attr_accessor threshold: String + + attr_accessor expires_after: Integer? + + attr_accessor expires_after_unit: Orb::Models::Customers::Credits::TopUpListResponse::expires_after_unit? + + def initialize: + ( + id: String, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpListResponse::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: Integer?, + expires_after_unit: Orb::Models::Customers::Credits::TopUpListResponse::expires_after_unit? + ) -> void + | ( + ?Orb::Models::Customers::Credits::top_up_list_response + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::top_up_list_response + + type invoice_settings = + { + auto_collection: bool, + net_terms: Integer, + memo: String?, + require_successful_payment: bool + } + + class InvoiceSettings < Orb::BaseModel + attr_accessor auto_collection: bool + + attr_accessor net_terms: Integer + + attr_accessor memo: String? + + attr_reader require_successful_payment: bool? + + def require_successful_payment=: (bool) -> void + + def initialize: + ( + auto_collection: bool, + net_terms: Integer, + memo: String?, + require_successful_payment: bool + ) -> void + | ( + ?Orb::Models::Customers::Credits::TopUpListResponse::invoice_settings + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Customers::Credits::TopUpListResponse::invoice_settings + end + + type expires_after_unit = :day | :month + + class ExpiresAfterUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Customers::Credits::TopUpListResponse::expires_after_unit] + end + end + end + end + end +end diff --git a/sig/orb/models/dimensional_price_group.rbs b/sig/orb/models/dimensional_price_group.rbs new file mode 100644 index 00000000..997a06ef --- /dev/null +++ b/sig/orb/models/dimensional_price_group.rbs @@ -0,0 +1,40 @@ +module Orb + module Models + type dimensional_price_group = + { + id: String, + billable_metric_id: String, + dimensions: Array[String], + external_dimensional_price_group_id: String?, + metadata: Hash[Symbol, String], + name: String + } + + class DimensionalPriceGroup < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric_id: String + + attr_accessor dimensions: Array[String] + + attr_accessor external_dimensional_price_group_id: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor name: String + + def initialize: + ( + id: String, + billable_metric_id: String, + dimensions: Array[String], + external_dimensional_price_group_id: String?, + metadata: Hash[Symbol, String], + name: String + ) -> void + | (?Orb::Models::dimensional_price_group | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::dimensional_price_group + end + end +end diff --git a/sig/orb/models/dimensional_price_group_create_params.rbs b/sig/orb/models/dimensional_price_group_create_params.rbs new file mode 100644 index 00000000..3dec5ec9 --- /dev/null +++ b/sig/orb/models/dimensional_price_group_create_params.rbs @@ -0,0 +1,44 @@ +module Orb + module Models + type dimensional_price_group_create_params = + { + billable_metric_id: String, + dimensions: Array[String], + name: String, + external_dimensional_price_group_id: String?, + metadata: Hash[Symbol, String?]? + } + & Orb::request_parameters + + class DimensionalPriceGroupCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor billable_metric_id: String + + attr_accessor dimensions: Array[String] + + attr_accessor name: String + + attr_accessor external_dimensional_price_group_id: String? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + billable_metric_id: String, + dimensions: Array[String], + name: String, + external_dimensional_price_group_id: String?, + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::dimensional_price_group_create_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::dimensional_price_group_create_params + end + end +end diff --git a/sig/orb/models/dimensional_price_group_list_params.rbs b/sig/orb/models/dimensional_price_group_list_params.rbs new file mode 100644 index 00000000..0898f187 --- /dev/null +++ b/sig/orb/models/dimensional_price_group_list_params.rbs @@ -0,0 +1,30 @@ +module Orb + module Models + type dimensional_price_group_list_params = + { cursor: String?, limit: Integer } & Orb::request_parameters + + class DimensionalPriceGroupListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor cursor: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + def initialize: + ( + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::dimensional_price_group_list_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::dimensional_price_group_list_params + end + end +end diff --git a/sig/orb/models/dimensional_price_group_retrieve_params.rbs b/sig/orb/models/dimensional_price_group_retrieve_params.rbs new file mode 100644 index 00000000..ad01b6d6 --- /dev/null +++ b/sig/orb/models/dimensional_price_group_retrieve_params.rbs @@ -0,0 +1,20 @@ +module Orb + module Models + type dimensional_price_group_retrieve_params = + { } & Orb::request_parameters + + class DimensionalPriceGroupRetrieveParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::dimensional_price_group_retrieve_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::dimensional_price_group_retrieve_params + end + end +end diff --git a/sig/orb/models/dimensional_price_groups.rbs b/sig/orb/models/dimensional_price_groups.rbs new file mode 100644 index 00000000..5028f210 --- /dev/null +++ b/sig/orb/models/dimensional_price_groups.rbs @@ -0,0 +1,26 @@ +module Orb + module Models + type dimensional_price_groups_api = + { + data: Array[Orb::Models::DimensionalPriceGroup], + pagination_metadata: Orb::Models::PaginationMetadata + } + + class DimensionalPriceGroupsAPI < Orb::BaseModel + attr_accessor data: Array[Orb::Models::DimensionalPriceGroup] + + attr_accessor pagination_metadata: Orb::Models::PaginationMetadata + + def initialize: + ( + data: Array[Orb::Models::DimensionalPriceGroup], + pagination_metadata: Orb::Models::PaginationMetadata + ) -> void + | ( + ?Orb::Models::dimensional_price_groups_api | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::dimensional_price_groups_api + end + end +end diff --git a/sig/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbs b/sig/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbs new file mode 100644 index 00000000..79b3fea0 --- /dev/null +++ b/sig/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbs @@ -0,0 +1,22 @@ +module Orb + module Models + module DimensionalPriceGroups + type external_dimensional_price_group_id_retrieve_params = + { } & Orb::request_parameters + + class ExternalDimensionalPriceGroupIDRetrieveParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::DimensionalPriceGroups::external_dimensional_price_group_id_retrieve_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::DimensionalPriceGroups::external_dimensional_price_group_id_retrieve_params + end + end + end +end diff --git a/sig/orb/models/discount.rbs b/sig/orb/models/discount.rbs new file mode 100644 index 00000000..b4254245 --- /dev/null +++ b/sig/orb/models/discount.rbs @@ -0,0 +1,44 @@ +module Orb + module Models + type discount = + Orb::Models::PercentageDiscount + | Orb::Models::TrialDiscount + | Orb::Models::Discount::UsageDiscount + | Orb::Models::AmountDiscount + + class Discount < Orb::Union + type usage_discount = + { + applies_to_price_ids: Array[String], + discount_type: :usage, + usage_discount: Float, + reason: String? + } + + class UsageDiscount < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor discount_type: :usage + + attr_accessor usage_discount: Float + + attr_accessor reason: String? + + def initialize: + ( + applies_to_price_ids: Array[String], + usage_discount: Float, + reason: String?, + discount_type: :usage + ) -> void + | ( + ?Orb::Models::Discount::usage_discount | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Discount::usage_discount + end + + private def self.variants: -> [[:percentage, Orb::Models::PercentageDiscount], [:trial, Orb::Models::TrialDiscount], [:usage, Orb::Models::Discount::UsageDiscount], [:amount, Orb::Models::AmountDiscount]] + end + end +end diff --git a/sig/orb/models/evaluate_price_group.rbs b/sig/orb/models/evaluate_price_group.rbs new file mode 100644 index 00000000..ca10d066 --- /dev/null +++ b/sig/orb/models/evaluate_price_group.rbs @@ -0,0 +1,34 @@ +module Orb + module Models + type evaluate_price_group = + { + amount: String, + grouping_values: Array[Orb::Models::EvaluatePriceGroup::grouping_value], + quantity: Float + } + + class EvaluatePriceGroup < Orb::BaseModel + attr_accessor amount: String + + attr_accessor grouping_values: Array[Orb::Models::EvaluatePriceGroup::grouping_value] + + attr_accessor quantity: Float + + def initialize: + ( + amount: String, + grouping_values: Array[Orb::Models::EvaluatePriceGroup::grouping_value], + quantity: Float + ) -> void + | (?Orb::Models::evaluate_price_group | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::evaluate_price_group + + type grouping_value = String | Float | bool + + class GroupingValue < Orb::Union + private def self.variants: -> [[nil, String], [nil, Float], [nil, bool]] + end + end + end +end diff --git a/sig/orb/models/event_deprecate_params.rbs b/sig/orb/models/event_deprecate_params.rbs new file mode 100644 index 00000000..168e18ce --- /dev/null +++ b/sig/orb/models/event_deprecate_params.rbs @@ -0,0 +1,16 @@ +module Orb + module Models + type event_deprecate_params = { } & Orb::request_parameters + + class EventDeprecateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | (?Orb::Models::event_deprecate_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::event_deprecate_params + end + end +end diff --git a/sig/orb/models/event_deprecate_response.rbs b/sig/orb/models/event_deprecate_response.rbs new file mode 100644 index 00000000..5d92b4c8 --- /dev/null +++ b/sig/orb/models/event_deprecate_response.rbs @@ -0,0 +1,15 @@ +module Orb + module Models + type event_deprecate_response = { deprecated: String } + + class EventDeprecateResponse < Orb::BaseModel + attr_accessor deprecated: String + + def initialize: + (deprecated: String) -> void + | (?Orb::Models::event_deprecate_response | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::event_deprecate_response + end + end +end diff --git a/sig/orb/models/event_ingest_params.rbs b/sig/orb/models/event_ingest_params.rbs new file mode 100644 index 00000000..5104030c --- /dev/null +++ b/sig/orb/models/event_ingest_params.rbs @@ -0,0 +1,74 @@ +module Orb + module Models + type event_ingest_params = + { + events: Array[Orb::Models::EventIngestParams::Event], + backfill_id: String?, + debug: bool + } + & Orb::request_parameters + + class EventIngestParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor events: Array[Orb::Models::EventIngestParams::Event] + + attr_accessor backfill_id: String? + + attr_reader debug: bool? + + def debug=: (bool) -> void + + def initialize: + ( + events: Array[Orb::Models::EventIngestParams::Event], + backfill_id: String?, + debug: bool, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::event_ingest_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::event_ingest_params + + type event = + { + event_name: String, + idempotency_key: String, + properties: top, + timestamp: Time, + customer_id: String?, + external_customer_id: String? + } + + class Event < Orb::BaseModel + attr_accessor event_name: String + + attr_accessor idempotency_key: String + + attr_accessor properties: top + + attr_accessor timestamp: Time + + attr_accessor customer_id: String? + + attr_accessor external_customer_id: String? + + def initialize: + ( + event_name: String, + idempotency_key: String, + properties: top, + timestamp: Time, + customer_id: String?, + external_customer_id: String? + ) -> void + | ( + ?Orb::Models::EventIngestParams::event | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::EventIngestParams::event + end + end + end +end diff --git a/sig/orb/models/event_ingest_response.rbs b/sig/orb/models/event_ingest_response.rbs new file mode 100644 index 00000000..bcdb1f80 --- /dev/null +++ b/sig/orb/models/event_ingest_response.rbs @@ -0,0 +1,58 @@ +module Orb + module Models + type event_ingest_response = + { + validation_failed: Array[Orb::Models::EventIngestResponse::ValidationFailed], + debug: Orb::Models::EventIngestResponse::Debug? + } + + class EventIngestResponse < Orb::BaseModel + attr_accessor validation_failed: Array[Orb::Models::EventIngestResponse::ValidationFailed] + + attr_accessor debug: Orb::Models::EventIngestResponse::Debug? + + def initialize: + ( + validation_failed: Array[Orb::Models::EventIngestResponse::ValidationFailed], + debug: Orb::Models::EventIngestResponse::Debug? + ) -> void + | (?Orb::Models::event_ingest_response | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::event_ingest_response + + type validation_failed = + { idempotency_key: String, validation_errors: Array[String] } + + class ValidationFailed < Orb::BaseModel + attr_accessor idempotency_key: String + + attr_accessor validation_errors: Array[String] + + def initialize: + (idempotency_key: String, validation_errors: Array[String]) -> void + | ( + ?Orb::Models::EventIngestResponse::validation_failed + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::EventIngestResponse::validation_failed + end + + type debug = { duplicate: Array[String], ingested: Array[String] } + + class Debug < Orb::BaseModel + attr_accessor duplicate: Array[String] + + attr_accessor ingested: Array[String] + + def initialize: + (duplicate: Array[String], ingested: Array[String]) -> void + | ( + ?Orb::Models::EventIngestResponse::debug | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::EventIngestResponse::debug + end + end + end +end diff --git a/sig/orb/models/event_search_params.rbs b/sig/orb/models/event_search_params.rbs new file mode 100644 index 00000000..ffb5a958 --- /dev/null +++ b/sig/orb/models/event_search_params.rbs @@ -0,0 +1,29 @@ +module Orb + module Models + type event_search_params = + { event_ids: Array[String], timeframe_end: Time?, timeframe_start: Time? } + & Orb::request_parameters + + class EventSearchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor event_ids: Array[String] + + attr_accessor timeframe_end: Time? + + attr_accessor timeframe_start: Time? + + def initialize: + ( + event_ids: Array[String], + timeframe_end: Time?, + timeframe_start: Time?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::event_search_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::event_search_params + end + end +end diff --git a/sig/orb/models/event_search_response.rbs b/sig/orb/models/event_search_response.rbs new file mode 100644 index 00000000..6c7571cc --- /dev/null +++ b/sig/orb/models/event_search_response.rbs @@ -0,0 +1,59 @@ +module Orb + module Models + type event_search_response = + { data: Array[Orb::Models::EventSearchResponse::Data] } + + class EventSearchResponse < Orb::BaseModel + attr_accessor data: Array[Orb::Models::EventSearchResponse::Data] + + def initialize: + (data: Array[Orb::Models::EventSearchResponse::Data]) -> void + | (?Orb::Models::event_search_response | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::event_search_response + + type data = + { + id: String, + customer_id: String?, + deprecated: bool, + event_name: String, + external_customer_id: String?, + properties: top, + timestamp: Time + } + + class Data < Orb::BaseModel + attr_accessor id: String + + attr_accessor customer_id: String? + + attr_accessor deprecated: bool + + attr_accessor event_name: String + + attr_accessor external_customer_id: String? + + attr_accessor properties: top + + attr_accessor timestamp: Time + + def initialize: + ( + id: String, + customer_id: String?, + deprecated: bool, + event_name: String, + external_customer_id: String?, + properties: top, + timestamp: Time + ) -> void + | ( + ?Orb::Models::EventSearchResponse::data | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::EventSearchResponse::data + end + end + end +end diff --git a/sig/orb/models/event_update_params.rbs b/sig/orb/models/event_update_params.rbs new file mode 100644 index 00000000..a44a839b --- /dev/null +++ b/sig/orb/models/event_update_params.rbs @@ -0,0 +1,41 @@ +module Orb + module Models + type event_update_params = + { + event_name: String, + properties: top, + timestamp: Time, + customer_id: String?, + external_customer_id: String? + } + & Orb::request_parameters + + class EventUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor event_name: String + + attr_accessor properties: top + + attr_accessor timestamp: Time + + attr_accessor customer_id: String? + + attr_accessor external_customer_id: String? + + def initialize: + ( + event_name: String, + properties: top, + timestamp: Time, + customer_id: String?, + external_customer_id: String?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::event_update_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::event_update_params + end + end +end diff --git a/sig/orb/models/event_update_response.rbs b/sig/orb/models/event_update_response.rbs new file mode 100644 index 00000000..ccb25ebb --- /dev/null +++ b/sig/orb/models/event_update_response.rbs @@ -0,0 +1,15 @@ +module Orb + module Models + type event_update_response = { amended: String } + + class EventUpdateResponse < Orb::BaseModel + attr_accessor amended: String + + def initialize: + (amended: String) -> void + | (?Orb::Models::event_update_response | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::event_update_response + end + end +end diff --git a/sig/orb/models/events/backfill_close_params.rbs b/sig/orb/models/events/backfill_close_params.rbs new file mode 100644 index 00000000..25ee0466 --- /dev/null +++ b/sig/orb/models/events/backfill_close_params.rbs @@ -0,0 +1,20 @@ +module Orb + module Models + module Events + type backfill_close_params = { } & Orb::request_parameters + + class BackfillCloseParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::Events::backfill_close_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Events::backfill_close_params + end + end + end +end diff --git a/sig/orb/models/events/backfill_close_response.rbs b/sig/orb/models/events/backfill_close_response.rbs new file mode 100644 index 00000000..bb0371e9 --- /dev/null +++ b/sig/orb/models/events/backfill_close_response.rbs @@ -0,0 +1,71 @@ +module Orb + module Models + module Events + type backfill_close_response = + { + id: String, + close_time: Time?, + created_at: Time, + customer_id: String?, + events_ingested: Integer, + reverted_at: Time?, + status: Orb::Models::Events::BackfillCloseResponse::status, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: String? + } + + class BackfillCloseResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor close_time: Time? + + attr_accessor created_at: Time + + attr_accessor customer_id: String? + + attr_accessor events_ingested: Integer + + attr_accessor reverted_at: Time? + + attr_accessor status: Orb::Models::Events::BackfillCloseResponse::status + + attr_accessor timeframe_end: Time + + attr_accessor timeframe_start: Time + + attr_accessor deprecation_filter: String? + + def initialize: + ( + id: String, + close_time: Time?, + created_at: Time, + customer_id: String?, + events_ingested: Integer, + reverted_at: Time?, + status: Orb::Models::Events::BackfillCloseResponse::status, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: String? + ) -> void + | ( + ?Orb::Models::Events::backfill_close_response | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Events::backfill_close_response + + type status = :pending | :reflected | :pending_revert | :reverted + + class Status < Orb::Enum + PENDING: :pending + REFLECTED: :reflected + PENDING_REVERT: :pending_revert + REVERTED: :reverted + + def self.values: -> Array[Orb::Models::Events::BackfillCloseResponse::status] + end + end + end + end +end diff --git a/sig/orb/models/events/backfill_create_params.rbs b/sig/orb/models/events/backfill_create_params.rbs new file mode 100644 index 00000000..517482b7 --- /dev/null +++ b/sig/orb/models/events/backfill_create_params.rbs @@ -0,0 +1,55 @@ +module Orb + module Models + module Events + type backfill_create_params = + { + timeframe_end: Time, + timeframe_start: Time, + close_time: Time?, + customer_id: String?, + deprecation_filter: String?, + external_customer_id: String?, + replace_existing_events: bool + } + & Orb::request_parameters + + class BackfillCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor timeframe_end: Time + + attr_accessor timeframe_start: Time + + attr_accessor close_time: Time? + + attr_accessor customer_id: String? + + attr_accessor deprecation_filter: String? + + attr_accessor external_customer_id: String? + + attr_reader replace_existing_events: bool? + + def replace_existing_events=: (bool) -> void + + def initialize: + ( + timeframe_end: Time, + timeframe_start: Time, + close_time: Time?, + customer_id: String?, + deprecation_filter: String?, + external_customer_id: String?, + replace_existing_events: bool, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Events::backfill_create_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Events::backfill_create_params + end + end + end +end diff --git a/sig/orb/models/events/backfill_create_response.rbs b/sig/orb/models/events/backfill_create_response.rbs new file mode 100644 index 00000000..8a10dbd6 --- /dev/null +++ b/sig/orb/models/events/backfill_create_response.rbs @@ -0,0 +1,71 @@ +module Orb + module Models + module Events + type backfill_create_response = + { + id: String, + close_time: Time?, + created_at: Time, + customer_id: String?, + events_ingested: Integer, + reverted_at: Time?, + status: Orb::Models::Events::BackfillCreateResponse::status, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: String? + } + + class BackfillCreateResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor close_time: Time? + + attr_accessor created_at: Time + + attr_accessor customer_id: String? + + attr_accessor events_ingested: Integer + + attr_accessor reverted_at: Time? + + attr_accessor status: Orb::Models::Events::BackfillCreateResponse::status + + attr_accessor timeframe_end: Time + + attr_accessor timeframe_start: Time + + attr_accessor deprecation_filter: String? + + def initialize: + ( + id: String, + close_time: Time?, + created_at: Time, + customer_id: String?, + events_ingested: Integer, + reverted_at: Time?, + status: Orb::Models::Events::BackfillCreateResponse::status, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: String? + ) -> void + | ( + ?Orb::Models::Events::backfill_create_response | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Events::backfill_create_response + + type status = :pending | :reflected | :pending_revert | :reverted + + class Status < Orb::Enum + PENDING: :pending + REFLECTED: :reflected + PENDING_REVERT: :pending_revert + REVERTED: :reverted + + def self.values: -> Array[Orb::Models::Events::BackfillCreateResponse::status] + end + end + end + end +end diff --git a/sig/orb/models/events/backfill_fetch_params.rbs b/sig/orb/models/events/backfill_fetch_params.rbs new file mode 100644 index 00000000..1987c3b9 --- /dev/null +++ b/sig/orb/models/events/backfill_fetch_params.rbs @@ -0,0 +1,20 @@ +module Orb + module Models + module Events + type backfill_fetch_params = { } & Orb::request_parameters + + class BackfillFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::Events::backfill_fetch_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Events::backfill_fetch_params + end + end + end +end diff --git a/sig/orb/models/events/backfill_fetch_response.rbs b/sig/orb/models/events/backfill_fetch_response.rbs new file mode 100644 index 00000000..73a704bd --- /dev/null +++ b/sig/orb/models/events/backfill_fetch_response.rbs @@ -0,0 +1,71 @@ +module Orb + module Models + module Events + type backfill_fetch_response = + { + id: String, + close_time: Time?, + created_at: Time, + customer_id: String?, + events_ingested: Integer, + reverted_at: Time?, + status: Orb::Models::Events::BackfillFetchResponse::status, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: String? + } + + class BackfillFetchResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor close_time: Time? + + attr_accessor created_at: Time + + attr_accessor customer_id: String? + + attr_accessor events_ingested: Integer + + attr_accessor reverted_at: Time? + + attr_accessor status: Orb::Models::Events::BackfillFetchResponse::status + + attr_accessor timeframe_end: Time + + attr_accessor timeframe_start: Time + + attr_accessor deprecation_filter: String? + + def initialize: + ( + id: String, + close_time: Time?, + created_at: Time, + customer_id: String?, + events_ingested: Integer, + reverted_at: Time?, + status: Orb::Models::Events::BackfillFetchResponse::status, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: String? + ) -> void + | ( + ?Orb::Models::Events::backfill_fetch_response | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Events::backfill_fetch_response + + type status = :pending | :reflected | :pending_revert | :reverted + + class Status < Orb::Enum + PENDING: :pending + REFLECTED: :reflected + PENDING_REVERT: :pending_revert + REVERTED: :reverted + + def self.values: -> Array[Orb::Models::Events::BackfillFetchResponse::status] + end + end + end + end +end diff --git a/sig/orb/models/events/backfill_list_params.rbs b/sig/orb/models/events/backfill_list_params.rbs new file mode 100644 index 00000000..98796400 --- /dev/null +++ b/sig/orb/models/events/backfill_list_params.rbs @@ -0,0 +1,31 @@ +module Orb + module Models + module Events + type backfill_list_params = + { cursor: String?, limit: Integer } & Orb::request_parameters + + class BackfillListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor cursor: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + def initialize: + ( + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Events::backfill_list_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Events::backfill_list_params + end + end + end +end diff --git a/sig/orb/models/events/backfill_list_response.rbs b/sig/orb/models/events/backfill_list_response.rbs new file mode 100644 index 00000000..6bbb38aa --- /dev/null +++ b/sig/orb/models/events/backfill_list_response.rbs @@ -0,0 +1,71 @@ +module Orb + module Models + module Events + type backfill_list_response = + { + id: String, + close_time: Time?, + created_at: Time, + customer_id: String?, + events_ingested: Integer, + reverted_at: Time?, + status: Orb::Models::Events::BackfillListResponse::status, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: String? + } + + class BackfillListResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor close_time: Time? + + attr_accessor created_at: Time + + attr_accessor customer_id: String? + + attr_accessor events_ingested: Integer + + attr_accessor reverted_at: Time? + + attr_accessor status: Orb::Models::Events::BackfillListResponse::status + + attr_accessor timeframe_end: Time + + attr_accessor timeframe_start: Time + + attr_accessor deprecation_filter: String? + + def initialize: + ( + id: String, + close_time: Time?, + created_at: Time, + customer_id: String?, + events_ingested: Integer, + reverted_at: Time?, + status: Orb::Models::Events::BackfillListResponse::status, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: String? + ) -> void + | ( + ?Orb::Models::Events::backfill_list_response | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Events::backfill_list_response + + type status = :pending | :reflected | :pending_revert | :reverted + + class Status < Orb::Enum + PENDING: :pending + REFLECTED: :reflected + PENDING_REVERT: :pending_revert + REVERTED: :reverted + + def self.values: -> Array[Orb::Models::Events::BackfillListResponse::status] + end + end + end + end +end diff --git a/sig/orb/models/events/backfill_revert_params.rbs b/sig/orb/models/events/backfill_revert_params.rbs new file mode 100644 index 00000000..d03ff0cf --- /dev/null +++ b/sig/orb/models/events/backfill_revert_params.rbs @@ -0,0 +1,20 @@ +module Orb + module Models + module Events + type backfill_revert_params = { } & Orb::request_parameters + + class BackfillRevertParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::Events::backfill_revert_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Events::backfill_revert_params + end + end + end +end diff --git a/sig/orb/models/events/backfill_revert_response.rbs b/sig/orb/models/events/backfill_revert_response.rbs new file mode 100644 index 00000000..5ffe9364 --- /dev/null +++ b/sig/orb/models/events/backfill_revert_response.rbs @@ -0,0 +1,71 @@ +module Orb + module Models + module Events + type backfill_revert_response = + { + id: String, + close_time: Time?, + created_at: Time, + customer_id: String?, + events_ingested: Integer, + reverted_at: Time?, + status: Orb::Models::Events::BackfillRevertResponse::status, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: String? + } + + class BackfillRevertResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor close_time: Time? + + attr_accessor created_at: Time + + attr_accessor customer_id: String? + + attr_accessor events_ingested: Integer + + attr_accessor reverted_at: Time? + + attr_accessor status: Orb::Models::Events::BackfillRevertResponse::status + + attr_accessor timeframe_end: Time + + attr_accessor timeframe_start: Time + + attr_accessor deprecation_filter: String? + + def initialize: + ( + id: String, + close_time: Time?, + created_at: Time, + customer_id: String?, + events_ingested: Integer, + reverted_at: Time?, + status: Orb::Models::Events::BackfillRevertResponse::status, + timeframe_end: Time, + timeframe_start: Time, + deprecation_filter: String? + ) -> void + | ( + ?Orb::Models::Events::backfill_revert_response | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Events::backfill_revert_response + + type status = :pending | :reflected | :pending_revert | :reverted + + class Status < Orb::Enum + PENDING: :pending + REFLECTED: :reflected + PENDING_REVERT: :pending_revert + REVERTED: :reverted + + def self.values: -> Array[Orb::Models::Events::BackfillRevertResponse::status] + end + end + end + end +end diff --git a/sig/orb/models/events/event_volumes.rbs b/sig/orb/models/events/event_volumes.rbs new file mode 100644 index 00000000..36bead74 --- /dev/null +++ b/sig/orb/models/events/event_volumes.rbs @@ -0,0 +1,40 @@ +module Orb + module Models + + class EventVolumes = Events::EventVolumes + + module Events + type event_volumes = + { data: Array[Orb::Models::Events::EventVolumes::Data] } + + class EventVolumes < Orb::BaseModel + attr_accessor data: Array[Orb::Models::Events::EventVolumes::Data] + + def initialize: + (data: Array[Orb::Models::Events::EventVolumes::Data]) -> void + | (?Orb::Models::Events::event_volumes | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Events::event_volumes + + type data = + { count: Integer, timeframe_end: Time, timeframe_start: Time } + + class Data < Orb::BaseModel + attr_accessor count: Integer + + attr_accessor timeframe_end: Time + + attr_accessor timeframe_start: Time + + def initialize: + (count: Integer, timeframe_end: Time, timeframe_start: Time) -> void + | ( + ?Orb::Models::Events::EventVolumes::data | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Events::EventVolumes::data + end + end + end + end +end diff --git a/sig/orb/models/events/volume_list_params.rbs b/sig/orb/models/events/volume_list_params.rbs new file mode 100644 index 00000000..ff1f1e5d --- /dev/null +++ b/sig/orb/models/events/volume_list_params.rbs @@ -0,0 +1,45 @@ +module Orb + module Models + module Events + type volume_list_params = + { + timeframe_start: Time, + cursor: String?, + limit: Integer, + timeframe_end: Time + } + & Orb::request_parameters + + class VolumeListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor timeframe_start: Time + + attr_accessor cursor: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + attr_reader timeframe_end: Time? + + def timeframe_end=: (Time) -> void + + def initialize: + ( + timeframe_start: Time, + cursor: String?, + limit: Integer, + timeframe_end: Time, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Events::volume_list_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Events::volume_list_params + end + end + end +end diff --git a/sig/orb/models/invoice.rbs b/sig/orb/models/invoice.rbs new file mode 100644 index 00000000..bd547b72 --- /dev/null +++ b/sig/orb/models/invoice.rbs @@ -0,0 +1,1522 @@ +module Orb + module Models + type invoice = + { + id: String, + amount_due: String, + auto_collection: Orb::Models::Invoice::AutoCollection, + billing_address: Orb::Models::Invoice::BillingAddress?, + created_at: Time, + credit_notes: Array[Orb::Models::Invoice::CreditNote], + currency: String, + customer: Orb::Models::Invoice::Customer, + customer_balance_transactions: Array[Orb::Models::Invoice::CustomerBalanceTransaction], + customer_tax_id: Orb::Models::Invoice::CustomerTaxID?, + discount: top, + discounts: Array[Orb::Models::invoice_level_discount], + due_date: Time?, + eligible_to_issue_at: Time?, + hosted_invoice_url: String?, + invoice_date: Time, + invoice_number: String, + invoice_pdf: String?, + invoice_source: Orb::Models::Invoice::invoice_source, + issue_failed_at: Time?, + issued_at: Time?, + line_items: Array[Orb::Models::Invoice::LineItem], + maximum: Orb::Models::Invoice::Maximum?, + maximum_amount: String?, + memo: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Invoice::Minimum?, + minimum_amount: String?, + paid_at: Time?, + payment_attempts: Array[Orb::Models::Invoice::PaymentAttempt], + payment_failed_at: Time?, + payment_started_at: Time?, + scheduled_issue_at: Time?, + shipping_address: Orb::Models::Invoice::ShippingAddress?, + status: Orb::Models::Invoice::status, + subscription: Orb::Models::Invoice::Subscription?, + subtotal: String, + sync_failed_at: Time?, + total: String, + voided_at: Time?, + will_auto_issue: bool + } + + class Invoice < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount_due: String + + attr_accessor auto_collection: Orb::Models::Invoice::AutoCollection + + attr_accessor billing_address: Orb::Models::Invoice::BillingAddress? + + attr_accessor created_at: Time + + attr_accessor credit_notes: Array[Orb::Models::Invoice::CreditNote] + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::Invoice::Customer + + attr_accessor customer_balance_transactions: Array[Orb::Models::Invoice::CustomerBalanceTransaction] + + attr_accessor customer_tax_id: Orb::Models::Invoice::CustomerTaxID? + + attr_accessor discount: top + + attr_accessor discounts: Array[Orb::Models::invoice_level_discount] + + attr_accessor due_date: Time? + + attr_accessor eligible_to_issue_at: Time? + + attr_accessor hosted_invoice_url: String? + + attr_accessor invoice_date: Time + + attr_accessor invoice_number: String + + attr_accessor invoice_pdf: String? + + attr_accessor invoice_source: Orb::Models::Invoice::invoice_source + + attr_accessor issue_failed_at: Time? + + attr_accessor issued_at: Time? + + attr_accessor line_items: Array[Orb::Models::Invoice::LineItem] + + attr_accessor maximum: Orb::Models::Invoice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor memo: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Invoice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor paid_at: Time? + + attr_accessor payment_attempts: Array[Orb::Models::Invoice::PaymentAttempt] + + attr_accessor payment_failed_at: Time? + + attr_accessor payment_started_at: Time? + + attr_accessor scheduled_issue_at: Time? + + attr_accessor shipping_address: Orb::Models::Invoice::ShippingAddress? + + attr_accessor status: Orb::Models::Invoice::status + + attr_accessor subscription: Orb::Models::Invoice::Subscription? + + attr_accessor subtotal: String + + attr_accessor sync_failed_at: Time? + + attr_accessor total: String + + attr_accessor voided_at: Time? + + attr_accessor will_auto_issue: bool + + def initialize: + ( + id: String, + amount_due: String, + auto_collection: Orb::Models::Invoice::AutoCollection, + billing_address: Orb::Models::Invoice::BillingAddress?, + created_at: Time, + credit_notes: Array[Orb::Models::Invoice::CreditNote], + currency: String, + customer: Orb::Models::Invoice::Customer, + customer_balance_transactions: Array[Orb::Models::Invoice::CustomerBalanceTransaction], + customer_tax_id: Orb::Models::Invoice::CustomerTaxID?, + discount: top, + discounts: Array[Orb::Models::invoice_level_discount], + due_date: Time?, + eligible_to_issue_at: Time?, + hosted_invoice_url: String?, + invoice_date: Time, + invoice_number: String, + invoice_pdf: String?, + invoice_source: Orb::Models::Invoice::invoice_source, + issue_failed_at: Time?, + issued_at: Time?, + line_items: Array[Orb::Models::Invoice::LineItem], + maximum: Orb::Models::Invoice::Maximum?, + maximum_amount: String?, + memo: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Invoice::Minimum?, + minimum_amount: String?, + paid_at: Time?, + payment_attempts: Array[Orb::Models::Invoice::PaymentAttempt], + payment_failed_at: Time?, + payment_started_at: Time?, + scheduled_issue_at: Time?, + shipping_address: Orb::Models::Invoice::ShippingAddress?, + status: Orb::Models::Invoice::status, + subscription: Orb::Models::Invoice::Subscription?, + subtotal: String, + sync_failed_at: Time?, + total: String, + voided_at: Time?, + will_auto_issue: bool + ) -> void + | (?Orb::Models::invoice | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::invoice + + type auto_collection = + { + enabled: bool?, + next_attempt_at: Time?, + num_attempts: Integer?, + previously_attempted_at: Time? + } + + class AutoCollection < Orb::BaseModel + attr_accessor enabled: bool? + + attr_accessor next_attempt_at: Time? + + attr_accessor num_attempts: Integer? + + attr_accessor previously_attempted_at: Time? + + def initialize: + ( + enabled: bool?, + next_attempt_at: Time?, + num_attempts: Integer?, + previously_attempted_at: Time? + ) -> void + | ( + ?Orb::Models::Invoice::auto_collection | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::auto_collection + end + + type billing_address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + + class BillingAddress < Orb::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: + ( + city: String?, + country: String?, + line1: String?, + line2: String?, + postal_code: String?, + state: String? + ) -> void + | ( + ?Orb::Models::Invoice::billing_address | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::billing_address + end + + type credit_note = + { + id: String, + credit_note_number: String, + memo: String?, + reason: String, + total: String, + type: String, + voided_at: Time? + } + + class CreditNote < Orb::BaseModel + attr_accessor id: String + + attr_accessor credit_note_number: String + + attr_accessor memo: String? + + attr_accessor reason: String + + attr_accessor total: String + + attr_accessor type: String + + attr_accessor voided_at: Time? + + def initialize: + ( + id: String, + credit_note_number: String, + memo: String?, + reason: String, + total: String, + type: String, + voided_at: Time? + ) -> void + | (?Orb::Models::Invoice::credit_note | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Invoice::credit_note + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | (?Orb::Models::Invoice::customer | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Invoice::customer + end + + type customer_balance_transaction = + { + id: String, + action: Orb::Models::Invoice::CustomerBalanceTransaction::action, + amount: String, + created_at: Time, + credit_note: Orb::Models::Invoice::CustomerBalanceTransaction::CreditNote?, + description: String?, + ending_balance: String, + invoice: Orb::Models::Invoice::CustomerBalanceTransaction::Invoice?, + starting_balance: String, + type: Orb::Models::Invoice::CustomerBalanceTransaction::type_ + } + + class CustomerBalanceTransaction < Orb::BaseModel + attr_accessor id: String + + attr_accessor action: Orb::Models::Invoice::CustomerBalanceTransaction::action + + attr_accessor amount: String + + attr_accessor created_at: Time + + attr_accessor credit_note: Orb::Models::Invoice::CustomerBalanceTransaction::CreditNote? + + attr_accessor description: String? + + attr_accessor ending_balance: String + + attr_accessor invoice: Orb::Models::Invoice::CustomerBalanceTransaction::Invoice? + + attr_accessor starting_balance: String + + attr_accessor type: Orb::Models::Invoice::CustomerBalanceTransaction::type_ + + def initialize: + ( + id: String, + action: Orb::Models::Invoice::CustomerBalanceTransaction::action, + amount: String, + created_at: Time, + credit_note: Orb::Models::Invoice::CustomerBalanceTransaction::CreditNote?, + description: String?, + ending_balance: String, + invoice: Orb::Models::Invoice::CustomerBalanceTransaction::Invoice?, + starting_balance: String, + type: Orb::Models::Invoice::CustomerBalanceTransaction::type_ + ) -> void + | ( + ?Orb::Models::Invoice::customer_balance_transaction + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::customer_balance_transaction + + type action = + :applied_to_invoice + | :manual_adjustment + | :prorated_refund + | :revert_prorated_refund + | :return_from_voiding + | :credit_note_applied + | :credit_note_voided + | :overpayment_refund + + class Action < Orb::Enum + APPLIED_TO_INVOICE: :applied_to_invoice + MANUAL_ADJUSTMENT: :manual_adjustment + PRORATED_REFUND: :prorated_refund + REVERT_PRORATED_REFUND: :revert_prorated_refund + RETURN_FROM_VOIDING: :return_from_voiding + CREDIT_NOTE_APPLIED: :credit_note_applied + CREDIT_NOTE_VOIDED: :credit_note_voided + OVERPAYMENT_REFUND: :overpayment_refund + + def self.values: -> Array[Orb::Models::Invoice::CustomerBalanceTransaction::action] + end + + type credit_note = { id: String } + + class CreditNote < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Invoice::CustomerBalanceTransaction::credit_note + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::CustomerBalanceTransaction::credit_note + end + + type invoice = { id: String } + + class Invoice < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Invoice::CustomerBalanceTransaction::invoice + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::CustomerBalanceTransaction::invoice + end + + type type_ = :increment | :decrement + + class Type < Orb::Enum + INCREMENT: :increment + DECREMENT: :decrement + + def self.values: -> Array[Orb::Models::Invoice::CustomerBalanceTransaction::type_] + end + end + + type customer_tax_id = + { + country: Orb::Models::Invoice::CustomerTaxID::country, + type: Orb::Models::Invoice::CustomerTaxID::type_, + value: String + } + + class CustomerTaxID < Orb::BaseModel + attr_accessor country: Orb::Models::Invoice::CustomerTaxID::country + + attr_accessor type: Orb::Models::Invoice::CustomerTaxID::type_ + + attr_accessor value: String + + def initialize: + ( + country: Orb::Models::Invoice::CustomerTaxID::country, + type: Orb::Models::Invoice::CustomerTaxID::type_, + value: String + ) -> void + | ( + ?Orb::Models::Invoice::customer_tax_id | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::customer_tax_id + + type country = + :AD + | :AE + | :AR + | :AT + | :AU + | :BE + | :BG + | :BH + | :BO + | :BR + | :CA + | :CH + | :CL + | :CN + | :CO + | :CR + | :CY + | :CZ + | :DE + | :DK + | :EE + | :DO + | :EC + | :EG + | :ES + | :EU + | :FI + | :FR + | :GB + | :GE + | :GR + | :HK + | :HR + | :HU + | :ID + | :IE + | :IL + | :IN + | :IS + | :IT + | :JP + | :KE + | :KR + | :KZ + | :LI + | :LT + | :LU + | :LV + | :MT + | :MX + | :MY + | :NG + | :NL + | :NO + | :NZ + | :OM + | :PE + | :PH + | :PL + | :PT + | :RO + | :RS + | :RU + | :SA + | :SE + | :SG + | :SI + | :SK + | :SV + | :TH + | :TR + | :TW + | :UA + | :US + | :UY + | :VE + | :VN + | :ZA + + class Country < Orb::Enum + AD: :AD + AE: :AE + AR: :AR + AT: :AT + AU: :AU + BE: :BE + BG: :BG + BH: :BH + BO: :BO + BR: :BR + CA: :CA + CH: :CH + CL: :CL + CN: :CN + CO: :CO + CR: :CR + CY: :CY + CZ: :CZ + DE: :DE + DK: :DK + EE: :EE + DO: :DO + EC: :EC + EG: :EG + ES: :ES + EU: :EU + FI: :FI + FR: :FR + GB: :GB + GE: :GE + GR: :GR + HK: :HK + HR: :HR + HU: :HU + ID: :ID + IE: :IE + IL: :IL + IN: :IN + IS: :IS + IT: :IT + JP: :JP + KE: :KE + KR: :KR + KZ: :KZ + LI: :LI + LT: :LT + LU: :LU + LV: :LV + MT: :MT + MX: :MX + MY: :MY + NG: :NG + NL: :NL + NO: :NO + NZ: :NZ + OM: :OM + PE: :PE + PH: :PH + PL: :PL + PT: :PT + RO: :RO + RS: :RS + RU: :RU + SA: :SA + SE: :SE + SG: :SG + SI: :SI + SK: :SK + SV: :SV + TH: :TH + TR: :TR + TW: :TW + UA: :UA + US: :US + UY: :UY + VE: :VE + VN: :VN + ZA: :ZA + + def self.values: -> Array[Orb::Models::Invoice::CustomerTaxID::country] + end + + type type_ = + :ad_nrt + | :ae_trn + | :ar_cuit + | :eu_vat + | :au_abn + | :au_arn + | :bg_uic + | :bh_vat + | :bo_tin + | :br_cnpj + | :br_cpf + | :ca_bn + | :ca_gst_hst + | :ca_pst_bc + | :ca_pst_mb + | :ca_pst_sk + | :ca_qst + | :ch_vat + | :cl_tin + | :cn_tin + | :co_nit + | :cr_tin + | :do_rcn + | :ec_ruc + | :eg_tin + | :es_cif + | :eu_oss_vat + | :gb_vat + | :ge_vat + | :hk_br + | :hu_tin + | :id_npwp + | :il_vat + | :in_gst + | :is_vat + | :jp_cn + | :jp_rn + | :jp_trn + | :ke_pin + | :kr_brn + | :kz_bin + | :li_uid + | :mx_rfc + | :my_frp + | :my_itn + | :my_sst + | :ng_tin + | :no_vat + | :no_voec + | :nz_gst + | :om_vat + | :pe_ruc + | :ph_tin + | :ro_tin + | :rs_pib + | :ru_inn + | :ru_kpp + | :sa_vat + | :sg_gst + | :sg_uen + | :si_tin + | :sv_nit + | :th_vat + | :tr_tin + | :tw_vat + | :ua_vat + | :us_ein + | :uy_ruc + | :ve_rif + | :vn_tin + | :za_vat + + class Type < Orb::Enum + AD_NRT: :ad_nrt + AE_TRN: :ae_trn + AR_CUIT: :ar_cuit + EU_VAT: :eu_vat + AU_ABN: :au_abn + AU_ARN: :au_arn + BG_UIC: :bg_uic + BH_VAT: :bh_vat + BO_TIN: :bo_tin + BR_CNPJ: :br_cnpj + BR_CPF: :br_cpf + CA_BN: :ca_bn + CA_GST_HST: :ca_gst_hst + CA_PST_BC: :ca_pst_bc + CA_PST_MB: :ca_pst_mb + CA_PST_SK: :ca_pst_sk + CA_QST: :ca_qst + CH_VAT: :ch_vat + CL_TIN: :cl_tin + CN_TIN: :cn_tin + CO_NIT: :co_nit + CR_TIN: :cr_tin + DO_RCN: :do_rcn + EC_RUC: :ec_ruc + EG_TIN: :eg_tin + ES_CIF: :es_cif + EU_OSS_VAT: :eu_oss_vat + GB_VAT: :gb_vat + GE_VAT: :ge_vat + HK_BR: :hk_br + HU_TIN: :hu_tin + ID_NPWP: :id_npwp + IL_VAT: :il_vat + IN_GST: :in_gst + IS_VAT: :is_vat + JP_CN: :jp_cn + JP_RN: :jp_rn + JP_TRN: :jp_trn + KE_PIN: :ke_pin + KR_BRN: :kr_brn + KZ_BIN: :kz_bin + LI_UID: :li_uid + MX_RFC: :mx_rfc + MY_FRP: :my_frp + MY_ITN: :my_itn + MY_SST: :my_sst + NG_TIN: :ng_tin + NO_VAT: :no_vat + NO_VOEC: :no_voec + NZ_GST: :nz_gst + OM_VAT: :om_vat + PE_RUC: :pe_ruc + PH_TIN: :ph_tin + RO_TIN: :ro_tin + RS_PIB: :rs_pib + RU_INN: :ru_inn + RU_KPP: :ru_kpp + SA_VAT: :sa_vat + SG_GST: :sg_gst + SG_UEN: :sg_uen + SI_TIN: :si_tin + SV_NIT: :sv_nit + TH_VAT: :th_vat + TR_TIN: :tr_tin + TW_VAT: :tw_vat + UA_VAT: :ua_vat + US_EIN: :us_ein + UY_RUC: :uy_ruc + VE_RIF: :ve_rif + VN_TIN: :vn_tin + ZA_VAT: :za_vat + + def self.values: -> Array[Orb::Models::Invoice::CustomerTaxID::type_] + end + end + + type invoice_source = :subscription | :partial | :one_off + + class InvoiceSource < Orb::Enum + SUBSCRIPTION: :subscription + PARTIAL: :partial + ONE_OFF: :one_off + + def self.values: -> Array[Orb::Models::Invoice::invoice_source] + end + + type line_item = + { + id: String, + adjusted_subtotal: String, + adjustments: Array[Orb::Models::Invoice::LineItem::adjustment], + amount: String, + credits_applied: String, + discount: Orb::Models::discount?, + end_date: Time, + grouping: String?, + maximum: Orb::Models::Invoice::LineItem::Maximum?, + maximum_amount: String?, + minimum: Orb::Models::Invoice::LineItem::Minimum?, + minimum_amount: String?, + name: String, + partially_invoiced_amount: String, + price: Orb::Models::price?, + quantity: Float, + start_date: Time, + sub_line_items: Array[Orb::Models::Invoice::LineItem::sub_line_item], + subtotal: String, + tax_amounts: Array[Orb::Models::Invoice::LineItem::TaxAmount] + } + + class LineItem < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjusted_subtotal: String + + attr_accessor adjustments: Array[Orb::Models::Invoice::LineItem::adjustment] + + attr_accessor amount: String + + attr_accessor credits_applied: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor end_date: Time + + attr_accessor grouping: String? + + attr_accessor maximum: Orb::Models::Invoice::LineItem::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor minimum: Orb::Models::Invoice::LineItem::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor name: String + + attr_accessor partially_invoiced_amount: String + + attr_accessor price: Orb::Models::price? + + attr_accessor quantity: Float + + attr_accessor start_date: Time + + attr_accessor sub_line_items: Array[Orb::Models::Invoice::LineItem::sub_line_item] + + attr_accessor subtotal: String + + attr_accessor tax_amounts: Array[Orb::Models::Invoice::LineItem::TaxAmount] + + def initialize: + ( + id: String, + adjusted_subtotal: String, + adjustments: Array[Orb::Models::Invoice::LineItem::adjustment], + amount: String, + credits_applied: String, + discount: Orb::Models::discount?, + end_date: Time, + grouping: String?, + maximum: Orb::Models::Invoice::LineItem::Maximum?, + maximum_amount: String?, + minimum: Orb::Models::Invoice::LineItem::Minimum?, + minimum_amount: String?, + name: String, + partially_invoiced_amount: String, + price: Orb::Models::price?, + quantity: Float, + start_date: Time, + sub_line_items: Array[Orb::Models::Invoice::LineItem::sub_line_item], + subtotal: String, + tax_amounts: Array[Orb::Models::Invoice::LineItem::TaxAmount] + ) -> void + | (?Orb::Models::Invoice::line_item | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Invoice::line_item + + type adjustment = + Orb::Models::Invoice::LineItem::Adjustment::AmountDiscountAdjustment + | Orb::Models::Invoice::LineItem::Adjustment::PercentageDiscountAdjustment + | Orb::Models::Invoice::LineItem::Adjustment::UsageDiscountAdjustment + | Orb::Models::Invoice::LineItem::Adjustment::MinimumAdjustment + | Orb::Models::Invoice::LineItem::Adjustment::MaximumAdjustment + + class Adjustment < Orb::Union + type amount_discount_adjustment = + { + id: String, + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String? + } + + class AmountDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::Invoice::LineItem::Adjustment::amount_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::LineItem::Adjustment::amount_discount_adjustment + end + + type percentage_discount_adjustment = + { + id: String, + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String? + } + + class PercentageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor percentage_discount: Float + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::Invoice::LineItem::Adjustment::percentage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::LineItem::Adjustment::percentage_discount_adjustment + end + + type usage_discount_adjustment = + { + id: String, + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float + } + + class UsageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + attr_accessor usage_discount: Float + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::Invoice::LineItem::Adjustment::usage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::LineItem::Adjustment::usage_discount_adjustment + end + + type minimum_adjustment = + { + id: String, + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MinimumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::Invoice::LineItem::Adjustment::minimum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::LineItem::Adjustment::minimum_adjustment + end + + type maximum_adjustment = + { + id: String, + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MaximumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor maximum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::Invoice::LineItem::Adjustment::maximum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::LineItem::Adjustment::maximum_adjustment + end + + private def self.variants: -> [[:amount_discount, Orb::Models::Invoice::LineItem::Adjustment::AmountDiscountAdjustment], [:percentage_discount, Orb::Models::Invoice::LineItem::Adjustment::PercentageDiscountAdjustment], [:usage_discount, Orb::Models::Invoice::LineItem::Adjustment::UsageDiscountAdjustment], [:minimum, Orb::Models::Invoice::LineItem::Adjustment::MinimumAdjustment], [:maximum, Orb::Models::Invoice::LineItem::Adjustment::MaximumAdjustment]] + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Invoice::LineItem::maximum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::LineItem::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Invoice::LineItem::minimum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::LineItem::minimum + end + + type sub_line_item = + Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem + | Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem + | Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem + + class SubLineItem < Orb::Union + type matrix_sub_line_item = + { + amount: String, + grouping: Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::Grouping?, + matrix_config: Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig, + name: String, + quantity: Float, + type: :matrix + } + + class MatrixSubLineItem < Orb::BaseModel + attr_accessor amount: String + + attr_accessor grouping: Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::Grouping? + + attr_accessor matrix_config: Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig + + attr_accessor name: String + + attr_accessor quantity: Float + + attr_accessor type: :matrix + + def initialize: + ( + amount: String, + grouping: Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::Grouping?, + matrix_config: Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig, + name: String, + quantity: Float, + type: :matrix + ) -> void + | ( + ?Orb::Models::Invoice::LineItem::SubLineItem::matrix_sub_line_item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::LineItem::SubLineItem::matrix_sub_line_item + + type grouping = { key: String, value: String? } + + class Grouping < Orb::BaseModel + attr_accessor key: String + + attr_accessor value: String? + + def initialize: + (key: String, value: String?) -> void + | ( + ?Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::grouping + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::grouping + end + + type matrix_config = { dimension_values: Array[String?] } + + class MatrixConfig < Orb::BaseModel + attr_accessor dimension_values: Array[String?] + + def initialize: + (dimension_values: Array[String?]) -> void + | ( + ?Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::matrix_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem::matrix_config + end + end + + type tier_sub_line_item = + { + amount: String, + grouping: Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::Grouping?, + name: String, + quantity: Float, + tier_config: Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::TierConfig, + type: :tier + } + + class TierSubLineItem < Orb::BaseModel + attr_accessor amount: String + + attr_accessor grouping: Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::Grouping? + + attr_accessor name: String + + attr_accessor quantity: Float + + attr_accessor tier_config: Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::TierConfig + + attr_accessor type: :tier + + def initialize: + ( + amount: String, + grouping: Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::Grouping?, + name: String, + quantity: Float, + tier_config: Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::TierConfig, + type: :tier + ) -> void + | ( + ?Orb::Models::Invoice::LineItem::SubLineItem::tier_sub_line_item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::LineItem::SubLineItem::tier_sub_line_item + + type grouping = { key: String, value: String? } + + class Grouping < Orb::BaseModel + attr_accessor key: String + + attr_accessor value: String? + + def initialize: + (key: String, value: String?) -> void + | ( + ?Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::grouping + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::grouping + end + + type tier_config = + { first_unit: Float, last_unit: Float?, unit_amount: String } + + class TierConfig < Orb::BaseModel + attr_accessor first_unit: Float + + attr_accessor last_unit: Float? + + attr_accessor unit_amount: String + + def initialize: + ( + first_unit: Float, + last_unit: Float?, + unit_amount: String + ) -> void + | ( + ?Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::tier_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem::tier_config + end + end + + type other_sub_line_item = + { + amount: String, + grouping: Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem::Grouping?, + name: String, + quantity: Float, + type: :"'null'" + } + + class OtherSubLineItem < Orb::BaseModel + attr_accessor amount: String + + attr_accessor grouping: Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem::Grouping? + + attr_accessor name: String + + attr_accessor quantity: Float + + attr_accessor type: :"'null'" + + def initialize: + ( + amount: String, + grouping: Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem::Grouping?, + name: String, + quantity: Float, + type: :"'null'" + ) -> void + | ( + ?Orb::Models::Invoice::LineItem::SubLineItem::other_sub_line_item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::LineItem::SubLineItem::other_sub_line_item + + type grouping = { key: String, value: String? } + + class Grouping < Orb::BaseModel + attr_accessor key: String + + attr_accessor value: String? + + def initialize: + (key: String, value: String?) -> void + | ( + ?Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem::grouping + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem::grouping + end + end + + private def self.variants: -> [[:matrix, Orb::Models::Invoice::LineItem::SubLineItem::MatrixSubLineItem], [:tier, Orb::Models::Invoice::LineItem::SubLineItem::TierSubLineItem], [:"'null'", Orb::Models::Invoice::LineItem::SubLineItem::OtherSubLineItem]] + end + + type tax_amount = + { + amount: String, + tax_rate_description: String, + tax_rate_percentage: String? + } + + class TaxAmount < Orb::BaseModel + attr_accessor amount: String + + attr_accessor tax_rate_description: String + + attr_accessor tax_rate_percentage: String? + + def initialize: + ( + amount: String, + tax_rate_description: String, + tax_rate_percentage: String? + ) -> void + | ( + ?Orb::Models::Invoice::LineItem::tax_amount | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::LineItem::tax_amount + end + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + (applies_to_price_ids: Array[String], maximum_amount: String) -> void + | (?Orb::Models::Invoice::maximum | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Invoice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + (applies_to_price_ids: Array[String], minimum_amount: String) -> void + | (?Orb::Models::Invoice::minimum | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Invoice::minimum + end + + type payment_attempt = + { + id: String, + amount: String, + created_at: Time, + payment_provider: Orb::Models::Invoice::PaymentAttempt::payment_provider?, + payment_provider_id: String?, + succeeded: bool + } + + class PaymentAttempt < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: String + + attr_accessor created_at: Time + + attr_accessor payment_provider: Orb::Models::Invoice::PaymentAttempt::payment_provider? + + attr_accessor payment_provider_id: String? + + attr_accessor succeeded: bool + + def initialize: + ( + id: String, + amount: String, + created_at: Time, + payment_provider: Orb::Models::Invoice::PaymentAttempt::payment_provider?, + payment_provider_id: String?, + succeeded: bool + ) -> void + | ( + ?Orb::Models::Invoice::payment_attempt | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::payment_attempt + + type payment_provider = :stripe + + class PaymentProvider < Orb::Enum + STRIPE: :stripe + + def self.values: -> Array[Orb::Models::Invoice::PaymentAttempt::payment_provider] + end + end + + type shipping_address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + + class ShippingAddress < Orb::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: + ( + city: String?, + country: String?, + line1: String?, + line2: String?, + postal_code: String?, + state: String? + ) -> void + | ( + ?Orb::Models::Invoice::shipping_address | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Invoice::shipping_address + end + + type status = :issued | :paid | :synced | :void | :draft + + class Status < Orb::Enum + ISSUED: :issued + PAID: :paid + SYNCED: :synced + VOID: :void + DRAFT: :draft + + def self.values: -> Array[Orb::Models::Invoice::status] + end + + type subscription = { id: String } + + class Subscription < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | (?Orb::Models::Invoice::subscription | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Invoice::subscription + end + end + end +end diff --git a/sig/orb/models/invoice_create_params.rbs b/sig/orb/models/invoice_create_params.rbs new file mode 100644 index 00000000..32ea1ce7 --- /dev/null +++ b/sig/orb/models/invoice_create_params.rbs @@ -0,0 +1,129 @@ +module Orb + module Models + type invoice_create_params = + { + currency: String, + invoice_date: Time, + line_items: Array[Orb::Models::InvoiceCreateParams::LineItem], + net_terms: Integer, + customer_id: String?, + discount: Orb::Models::discount?, + external_customer_id: String?, + memo: String?, + metadata: Hash[Symbol, String?]?, + will_auto_issue: bool + } + & Orb::request_parameters + + class InvoiceCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor currency: String + + attr_accessor invoice_date: Time + + attr_accessor line_items: Array[Orb::Models::InvoiceCreateParams::LineItem] + + attr_accessor net_terms: Integer + + attr_accessor customer_id: String? + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_customer_id: String? + + attr_accessor memo: String? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_reader will_auto_issue: bool? + + def will_auto_issue=: (bool) -> void + + def initialize: + ( + currency: String, + invoice_date: Time, + line_items: Array[Orb::Models::InvoiceCreateParams::LineItem], + net_terms: Integer, + customer_id: String?, + discount: Orb::Models::discount?, + external_customer_id: String?, + memo: String?, + metadata: Hash[Symbol, String?]?, + will_auto_issue: bool, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::invoice_create_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::invoice_create_params + + type line_item = + { + end_date: Date, + item_id: String, + model_type: Orb::Models::InvoiceCreateParams::LineItem::model_type, + name: String, + quantity: Float, + start_date: Date, + unit_config: Orb::Models::InvoiceCreateParams::LineItem::UnitConfig + } + + class LineItem < Orb::BaseModel + attr_accessor end_date: Date + + attr_accessor item_id: String + + attr_accessor model_type: Orb::Models::InvoiceCreateParams::LineItem::model_type + + attr_accessor name: String + + attr_accessor quantity: Float + + attr_accessor start_date: Date + + attr_accessor unit_config: Orb::Models::InvoiceCreateParams::LineItem::UnitConfig + + def initialize: + ( + end_date: Date, + item_id: String, + model_type: Orb::Models::InvoiceCreateParams::LineItem::model_type, + name: String, + quantity: Float, + start_date: Date, + unit_config: Orb::Models::InvoiceCreateParams::LineItem::UnitConfig + ) -> void + | ( + ?Orb::Models::InvoiceCreateParams::line_item | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceCreateParams::line_item + + type model_type = :unit + + class ModelType < Orb::Enum + UNIT: :unit + + def self.values: -> Array[Orb::Models::InvoiceCreateParams::LineItem::model_type] + end + + type unit_config = { unit_amount: String } + + class UnitConfig < Orb::BaseModel + attr_accessor unit_amount: String + + def initialize: + (unit_amount: String) -> void + | ( + ?Orb::Models::InvoiceCreateParams::LineItem::unit_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceCreateParams::LineItem::unit_config + end + end + end + end +end diff --git a/sig/orb/models/invoice_fetch_params.rbs b/sig/orb/models/invoice_fetch_params.rbs new file mode 100644 index 00000000..f1f33b5c --- /dev/null +++ b/sig/orb/models/invoice_fetch_params.rbs @@ -0,0 +1,16 @@ +module Orb + module Models + type invoice_fetch_params = { } & Orb::request_parameters + + class InvoiceFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | (?Orb::Models::invoice_fetch_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::invoice_fetch_params + end + end +end diff --git a/sig/orb/models/invoice_fetch_upcoming_params.rbs b/sig/orb/models/invoice_fetch_upcoming_params.rbs new file mode 100644 index 00000000..1e194501 --- /dev/null +++ b/sig/orb/models/invoice_fetch_upcoming_params.rbs @@ -0,0 +1,21 @@ +module Orb + module Models + type invoice_fetch_upcoming_params = + { subscription_id: String } & Orb::request_parameters + + class InvoiceFetchUpcomingParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor subscription_id: String + + def initialize: + (subscription_id: String, request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::invoice_fetch_upcoming_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::invoice_fetch_upcoming_params + end + end +end diff --git a/sig/orb/models/invoice_fetch_upcoming_response.rbs b/sig/orb/models/invoice_fetch_upcoming_response.rbs new file mode 100644 index 00000000..bf981a19 --- /dev/null +++ b/sig/orb/models/invoice_fetch_upcoming_response.rbs @@ -0,0 +1,1550 @@ +module Orb + module Models + type invoice_fetch_upcoming_response = + { + id: String, + amount_due: String, + auto_collection: Orb::Models::InvoiceFetchUpcomingResponse::AutoCollection, + billing_address: Orb::Models::InvoiceFetchUpcomingResponse::BillingAddress?, + created_at: Time, + credit_notes: Array[Orb::Models::InvoiceFetchUpcomingResponse::CreditNote], + currency: String, + customer: Orb::Models::InvoiceFetchUpcomingResponse::Customer, + customer_balance_transactions: Array[Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction], + customer_tax_id: Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID?, + discount: top, + discounts: Array[Orb::Models::invoice_level_discount], + due_date: Time?, + eligible_to_issue_at: Time?, + hosted_invoice_url: String?, + invoice_number: String, + invoice_pdf: String?, + invoice_source: Orb::Models::InvoiceFetchUpcomingResponse::invoice_source, + issue_failed_at: Time?, + issued_at: Time?, + line_items: Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem], + maximum: Orb::Models::InvoiceFetchUpcomingResponse::Maximum?, + maximum_amount: String?, + memo: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::InvoiceFetchUpcomingResponse::Minimum?, + minimum_amount: String?, + paid_at: Time?, + payment_attempts: Array[Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt], + payment_failed_at: Time?, + payment_started_at: Time?, + scheduled_issue_at: Time?, + shipping_address: Orb::Models::InvoiceFetchUpcomingResponse::ShippingAddress?, + status: Orb::Models::InvoiceFetchUpcomingResponse::status, + subscription: Orb::Models::InvoiceFetchUpcomingResponse::Subscription?, + subtotal: String, + sync_failed_at: Time?, + target_date: Time, + total: String, + voided_at: Time?, + will_auto_issue: bool + } + + class InvoiceFetchUpcomingResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount_due: String + + attr_accessor auto_collection: Orb::Models::InvoiceFetchUpcomingResponse::AutoCollection + + attr_accessor billing_address: Orb::Models::InvoiceFetchUpcomingResponse::BillingAddress? + + attr_accessor created_at: Time + + attr_accessor credit_notes: Array[Orb::Models::InvoiceFetchUpcomingResponse::CreditNote] + + attr_accessor currency: String + + attr_accessor customer: Orb::Models::InvoiceFetchUpcomingResponse::Customer + + attr_accessor customer_balance_transactions: Array[Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction] + + attr_accessor customer_tax_id: Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID? + + attr_accessor discount: top + + attr_accessor discounts: Array[Orb::Models::invoice_level_discount] + + attr_accessor due_date: Time? + + attr_accessor eligible_to_issue_at: Time? + + attr_accessor hosted_invoice_url: String? + + attr_accessor invoice_number: String + + attr_accessor invoice_pdf: String? + + attr_accessor invoice_source: Orb::Models::InvoiceFetchUpcomingResponse::invoice_source + + attr_accessor issue_failed_at: Time? + + attr_accessor issued_at: Time? + + attr_accessor line_items: Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem] + + attr_accessor maximum: Orb::Models::InvoiceFetchUpcomingResponse::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor memo: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::InvoiceFetchUpcomingResponse::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor paid_at: Time? + + attr_accessor payment_attempts: Array[Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt] + + attr_accessor payment_failed_at: Time? + + attr_accessor payment_started_at: Time? + + attr_accessor scheduled_issue_at: Time? + + attr_accessor shipping_address: Orb::Models::InvoiceFetchUpcomingResponse::ShippingAddress? + + attr_accessor status: Orb::Models::InvoiceFetchUpcomingResponse::status + + attr_accessor subscription: Orb::Models::InvoiceFetchUpcomingResponse::Subscription? + + attr_accessor subtotal: String + + attr_accessor sync_failed_at: Time? + + attr_accessor target_date: Time + + attr_accessor total: String + + attr_accessor voided_at: Time? + + attr_accessor will_auto_issue: bool + + def initialize: + ( + id: String, + amount_due: String, + auto_collection: Orb::Models::InvoiceFetchUpcomingResponse::AutoCollection, + billing_address: Orb::Models::InvoiceFetchUpcomingResponse::BillingAddress?, + created_at: Time, + credit_notes: Array[Orb::Models::InvoiceFetchUpcomingResponse::CreditNote], + currency: String, + customer: Orb::Models::InvoiceFetchUpcomingResponse::Customer, + customer_balance_transactions: Array[Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction], + customer_tax_id: Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID?, + discount: top, + discounts: Array[Orb::Models::invoice_level_discount], + due_date: Time?, + eligible_to_issue_at: Time?, + hosted_invoice_url: String?, + invoice_number: String, + invoice_pdf: String?, + invoice_source: Orb::Models::InvoiceFetchUpcomingResponse::invoice_source, + issue_failed_at: Time?, + issued_at: Time?, + line_items: Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem], + maximum: Orb::Models::InvoiceFetchUpcomingResponse::Maximum?, + maximum_amount: String?, + memo: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::InvoiceFetchUpcomingResponse::Minimum?, + minimum_amount: String?, + paid_at: Time?, + payment_attempts: Array[Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt], + payment_failed_at: Time?, + payment_started_at: Time?, + scheduled_issue_at: Time?, + shipping_address: Orb::Models::InvoiceFetchUpcomingResponse::ShippingAddress?, + status: Orb::Models::InvoiceFetchUpcomingResponse::status, + subscription: Orb::Models::InvoiceFetchUpcomingResponse::Subscription?, + subtotal: String, + sync_failed_at: Time?, + target_date: Time, + total: String, + voided_at: Time?, + will_auto_issue: bool + ) -> void + | ( + ?Orb::Models::invoice_fetch_upcoming_response | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::invoice_fetch_upcoming_response + + type auto_collection = + { + enabled: bool?, + next_attempt_at: Time?, + num_attempts: Integer?, + previously_attempted_at: Time? + } + + class AutoCollection < Orb::BaseModel + attr_accessor enabled: bool? + + attr_accessor next_attempt_at: Time? + + attr_accessor num_attempts: Integer? + + attr_accessor previously_attempted_at: Time? + + def initialize: + ( + enabled: bool?, + next_attempt_at: Time?, + num_attempts: Integer?, + previously_attempted_at: Time? + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::auto_collection + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::auto_collection + end + + type billing_address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + + class BillingAddress < Orb::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: + ( + city: String?, + country: String?, + line1: String?, + line2: String?, + postal_code: String?, + state: String? + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::billing_address + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::billing_address + end + + type credit_note = + { + id: String, + credit_note_number: String, + memo: String?, + reason: String, + total: String, + type: String, + voided_at: Time? + } + + class CreditNote < Orb::BaseModel + attr_accessor id: String + + attr_accessor credit_note_number: String + + attr_accessor memo: String? + + attr_accessor reason: String + + attr_accessor total: String + + attr_accessor type: String + + attr_accessor voided_at: Time? + + def initialize: + ( + id: String, + credit_note_number: String, + memo: String?, + reason: String, + total: String, + type: String, + voided_at: Time? + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::credit_note + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::credit_note + end + + type customer = { id: String, external_customer_id: String? } + + class Customer < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::customer + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::customer + end + + type customer_balance_transaction = + { + id: String, + action: Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::action, + amount: String, + created_at: Time, + credit_note: Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::CreditNote?, + description: String?, + ending_balance: String, + invoice: Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Invoice?, + starting_balance: String, + type: Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::type_ + } + + class CustomerBalanceTransaction < Orb::BaseModel + attr_accessor id: String + + attr_accessor action: Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::action + + attr_accessor amount: String + + attr_accessor created_at: Time + + attr_accessor credit_note: Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::CreditNote? + + attr_accessor description: String? + + attr_accessor ending_balance: String + + attr_accessor invoice: Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Invoice? + + attr_accessor starting_balance: String + + attr_accessor type: Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::type_ + + def initialize: + ( + id: String, + action: Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::action, + amount: String, + created_at: Time, + credit_note: Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::CreditNote?, + description: String?, + ending_balance: String, + invoice: Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::Invoice?, + starting_balance: String, + type: Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::type_ + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::customer_balance_transaction + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::customer_balance_transaction + + type action = + :applied_to_invoice + | :manual_adjustment + | :prorated_refund + | :revert_prorated_refund + | :return_from_voiding + | :credit_note_applied + | :credit_note_voided + | :overpayment_refund + + class Action < Orb::Enum + APPLIED_TO_INVOICE: :applied_to_invoice + MANUAL_ADJUSTMENT: :manual_adjustment + PRORATED_REFUND: :prorated_refund + REVERT_PRORATED_REFUND: :revert_prorated_refund + RETURN_FROM_VOIDING: :return_from_voiding + CREDIT_NOTE_APPLIED: :credit_note_applied + CREDIT_NOTE_VOIDED: :credit_note_voided + OVERPAYMENT_REFUND: :overpayment_refund + + def self.values: -> Array[Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::action] + end + + type credit_note = { id: String } + + class CreditNote < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::credit_note + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::credit_note + end + + type invoice = { id: String } + + class Invoice < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::invoice + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::invoice + end + + type type_ = :increment | :decrement + + class Type < Orb::Enum + INCREMENT: :increment + DECREMENT: :decrement + + def self.values: -> Array[Orb::Models::InvoiceFetchUpcomingResponse::CustomerBalanceTransaction::type_] + end + end + + type customer_tax_id = + { + country: Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::country, + type: Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::type_, + value: String + } + + class CustomerTaxID < Orb::BaseModel + attr_accessor country: Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::country + + attr_accessor type: Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::type_ + + attr_accessor value: String + + def initialize: + ( + country: Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::country, + type: Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::type_, + value: String + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::customer_tax_id + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::customer_tax_id + + type country = + :AD + | :AE + | :AR + | :AT + | :AU + | :BE + | :BG + | :BH + | :BO + | :BR + | :CA + | :CH + | :CL + | :CN + | :CO + | :CR + | :CY + | :CZ + | :DE + | :DK + | :EE + | :DO + | :EC + | :EG + | :ES + | :EU + | :FI + | :FR + | :GB + | :GE + | :GR + | :HK + | :HR + | :HU + | :ID + | :IE + | :IL + | :IN + | :IS + | :IT + | :JP + | :KE + | :KR + | :KZ + | :LI + | :LT + | :LU + | :LV + | :MT + | :MX + | :MY + | :NG + | :NL + | :NO + | :NZ + | :OM + | :PE + | :PH + | :PL + | :PT + | :RO + | :RS + | :RU + | :SA + | :SE + | :SG + | :SI + | :SK + | :SV + | :TH + | :TR + | :TW + | :UA + | :US + | :UY + | :VE + | :VN + | :ZA + + class Country < Orb::Enum + AD: :AD + AE: :AE + AR: :AR + AT: :AT + AU: :AU + BE: :BE + BG: :BG + BH: :BH + BO: :BO + BR: :BR + CA: :CA + CH: :CH + CL: :CL + CN: :CN + CO: :CO + CR: :CR + CY: :CY + CZ: :CZ + DE: :DE + DK: :DK + EE: :EE + DO: :DO + EC: :EC + EG: :EG + ES: :ES + EU: :EU + FI: :FI + FR: :FR + GB: :GB + GE: :GE + GR: :GR + HK: :HK + HR: :HR + HU: :HU + ID: :ID + IE: :IE + IL: :IL + IN: :IN + IS: :IS + IT: :IT + JP: :JP + KE: :KE + KR: :KR + KZ: :KZ + LI: :LI + LT: :LT + LU: :LU + LV: :LV + MT: :MT + MX: :MX + MY: :MY + NG: :NG + NL: :NL + NO: :NO + NZ: :NZ + OM: :OM + PE: :PE + PH: :PH + PL: :PL + PT: :PT + RO: :RO + RS: :RS + RU: :RU + SA: :SA + SE: :SE + SG: :SG + SI: :SI + SK: :SK + SV: :SV + TH: :TH + TR: :TR + TW: :TW + UA: :UA + US: :US + UY: :UY + VE: :VE + VN: :VN + ZA: :ZA + + def self.values: -> Array[Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::country] + end + + type type_ = + :ad_nrt + | :ae_trn + | :ar_cuit + | :eu_vat + | :au_abn + | :au_arn + | :bg_uic + | :bh_vat + | :bo_tin + | :br_cnpj + | :br_cpf + | :ca_bn + | :ca_gst_hst + | :ca_pst_bc + | :ca_pst_mb + | :ca_pst_sk + | :ca_qst + | :ch_vat + | :cl_tin + | :cn_tin + | :co_nit + | :cr_tin + | :do_rcn + | :ec_ruc + | :eg_tin + | :es_cif + | :eu_oss_vat + | :gb_vat + | :ge_vat + | :hk_br + | :hu_tin + | :id_npwp + | :il_vat + | :in_gst + | :is_vat + | :jp_cn + | :jp_rn + | :jp_trn + | :ke_pin + | :kr_brn + | :kz_bin + | :li_uid + | :mx_rfc + | :my_frp + | :my_itn + | :my_sst + | :ng_tin + | :no_vat + | :no_voec + | :nz_gst + | :om_vat + | :pe_ruc + | :ph_tin + | :ro_tin + | :rs_pib + | :ru_inn + | :ru_kpp + | :sa_vat + | :sg_gst + | :sg_uen + | :si_tin + | :sv_nit + | :th_vat + | :tr_tin + | :tw_vat + | :ua_vat + | :us_ein + | :uy_ruc + | :ve_rif + | :vn_tin + | :za_vat + + class Type < Orb::Enum + AD_NRT: :ad_nrt + AE_TRN: :ae_trn + AR_CUIT: :ar_cuit + EU_VAT: :eu_vat + AU_ABN: :au_abn + AU_ARN: :au_arn + BG_UIC: :bg_uic + BH_VAT: :bh_vat + BO_TIN: :bo_tin + BR_CNPJ: :br_cnpj + BR_CPF: :br_cpf + CA_BN: :ca_bn + CA_GST_HST: :ca_gst_hst + CA_PST_BC: :ca_pst_bc + CA_PST_MB: :ca_pst_mb + CA_PST_SK: :ca_pst_sk + CA_QST: :ca_qst + CH_VAT: :ch_vat + CL_TIN: :cl_tin + CN_TIN: :cn_tin + CO_NIT: :co_nit + CR_TIN: :cr_tin + DO_RCN: :do_rcn + EC_RUC: :ec_ruc + EG_TIN: :eg_tin + ES_CIF: :es_cif + EU_OSS_VAT: :eu_oss_vat + GB_VAT: :gb_vat + GE_VAT: :ge_vat + HK_BR: :hk_br + HU_TIN: :hu_tin + ID_NPWP: :id_npwp + IL_VAT: :il_vat + IN_GST: :in_gst + IS_VAT: :is_vat + JP_CN: :jp_cn + JP_RN: :jp_rn + JP_TRN: :jp_trn + KE_PIN: :ke_pin + KR_BRN: :kr_brn + KZ_BIN: :kz_bin + LI_UID: :li_uid + MX_RFC: :mx_rfc + MY_FRP: :my_frp + MY_ITN: :my_itn + MY_SST: :my_sst + NG_TIN: :ng_tin + NO_VAT: :no_vat + NO_VOEC: :no_voec + NZ_GST: :nz_gst + OM_VAT: :om_vat + PE_RUC: :pe_ruc + PH_TIN: :ph_tin + RO_TIN: :ro_tin + RS_PIB: :rs_pib + RU_INN: :ru_inn + RU_KPP: :ru_kpp + SA_VAT: :sa_vat + SG_GST: :sg_gst + SG_UEN: :sg_uen + SI_TIN: :si_tin + SV_NIT: :sv_nit + TH_VAT: :th_vat + TR_TIN: :tr_tin + TW_VAT: :tw_vat + UA_VAT: :ua_vat + US_EIN: :us_ein + UY_RUC: :uy_ruc + VE_RIF: :ve_rif + VN_TIN: :vn_tin + ZA_VAT: :za_vat + + def self.values: -> Array[Orb::Models::InvoiceFetchUpcomingResponse::CustomerTaxID::type_] + end + end + + type invoice_source = :subscription | :partial | :one_off + + class InvoiceSource < Orb::Enum + SUBSCRIPTION: :subscription + PARTIAL: :partial + ONE_OFF: :one_off + + def self.values: -> Array[Orb::Models::InvoiceFetchUpcomingResponse::invoice_source] + end + + type line_item = + { + id: String, + adjusted_subtotal: String, + adjustments: Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::adjustment], + amount: String, + credits_applied: String, + discount: Orb::Models::discount?, + end_date: Time, + grouping: String?, + maximum: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Maximum?, + maximum_amount: String?, + minimum: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Minimum?, + minimum_amount: String?, + name: String, + partially_invoiced_amount: String, + price: Orb::Models::price?, + quantity: Float, + start_date: Time, + sub_line_items: Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::sub_line_item], + subtotal: String, + tax_amounts: Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::TaxAmount] + } + + class LineItem < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjusted_subtotal: String + + attr_accessor adjustments: Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::adjustment] + + attr_accessor amount: String + + attr_accessor credits_applied: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor end_date: Time + + attr_accessor grouping: String? + + attr_accessor maximum: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor minimum: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor name: String + + attr_accessor partially_invoiced_amount: String + + attr_accessor price: Orb::Models::price? + + attr_accessor quantity: Float + + attr_accessor start_date: Time + + attr_accessor sub_line_items: Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::sub_line_item] + + attr_accessor subtotal: String + + attr_accessor tax_amounts: Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::TaxAmount] + + def initialize: + ( + id: String, + adjusted_subtotal: String, + adjustments: Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::adjustment], + amount: String, + credits_applied: String, + discount: Orb::Models::discount?, + end_date: Time, + grouping: String?, + maximum: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Maximum?, + maximum_amount: String?, + minimum: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Minimum?, + minimum_amount: String?, + name: String, + partially_invoiced_amount: String, + price: Orb::Models::price?, + quantity: Float, + start_date: Time, + sub_line_items: Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::sub_line_item], + subtotal: String, + tax_amounts: Array[Orb::Models::InvoiceFetchUpcomingResponse::LineItem::TaxAmount] + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::line_item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::line_item + + type adjustment = + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::AmountDiscountAdjustment + | Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::PercentageDiscountAdjustment + | Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::UsageDiscountAdjustment + | Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::MinimumAdjustment + | Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::MaximumAdjustment + + class Adjustment < Orb::Union + type amount_discount_adjustment = + { + id: String, + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String? + } + + class AmountDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::amount_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::amount_discount_adjustment + end + + type percentage_discount_adjustment = + { + id: String, + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String? + } + + class PercentageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor percentage_discount: Float + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::percentage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::percentage_discount_adjustment + end + + type usage_discount_adjustment = + { + id: String, + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float + } + + class UsageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + attr_accessor usage_discount: Float + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::usage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::usage_discount_adjustment + end + + type minimum_adjustment = + { + id: String, + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MinimumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::minimum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::minimum_adjustment + end + + type maximum_adjustment = + { + id: String, + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MaximumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor maximum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::maximum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::maximum_adjustment + end + + private def self.variants: -> [[:amount_discount, Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::AmountDiscountAdjustment], [:percentage_discount, Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::PercentageDiscountAdjustment], [:usage_discount, Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::UsageDiscountAdjustment], [:minimum, Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::MinimumAdjustment], [:maximum, Orb::Models::InvoiceFetchUpcomingResponse::LineItem::Adjustment::MaximumAdjustment]] + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::LineItem::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::LineItem::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::LineItem::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::LineItem::minimum + end + + type sub_line_item = + Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem + | Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem + | Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem + + class SubLineItem < Orb::Union + type matrix_sub_line_item = + { + amount: String, + grouping: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::Grouping?, + matrix_config: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig, + name: String, + quantity: Float, + type: :matrix + } + + class MatrixSubLineItem < Orb::BaseModel + attr_accessor amount: String + + attr_accessor grouping: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::Grouping? + + attr_accessor matrix_config: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig + + attr_accessor name: String + + attr_accessor quantity: Float + + attr_accessor type: :matrix + + def initialize: + ( + amount: String, + grouping: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::Grouping?, + matrix_config: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::MatrixConfig, + name: String, + quantity: Float, + type: :matrix + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::matrix_sub_line_item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::matrix_sub_line_item + + type grouping = { key: String, value: String? } + + class Grouping < Orb::BaseModel + attr_accessor key: String + + attr_accessor value: String? + + def initialize: + (key: String, value: String?) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::grouping + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::grouping + end + + type matrix_config = { dimension_values: Array[String?] } + + class MatrixConfig < Orb::BaseModel + attr_accessor dimension_values: Array[String?] + + def initialize: + (dimension_values: Array[String?]) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::matrix_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem::matrix_config + end + end + + type tier_sub_line_item = + { + amount: String, + grouping: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::Grouping?, + name: String, + quantity: Float, + tier_config: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::TierConfig, + type: :tier + } + + class TierSubLineItem < Orb::BaseModel + attr_accessor amount: String + + attr_accessor grouping: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::Grouping? + + attr_accessor name: String + + attr_accessor quantity: Float + + attr_accessor tier_config: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::TierConfig + + attr_accessor type: :tier + + def initialize: + ( + amount: String, + grouping: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::Grouping?, + name: String, + quantity: Float, + tier_config: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::TierConfig, + type: :tier + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::tier_sub_line_item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::tier_sub_line_item + + type grouping = { key: String, value: String? } + + class Grouping < Orb::BaseModel + attr_accessor key: String + + attr_accessor value: String? + + def initialize: + (key: String, value: String?) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::grouping + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::grouping + end + + type tier_config = + { first_unit: Float, last_unit: Float?, unit_amount: String } + + class TierConfig < Orb::BaseModel + attr_accessor first_unit: Float + + attr_accessor last_unit: Float? + + attr_accessor unit_amount: String + + def initialize: + ( + first_unit: Float, + last_unit: Float?, + unit_amount: String + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::tier_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem::tier_config + end + end + + type other_sub_line_item = + { + amount: String, + grouping: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem::Grouping?, + name: String, + quantity: Float, + type: :"'null'" + } + + class OtherSubLineItem < Orb::BaseModel + attr_accessor amount: String + + attr_accessor grouping: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem::Grouping? + + attr_accessor name: String + + attr_accessor quantity: Float + + attr_accessor type: :"'null'" + + def initialize: + ( + amount: String, + grouping: Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem::Grouping?, + name: String, + quantity: Float, + type: :"'null'" + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::other_sub_line_item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::other_sub_line_item + + type grouping = { key: String, value: String? } + + class Grouping < Orb::BaseModel + attr_accessor key: String + + attr_accessor value: String? + + def initialize: + (key: String, value: String?) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem::grouping + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem::grouping + end + end + + private def self.variants: -> [[:matrix, Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::MatrixSubLineItem], [:tier, Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::TierSubLineItem], [:"'null'", Orb::Models::InvoiceFetchUpcomingResponse::LineItem::SubLineItem::OtherSubLineItem]] + end + + type tax_amount = + { + amount: String, + tax_rate_description: String, + tax_rate_percentage: String? + } + + class TaxAmount < Orb::BaseModel + attr_accessor amount: String + + attr_accessor tax_rate_description: String + + attr_accessor tax_rate_percentage: String? + + def initialize: + ( + amount: String, + tax_rate_description: String, + tax_rate_percentage: String? + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::LineItem::tax_amount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::LineItem::tax_amount + end + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + (applies_to_price_ids: Array[String], maximum_amount: String) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + (applies_to_price_ids: Array[String], minimum_amount: String) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::minimum + end + + type payment_attempt = + { + id: String, + amount: String, + created_at: Time, + payment_provider: Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt::payment_provider?, + payment_provider_id: String?, + succeeded: bool + } + + class PaymentAttempt < Orb::BaseModel + attr_accessor id: String + + attr_accessor amount: String + + attr_accessor created_at: Time + + attr_accessor payment_provider: Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt::payment_provider? + + attr_accessor payment_provider_id: String? + + attr_accessor succeeded: bool + + def initialize: + ( + id: String, + amount: String, + created_at: Time, + payment_provider: Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt::payment_provider?, + payment_provider_id: String?, + succeeded: bool + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::payment_attempt + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::payment_attempt + + type payment_provider = :stripe + + class PaymentProvider < Orb::Enum + STRIPE: :stripe + + def self.values: -> Array[Orb::Models::InvoiceFetchUpcomingResponse::PaymentAttempt::payment_provider] + end + end + + type shipping_address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + + class ShippingAddress < Orb::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: + ( + city: String?, + country: String?, + line1: String?, + line2: String?, + postal_code: String?, + state: String? + ) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::shipping_address + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::shipping_address + end + + type status = :issued | :paid | :synced | :void | :draft + + class Status < Orb::Enum + ISSUED: :issued + PAID: :paid + SYNCED: :synced + VOID: :void + DRAFT: :draft + + def self.values: -> Array[Orb::Models::InvoiceFetchUpcomingResponse::status] + end + + type subscription = { id: String } + + class Subscription < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::InvoiceFetchUpcomingResponse::subscription + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceFetchUpcomingResponse::subscription + end + end + end +end diff --git a/sig/orb/models/invoice_issue_params.rbs b/sig/orb/models/invoice_issue_params.rbs new file mode 100644 index 00000000..fef1a4b8 --- /dev/null +++ b/sig/orb/models/invoice_issue_params.rbs @@ -0,0 +1,20 @@ +module Orb + module Models + type invoice_issue_params = { synchronous: bool } & Orb::request_parameters + + class InvoiceIssueParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_reader synchronous: bool? + + def synchronous=: (bool) -> void + + def initialize: + (synchronous: bool, request_options: Orb::request_opts) -> void + | (?Orb::Models::invoice_issue_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::invoice_issue_params + end + end +end diff --git a/sig/orb/models/invoice_level_discount.rbs b/sig/orb/models/invoice_level_discount.rbs new file mode 100644 index 00000000..961515c7 --- /dev/null +++ b/sig/orb/models/invoice_level_discount.rbs @@ -0,0 +1,12 @@ +module Orb + module Models + type invoice_level_discount = + Orb::Models::PercentageDiscount + | Orb::Models::AmountDiscount + | Orb::Models::TrialDiscount + + class InvoiceLevelDiscount < Orb::Union + private def self.variants: -> [[:percentage, Orb::Models::PercentageDiscount], [:amount, Orb::Models::AmountDiscount], [:trial, Orb::Models::TrialDiscount]] + end + end +end diff --git a/sig/orb/models/invoice_line_item_create_params.rbs b/sig/orb/models/invoice_line_item_create_params.rbs new file mode 100644 index 00000000..aeec15b8 --- /dev/null +++ b/sig/orb/models/invoice_line_item_create_params.rbs @@ -0,0 +1,47 @@ +module Orb + module Models + type invoice_line_item_create_params = + { + amount: String, + end_date: Date, + invoice_id: String, + name: String, + quantity: Float, + start_date: Date + } + & Orb::request_parameters + + class InvoiceLineItemCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor amount: String + + attr_accessor end_date: Date + + attr_accessor invoice_id: String + + attr_accessor name: String + + attr_accessor quantity: Float + + attr_accessor start_date: Date + + def initialize: + ( + amount: String, + end_date: Date, + invoice_id: String, + name: String, + quantity: Float, + start_date: Date, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::invoice_line_item_create_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::invoice_line_item_create_params + end + end +end diff --git a/sig/orb/models/invoice_line_item_create_response.rbs b/sig/orb/models/invoice_line_item_create_response.rbs new file mode 100644 index 00000000..703c1b8c --- /dev/null +++ b/sig/orb/models/invoice_line_item_create_response.rbs @@ -0,0 +1,612 @@ +module Orb + module Models + type invoice_line_item_create_response = + { + id: String, + adjusted_subtotal: String, + adjustments: Array[Orb::Models::InvoiceLineItemCreateResponse::adjustment], + amount: String, + credits_applied: String, + discount: Orb::Models::discount?, + end_date: Time, + grouping: String?, + maximum: Orb::Models::InvoiceLineItemCreateResponse::Maximum?, + maximum_amount: String?, + minimum: Orb::Models::InvoiceLineItemCreateResponse::Minimum?, + minimum_amount: String?, + name: String, + partially_invoiced_amount: String, + price: Orb::Models::price?, + quantity: Float, + start_date: Time, + sub_line_items: Array[Orb::Models::InvoiceLineItemCreateResponse::sub_line_item], + subtotal: String, + tax_amounts: Array[Orb::Models::InvoiceLineItemCreateResponse::TaxAmount] + } + + class InvoiceLineItemCreateResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjusted_subtotal: String + + attr_accessor adjustments: Array[Orb::Models::InvoiceLineItemCreateResponse::adjustment] + + attr_accessor amount: String + + attr_accessor credits_applied: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor end_date: Time + + attr_accessor grouping: String? + + attr_accessor maximum: Orb::Models::InvoiceLineItemCreateResponse::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor minimum: Orb::Models::InvoiceLineItemCreateResponse::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor name: String + + attr_accessor partially_invoiced_amount: String + + attr_accessor price: Orb::Models::price? + + attr_accessor quantity: Float + + attr_accessor start_date: Time + + attr_accessor sub_line_items: Array[Orb::Models::InvoiceLineItemCreateResponse::sub_line_item] + + attr_accessor subtotal: String + + attr_accessor tax_amounts: Array[Orb::Models::InvoiceLineItemCreateResponse::TaxAmount] + + def initialize: + ( + id: String, + adjusted_subtotal: String, + adjustments: Array[Orb::Models::InvoiceLineItemCreateResponse::adjustment], + amount: String, + credits_applied: String, + discount: Orb::Models::discount?, + end_date: Time, + grouping: String?, + maximum: Orb::Models::InvoiceLineItemCreateResponse::Maximum?, + maximum_amount: String?, + minimum: Orb::Models::InvoiceLineItemCreateResponse::Minimum?, + minimum_amount: String?, + name: String, + partially_invoiced_amount: String, + price: Orb::Models::price?, + quantity: Float, + start_date: Time, + sub_line_items: Array[Orb::Models::InvoiceLineItemCreateResponse::sub_line_item], + subtotal: String, + tax_amounts: Array[Orb::Models::InvoiceLineItemCreateResponse::TaxAmount] + ) -> void + | ( + ?Orb::Models::invoice_line_item_create_response | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::invoice_line_item_create_response + + type adjustment = + Orb::Models::InvoiceLineItemCreateResponse::Adjustment::AmountDiscountAdjustment + | Orb::Models::InvoiceLineItemCreateResponse::Adjustment::PercentageDiscountAdjustment + | Orb::Models::InvoiceLineItemCreateResponse::Adjustment::UsageDiscountAdjustment + | Orb::Models::InvoiceLineItemCreateResponse::Adjustment::MinimumAdjustment + | Orb::Models::InvoiceLineItemCreateResponse::Adjustment::MaximumAdjustment + + class Adjustment < Orb::Union + type amount_discount_adjustment = + { + id: String, + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String? + } + + class AmountDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::InvoiceLineItemCreateResponse::Adjustment::amount_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceLineItemCreateResponse::Adjustment::amount_discount_adjustment + end + + type percentage_discount_adjustment = + { + id: String, + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String? + } + + class PercentageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor percentage_discount: Float + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::InvoiceLineItemCreateResponse::Adjustment::percentage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceLineItemCreateResponse::Adjustment::percentage_discount_adjustment + end + + type usage_discount_adjustment = + { + id: String, + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float + } + + class UsageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + attr_accessor usage_discount: Float + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::InvoiceLineItemCreateResponse::Adjustment::usage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceLineItemCreateResponse::Adjustment::usage_discount_adjustment + end + + type minimum_adjustment = + { + id: String, + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MinimumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::InvoiceLineItemCreateResponse::Adjustment::minimum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceLineItemCreateResponse::Adjustment::minimum_adjustment + end + + type maximum_adjustment = + { + id: String, + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MaximumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor maximum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::InvoiceLineItemCreateResponse::Adjustment::maximum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceLineItemCreateResponse::Adjustment::maximum_adjustment + end + + private def self.variants: -> [[:amount_discount, Orb::Models::InvoiceLineItemCreateResponse::Adjustment::AmountDiscountAdjustment], [:percentage_discount, Orb::Models::InvoiceLineItemCreateResponse::Adjustment::PercentageDiscountAdjustment], [:usage_discount, Orb::Models::InvoiceLineItemCreateResponse::Adjustment::UsageDiscountAdjustment], [:minimum, Orb::Models::InvoiceLineItemCreateResponse::Adjustment::MinimumAdjustment], [:maximum, Orb::Models::InvoiceLineItemCreateResponse::Adjustment::MaximumAdjustment]] + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + (applies_to_price_ids: Array[String], maximum_amount: String) -> void + | ( + ?Orb::Models::InvoiceLineItemCreateResponse::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceLineItemCreateResponse::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + (applies_to_price_ids: Array[String], minimum_amount: String) -> void + | ( + ?Orb::Models::InvoiceLineItemCreateResponse::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceLineItemCreateResponse::minimum + end + + type sub_line_item = + Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem + | Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem + | Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem + + class SubLineItem < Orb::Union + type matrix_sub_line_item = + { + amount: String, + grouping: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::Grouping?, + matrix_config: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::MatrixConfig, + name: String, + quantity: Float, + type: :matrix + } + + class MatrixSubLineItem < Orb::BaseModel + attr_accessor amount: String + + attr_accessor grouping: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::Grouping? + + attr_accessor matrix_config: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::MatrixConfig + + attr_accessor name: String + + attr_accessor quantity: Float + + attr_accessor type: :matrix + + def initialize: + ( + amount: String, + grouping: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::Grouping?, + matrix_config: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::MatrixConfig, + name: String, + quantity: Float, + type: :matrix + ) -> void + | ( + ?Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::matrix_sub_line_item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::matrix_sub_line_item + + type grouping = { key: String, value: String? } + + class Grouping < Orb::BaseModel + attr_accessor key: String + + attr_accessor value: String? + + def initialize: + (key: String, value: String?) -> void + | ( + ?Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::grouping + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::grouping + end + + type matrix_config = { dimension_values: Array[String?] } + + class MatrixConfig < Orb::BaseModel + attr_accessor dimension_values: Array[String?] + + def initialize: + (dimension_values: Array[String?]) -> void + | ( + ?Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::matrix_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem::matrix_config + end + end + + type tier_sub_line_item = + { + amount: String, + grouping: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::Grouping?, + name: String, + quantity: Float, + tier_config: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::TierConfig, + type: :tier + } + + class TierSubLineItem < Orb::BaseModel + attr_accessor amount: String + + attr_accessor grouping: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::Grouping? + + attr_accessor name: String + + attr_accessor quantity: Float + + attr_accessor tier_config: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::TierConfig + + attr_accessor type: :tier + + def initialize: + ( + amount: String, + grouping: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::Grouping?, + name: String, + quantity: Float, + tier_config: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::TierConfig, + type: :tier + ) -> void + | ( + ?Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::tier_sub_line_item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::tier_sub_line_item + + type grouping = { key: String, value: String? } + + class Grouping < Orb::BaseModel + attr_accessor key: String + + attr_accessor value: String? + + def initialize: + (key: String, value: String?) -> void + | ( + ?Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::grouping + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::grouping + end + + type tier_config = + { first_unit: Float, last_unit: Float?, unit_amount: String } + + class TierConfig < Orb::BaseModel + attr_accessor first_unit: Float + + attr_accessor last_unit: Float? + + attr_accessor unit_amount: String + + def initialize: + ( + first_unit: Float, + last_unit: Float?, + unit_amount: String + ) -> void + | ( + ?Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::tier_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem::tier_config + end + end + + type other_sub_line_item = + { + amount: String, + grouping: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem::Grouping?, + name: String, + quantity: Float, + type: :"'null'" + } + + class OtherSubLineItem < Orb::BaseModel + attr_accessor amount: String + + attr_accessor grouping: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem::Grouping? + + attr_accessor name: String + + attr_accessor quantity: Float + + attr_accessor type: :"'null'" + + def initialize: + ( + amount: String, + grouping: Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem::Grouping?, + name: String, + quantity: Float, + type: :"'null'" + ) -> void + | ( + ?Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::other_sub_line_item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::other_sub_line_item + + type grouping = { key: String, value: String? } + + class Grouping < Orb::BaseModel + attr_accessor key: String + + attr_accessor value: String? + + def initialize: + (key: String, value: String?) -> void + | ( + ?Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem::grouping + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem::grouping + end + end + + private def self.variants: -> [[:matrix, Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::MatrixSubLineItem], [:tier, Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::TierSubLineItem], [:"'null'", Orb::Models::InvoiceLineItemCreateResponse::SubLineItem::OtherSubLineItem]] + end + + type tax_amount = + { + amount: String, + tax_rate_description: String, + tax_rate_percentage: String? + } + + class TaxAmount < Orb::BaseModel + attr_accessor amount: String + + attr_accessor tax_rate_description: String + + attr_accessor tax_rate_percentage: String? + + def initialize: + ( + amount: String, + tax_rate_description: String, + tax_rate_percentage: String? + ) -> void + | ( + ?Orb::Models::InvoiceLineItemCreateResponse::tax_amount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::InvoiceLineItemCreateResponse::tax_amount + end + end + end +end diff --git a/sig/orb/models/invoice_list_params.rbs b/sig/orb/models/invoice_list_params.rbs new file mode 100644 index 00000000..84e73fe8 --- /dev/null +++ b/sig/orb/models/invoice_list_params.rbs @@ -0,0 +1,120 @@ +module Orb + module Models + type invoice_list_params = + { + amount: String?, + amount_gt: String?, + amount_lt: String?, + cursor: String?, + customer_id: String?, + date_type: Orb::Models::InvoiceListParams::date_type?, + due_date: Date?, + due_date_window: String?, + due_date_gt: Date?, + due_date_lt: Date?, + external_customer_id: String?, + invoice_date_gt: Time?, + invoice_date_gte: Time?, + invoice_date_lt: Time?, + invoice_date_lte: Time?, + is_recurring: bool?, + limit: Integer, + status: Array[Orb::Models::InvoiceListParams::status]?, + subscription_id: String? + } + & Orb::request_parameters + + class InvoiceListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor amount: String? + + attr_accessor amount_gt: String? + + attr_accessor amount_lt: String? + + attr_accessor cursor: String? + + attr_accessor customer_id: String? + + attr_accessor date_type: Orb::Models::InvoiceListParams::date_type? + + attr_accessor due_date: Date? + + attr_accessor due_date_window: String? + + attr_accessor due_date_gt: Date? + + attr_accessor due_date_lt: Date? + + attr_accessor external_customer_id: String? + + attr_accessor invoice_date_gt: Time? + + attr_accessor invoice_date_gte: Time? + + attr_accessor invoice_date_lt: Time? + + attr_accessor invoice_date_lte: Time? + + attr_accessor is_recurring: bool? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + attr_accessor status: Array[Orb::Models::InvoiceListParams::status]? + + attr_accessor subscription_id: String? + + def initialize: + ( + amount: String?, + amount_gt: String?, + amount_lt: String?, + cursor: String?, + customer_id: String?, + date_type: Orb::Models::InvoiceListParams::date_type?, + due_date: Date?, + due_date_window: String?, + due_date_gt: Date?, + due_date_lt: Date?, + external_customer_id: String?, + invoice_date_gt: Time?, + invoice_date_gte: Time?, + invoice_date_lt: Time?, + invoice_date_lte: Time?, + is_recurring: bool?, + limit: Integer, + status: Array[Orb::Models::InvoiceListParams::status]?, + subscription_id: String?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::invoice_list_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::invoice_list_params + + type date_type = :due_date | :invoice_date + + class DateType < Orb::Enum + DUE_DATE: :due_date + INVOICE_DATE: :invoice_date + + def self.values: -> Array[Orb::Models::InvoiceListParams::date_type] + end + + type status = :draft | :issued | :paid | :synced | :void + + class Status < Orb::Enum + DRAFT: :draft + ISSUED: :issued + PAID: :paid + SYNCED: :synced + VOID: :void + + def self.values: -> Array[Orb::Models::InvoiceListParams::status] + end + end + end +end diff --git a/sig/orb/models/invoice_mark_paid_params.rbs b/sig/orb/models/invoice_mark_paid_params.rbs new file mode 100644 index 00000000..797b925e --- /dev/null +++ b/sig/orb/models/invoice_mark_paid_params.rbs @@ -0,0 +1,29 @@ +module Orb + module Models + type invoice_mark_paid_params = + { payment_received_date: Date, external_id: String?, notes: String? } + & Orb::request_parameters + + class InvoiceMarkPaidParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor payment_received_date: Date + + attr_accessor external_id: String? + + attr_accessor notes: String? + + def initialize: + ( + payment_received_date: Date, + external_id: String?, + notes: String?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::invoice_mark_paid_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::invoice_mark_paid_params + end + end +end diff --git a/sig/orb/models/invoice_pay_params.rbs b/sig/orb/models/invoice_pay_params.rbs new file mode 100644 index 00000000..89bbfb4b --- /dev/null +++ b/sig/orb/models/invoice_pay_params.rbs @@ -0,0 +1,16 @@ +module Orb + module Models + type invoice_pay_params = { } & Orb::request_parameters + + class InvoicePayParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | (?Orb::Models::invoice_pay_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::invoice_pay_params + end + end +end diff --git a/sig/orb/models/invoice_update_params.rbs b/sig/orb/models/invoice_update_params.rbs new file mode 100644 index 00000000..20930460 --- /dev/null +++ b/sig/orb/models/invoice_update_params.rbs @@ -0,0 +1,22 @@ +module Orb + module Models + type invoice_update_params = + { metadata: Hash[Symbol, String?]? } & Orb::request_parameters + + class InvoiceUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::invoice_update_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::invoice_update_params + end + end +end diff --git a/sig/orb/models/invoice_void_params.rbs b/sig/orb/models/invoice_void_params.rbs new file mode 100644 index 00000000..c3674d37 --- /dev/null +++ b/sig/orb/models/invoice_void_params.rbs @@ -0,0 +1,16 @@ +module Orb + module Models + type invoice_void_params = { } & Orb::request_parameters + + class InvoiceVoidParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | (?Orb::Models::invoice_void_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::invoice_void_params + end + end +end diff --git a/sig/orb/models/item.rbs b/sig/orb/models/item.rbs new file mode 100644 index 00000000..60ea3458 --- /dev/null +++ b/sig/orb/models/item.rbs @@ -0,0 +1,76 @@ +module Orb + module Models + type item = + { + id: String, + created_at: Time, + external_connections: Array[Orb::Models::Item::ExternalConnection], + name: String + } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor external_connections: Array[Orb::Models::Item::ExternalConnection] + + attr_accessor name: String + + def initialize: + ( + id: String, + created_at: Time, + external_connections: Array[Orb::Models::Item::ExternalConnection], + name: String + ) -> void + | (?Orb::Models::item | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::item + + type external_connection = + { + external_connection_name: Orb::Models::Item::ExternalConnection::external_connection_name, + external_entity_id: String + } + + class ExternalConnection < Orb::BaseModel + attr_accessor external_connection_name: Orb::Models::Item::ExternalConnection::external_connection_name + + attr_accessor external_entity_id: String + + def initialize: + ( + external_connection_name: Orb::Models::Item::ExternalConnection::external_connection_name, + external_entity_id: String + ) -> void + | ( + ?Orb::Models::Item::external_connection | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Item::external_connection + + type external_connection_name = + :stripe + | :quickbooks + | :"bill.com" + | :netsuite + | :taxjar + | :avalara + | :anrok + + class ExternalConnectionName < Orb::Enum + STRIPE: :stripe + QUICKBOOKS: :quickbooks + BILL_COM: :"bill.com" + NETSUITE: :netsuite + TAXJAR: :taxjar + AVALARA: :avalara + ANROK: :anrok + + def self.values: -> Array[Orb::Models::Item::ExternalConnection::external_connection_name] + end + end + end + end +end diff --git a/sig/orb/models/item_create_params.rbs b/sig/orb/models/item_create_params.rbs new file mode 100644 index 00000000..b30805d2 --- /dev/null +++ b/sig/orb/models/item_create_params.rbs @@ -0,0 +1,18 @@ +module Orb + module Models + type item_create_params = { name: String } & Orb::request_parameters + + class ItemCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor name: String + + def initialize: + (name: String, request_options: Orb::request_opts) -> void + | (?Orb::Models::item_create_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::item_create_params + end + end +end diff --git a/sig/orb/models/item_fetch_params.rbs b/sig/orb/models/item_fetch_params.rbs new file mode 100644 index 00000000..7d9662a7 --- /dev/null +++ b/sig/orb/models/item_fetch_params.rbs @@ -0,0 +1,16 @@ +module Orb + module Models + type item_fetch_params = { } & Orb::request_parameters + + class ItemFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | (?Orb::Models::item_fetch_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::item_fetch_params + end + end +end diff --git a/sig/orb/models/item_list_params.rbs b/sig/orb/models/item_list_params.rbs new file mode 100644 index 00000000..9308f0be --- /dev/null +++ b/sig/orb/models/item_list_params.rbs @@ -0,0 +1,27 @@ +module Orb + module Models + type item_list_params = + { cursor: String?, limit: Integer } & Orb::request_parameters + + class ItemListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor cursor: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + def initialize: + ( + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::item_list_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::item_list_params + end + end +end diff --git a/sig/orb/models/item_update_params.rbs b/sig/orb/models/item_update_params.rbs new file mode 100644 index 00000000..0eea2921 --- /dev/null +++ b/sig/orb/models/item_update_params.rbs @@ -0,0 +1,74 @@ +module Orb + module Models + type item_update_params = + { + external_connections: Array[Orb::Models::ItemUpdateParams::ExternalConnection]?, + name: String? + } + & Orb::request_parameters + + class ItemUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor external_connections: Array[Orb::Models::ItemUpdateParams::ExternalConnection]? + + attr_accessor name: String? + + def initialize: + ( + external_connections: Array[Orb::Models::ItemUpdateParams::ExternalConnection]?, + name: String?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::item_update_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::item_update_params + + type external_connection = + { + external_connection_name: Orb::Models::ItemUpdateParams::ExternalConnection::external_connection_name, + external_entity_id: String + } + + class ExternalConnection < Orb::BaseModel + attr_accessor external_connection_name: Orb::Models::ItemUpdateParams::ExternalConnection::external_connection_name + + attr_accessor external_entity_id: String + + def initialize: + ( + external_connection_name: Orb::Models::ItemUpdateParams::ExternalConnection::external_connection_name, + external_entity_id: String + ) -> void + | ( + ?Orb::Models::ItemUpdateParams::external_connection + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::ItemUpdateParams::external_connection + + type external_connection_name = + :stripe + | :quickbooks + | :"bill.com" + | :netsuite + | :taxjar + | :avalara + | :anrok + + class ExternalConnectionName < Orb::Enum + STRIPE: :stripe + QUICKBOOKS: :quickbooks + BILL_COM: :"bill.com" + NETSUITE: :netsuite + TAXJAR: :taxjar + AVALARA: :avalara + ANROK: :anrok + + def self.values: -> Array[Orb::Models::ItemUpdateParams::ExternalConnection::external_connection_name] + end + end + end + end +end diff --git a/sig/orb/models/metric_create_params.rbs b/sig/orb/models/metric_create_params.rbs new file mode 100644 index 00000000..5dd2922c --- /dev/null +++ b/sig/orb/models/metric_create_params.rbs @@ -0,0 +1,41 @@ +module Orb + module Models + type metric_create_params = + { + description: String?, + item_id: String, + name: String, + sql: String, + metadata: Hash[Symbol, String?]? + } + & Orb::request_parameters + + class MetricCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor description: String? + + attr_accessor item_id: String + + attr_accessor name: String + + attr_accessor sql: String + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + description: String?, + item_id: String, + name: String, + sql: String, + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::metric_create_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::metric_create_params + end + end +end diff --git a/sig/orb/models/metric_fetch_params.rbs b/sig/orb/models/metric_fetch_params.rbs new file mode 100644 index 00000000..c254ca7f --- /dev/null +++ b/sig/orb/models/metric_fetch_params.rbs @@ -0,0 +1,16 @@ +module Orb + module Models + type metric_fetch_params = { } & Orb::request_parameters + + class MetricFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | (?Orb::Models::metric_fetch_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::metric_fetch_params + end + end +end diff --git a/sig/orb/models/metric_list_params.rbs b/sig/orb/models/metric_list_params.rbs new file mode 100644 index 00000000..910bd766 --- /dev/null +++ b/sig/orb/models/metric_list_params.rbs @@ -0,0 +1,47 @@ +module Orb + module Models + type metric_list_params = + { + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + cursor: String?, + limit: Integer + } + & Orb::request_parameters + + class MetricListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor created_at_gt: Time? + + attr_accessor created_at_gte: Time? + + attr_accessor created_at_lt: Time? + + attr_accessor created_at_lte: Time? + + attr_accessor cursor: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + def initialize: + ( + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::metric_list_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::metric_list_params + end + end +end diff --git a/sig/orb/models/metric_update_params.rbs b/sig/orb/models/metric_update_params.rbs new file mode 100644 index 00000000..c881be78 --- /dev/null +++ b/sig/orb/models/metric_update_params.rbs @@ -0,0 +1,22 @@ +module Orb + module Models + type metric_update_params = + { metadata: Hash[Symbol, String?]? } & Orb::request_parameters + + class MetricUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::metric_update_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::metric_update_params + end + end +end diff --git a/sig/orb/models/pagination_metadata.rbs b/sig/orb/models/pagination_metadata.rbs new file mode 100644 index 00000000..8ce287e0 --- /dev/null +++ b/sig/orb/models/pagination_metadata.rbs @@ -0,0 +1,17 @@ +module Orb + module Models + type pagination_metadata = { has_more: bool, next_cursor: String? } + + class PaginationMetadata < Orb::BaseModel + attr_accessor has_more: bool + + attr_accessor next_cursor: String? + + def initialize: + (has_more: bool, next_cursor: String?) -> void + | (?Orb::Models::pagination_metadata | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::pagination_metadata + end + end +end diff --git a/sig/orb/models/percentage_discount.rbs b/sig/orb/models/percentage_discount.rbs new file mode 100644 index 00000000..aabf499e --- /dev/null +++ b/sig/orb/models/percentage_discount.rbs @@ -0,0 +1,40 @@ +module Orb + module Models + type percentage_discount = + { + applies_to_price_ids: Array[String], + discount_type: Orb::Models::PercentageDiscount::discount_type, + percentage_discount: Float, + reason: String? + } + + class PercentageDiscount < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor discount_type: Orb::Models::PercentageDiscount::discount_type + + attr_accessor percentage_discount: Float + + attr_accessor reason: String? + + def initialize: + ( + applies_to_price_ids: Array[String], + discount_type: Orb::Models::PercentageDiscount::discount_type, + percentage_discount: Float, + reason: String? + ) -> void + | (?Orb::Models::percentage_discount | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::percentage_discount + + type discount_type = :percentage + + class DiscountType < Orb::Enum + PERCENTAGE: :percentage + + def self.values: -> Array[Orb::Models::PercentageDiscount::discount_type] + end + end + end +end diff --git a/sig/orb/models/plan.rbs b/sig/orb/models/plan.rbs new file mode 100644 index 00000000..15a007b6 --- /dev/null +++ b/sig/orb/models/plan.rbs @@ -0,0 +1,558 @@ +module Orb + module Models + type plan = + { + id: String, + adjustments: Array[Orb::Models::Plan::adjustment], + base_plan: Orb::Models::Plan::BasePlan?, + base_plan_id: String?, + created_at: Time, + currency: String, + default_invoice_memo: String?, + description: String, + discount: Orb::Models::discount?, + external_plan_id: String?, + invoicing_currency: String, + maximum: Orb::Models::Plan::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Plan::Minimum?, + minimum_amount: String?, + name: String, + net_terms: Integer?, + plan_phases: Array[Orb::Models::Plan::PlanPhase]?, + prices: Array[Orb::Models::price], + product: Orb::Models::Plan::Product, + status: Orb::Models::Plan::status, + trial_config: Orb::Models::Plan::TrialConfig, + version: Integer + } + + class Plan < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustments: Array[Orb::Models::Plan::adjustment] + + attr_accessor base_plan: Orb::Models::Plan::BasePlan? + + attr_accessor base_plan_id: String? + + attr_accessor created_at: Time + + attr_accessor currency: String + + attr_accessor default_invoice_memo: String? + + attr_accessor description: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_plan_id: String? + + attr_accessor invoicing_currency: String + + attr_accessor maximum: Orb::Models::Plan::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Plan::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor name: String + + attr_accessor net_terms: Integer? + + attr_accessor plan_phases: Array[Orb::Models::Plan::PlanPhase]? + + attr_accessor prices: Array[Orb::Models::price] + + attr_accessor product: Orb::Models::Plan::Product + + attr_accessor status: Orb::Models::Plan::status + + attr_accessor trial_config: Orb::Models::Plan::TrialConfig + + attr_accessor version: Integer + + def initialize: + ( + id: String, + adjustments: Array[Orb::Models::Plan::adjustment], + base_plan: Orb::Models::Plan::BasePlan?, + base_plan_id: String?, + created_at: Time, + currency: String, + default_invoice_memo: String?, + description: String, + discount: Orb::Models::discount?, + external_plan_id: String?, + invoicing_currency: String, + maximum: Orb::Models::Plan::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Plan::Minimum?, + minimum_amount: String?, + name: String, + net_terms: Integer?, + plan_phases: Array[Orb::Models::Plan::PlanPhase]?, + prices: Array[Orb::Models::price], + product: Orb::Models::Plan::Product, + status: Orb::Models::Plan::status, + trial_config: Orb::Models::Plan::TrialConfig, + version: Integer + ) -> void + | (?Orb::Models::plan | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::plan + + type adjustment = + Orb::Models::Plan::Adjustment::AmountDiscountAdjustment + | Orb::Models::Plan::Adjustment::PercentageDiscountAdjustment + | Orb::Models::Plan::Adjustment::UsageDiscountAdjustment + | Orb::Models::Plan::Adjustment::MinimumAdjustment + | Orb::Models::Plan::Adjustment::MaximumAdjustment + + class Adjustment < Orb::Union + type amount_discount_adjustment = + { + id: String, + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String? + } + + class AmountDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::Plan::Adjustment::amount_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Plan::Adjustment::amount_discount_adjustment + end + + type percentage_discount_adjustment = + { + id: String, + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String? + } + + class PercentageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor percentage_discount: Float + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::Plan::Adjustment::percentage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Plan::Adjustment::percentage_discount_adjustment + end + + type usage_discount_adjustment = + { + id: String, + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float + } + + class UsageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + attr_accessor usage_discount: Float + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::Plan::Adjustment::usage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Plan::Adjustment::usage_discount_adjustment + end + + type minimum_adjustment = + { + id: String, + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MinimumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::Plan::Adjustment::minimum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Plan::Adjustment::minimum_adjustment + end + + type maximum_adjustment = + { + id: String, + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MaximumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor maximum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::Plan::Adjustment::maximum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Plan::Adjustment::maximum_adjustment + end + + private def self.variants: -> [[:amount_discount, Orb::Models::Plan::Adjustment::AmountDiscountAdjustment], [:percentage_discount, Orb::Models::Plan::Adjustment::PercentageDiscountAdjustment], [:usage_discount, Orb::Models::Plan::Adjustment::UsageDiscountAdjustment], [:minimum, Orb::Models::Plan::Adjustment::MinimumAdjustment], [:maximum, Orb::Models::Plan::Adjustment::MaximumAdjustment]] + end + + type base_plan = { id: String?, external_plan_id: String?, name: String? } + + class BasePlan < Orb::BaseModel + attr_accessor id: String? + + attr_accessor external_plan_id: String? + + attr_accessor name: String? + + def initialize: + (id: String?, external_plan_id: String?, name: String?) -> void + | (?Orb::Models::Plan::base_plan | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Plan::base_plan + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + (applies_to_price_ids: Array[String], maximum_amount: String) -> void + | (?Orb::Models::Plan::maximum | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Plan::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + (applies_to_price_ids: Array[String], minimum_amount: String) -> void + | (?Orb::Models::Plan::minimum | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Plan::minimum + end + + type plan_phase = + { + id: String, + description: String?, + discount: Orb::Models::discount?, + duration: Integer?, + duration_unit: Orb::Models::Plan::PlanPhase::duration_unit?, + maximum: Orb::Models::Plan::PlanPhase::Maximum?, + maximum_amount: String?, + minimum: Orb::Models::Plan::PlanPhase::Minimum?, + minimum_amount: String?, + name: String, + order: Integer + } + + class PlanPhase < Orb::BaseModel + attr_accessor id: String + + attr_accessor description: String? + + attr_accessor discount: Orb::Models::discount? + + attr_accessor duration: Integer? + + attr_accessor duration_unit: Orb::Models::Plan::PlanPhase::duration_unit? + + attr_accessor maximum: Orb::Models::Plan::PlanPhase::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor minimum: Orb::Models::Plan::PlanPhase::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor name: String + + attr_accessor order: Integer + + def initialize: + ( + id: String, + description: String?, + discount: Orb::Models::discount?, + duration: Integer?, + duration_unit: Orb::Models::Plan::PlanPhase::duration_unit?, + maximum: Orb::Models::Plan::PlanPhase::Maximum?, + maximum_amount: String?, + minimum: Orb::Models::Plan::PlanPhase::Minimum?, + minimum_amount: String?, + name: String, + order: Integer + ) -> void + | (?Orb::Models::Plan::plan_phase | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Plan::plan_phase + + type duration_unit = + :daily | :monthly | :quarterly | :semi_annual | :annual + + class DurationUnit < Orb::Enum + DAILY: :daily + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + + def self.values: -> Array[Orb::Models::Plan::PlanPhase::duration_unit] + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Plan::PlanPhase::maximum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Plan::PlanPhase::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Plan::PlanPhase::minimum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Plan::PlanPhase::minimum + end + end + + type product = { id: String, created_at: Time, name: String } + + class Product < Orb::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor name: String + + def initialize: + (id: String, created_at: Time, name: String) -> void + | (?Orb::Models::Plan::product | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Plan::product + end + + type status = :active | :archived | :draft + + class Status < Orb::Enum + ACTIVE: :active + ARCHIVED: :archived + DRAFT: :draft + + def self.values: -> Array[Orb::Models::Plan::status] + end + + type trial_config = + { + trial_period: Integer?, + trial_period_unit: Orb::Models::Plan::TrialConfig::trial_period_unit + } + + class TrialConfig < Orb::BaseModel + attr_accessor trial_period: Integer? + + attr_accessor trial_period_unit: Orb::Models::Plan::TrialConfig::trial_period_unit + + def initialize: + ( + trial_period: Integer?, + trial_period_unit: Orb::Models::Plan::TrialConfig::trial_period_unit + ) -> void + | (?Orb::Models::Plan::trial_config | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Plan::trial_config + + type trial_period_unit = :days + + class TrialPeriodUnit < Orb::Enum + DAYS: :days + + def self.values: -> Array[Orb::Models::Plan::TrialConfig::trial_period_unit] + end + end + end + end +end diff --git a/sig/orb/models/plan_create_params.rbs b/sig/orb/models/plan_create_params.rbs new file mode 100644 index 00000000..1bd59048 --- /dev/null +++ b/sig/orb/models/plan_create_params.rbs @@ -0,0 +1,4111 @@ +module Orb + module Models + type plan_create_params = + { + currency: String, + name: String, + prices: Array[Orb::Models::PlanCreateParams::price], + default_invoice_memo: String?, + external_plan_id: String?, + metadata: Hash[Symbol, String?]?, + net_terms: Integer?, + status: Orb::Models::PlanCreateParams::status + } + & Orb::request_parameters + + class PlanCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor currency: String + + attr_accessor name: String + + attr_accessor prices: Array[Orb::Models::PlanCreateParams::price] + + attr_accessor default_invoice_memo: String? + + attr_accessor external_plan_id: String? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor net_terms: Integer? + + attr_reader status: Orb::Models::PlanCreateParams::status? + + def status=: (Orb::Models::PlanCreateParams::status) -> void + + def initialize: + ( + currency: String, + name: String, + prices: Array[Orb::Models::PlanCreateParams::price], + default_invoice_memo: String?, + external_plan_id: String?, + metadata: Hash[Symbol, String?]?, + net_terms: Integer?, + status: Orb::Models::PlanCreateParams::status, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::plan_create_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::plan_create_params + + type price = + Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice + | Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice + | Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice + | Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice + | Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice + | Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice + | Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice + | Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice + | Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice + | Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice + | Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice + | Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice + | Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice + | Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice + | Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice + | Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice + | Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice + | Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice + | Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice + | Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice + | Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice + | Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice + | Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice + | Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice + + class Price < Orb::Union + type new_plan_unit_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::cadence, + item_id: String, + model_type: :unit, + name: String, + unit_config: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::UnitConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanUnitPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :unit + + attr_accessor name: String + + attr_accessor unit_config: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::UnitConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::cadence, + item_id: String, + name: String, + unit_config: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::UnitConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_unit_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_unit_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::cadence] + end + + type unit_config = { unit_amount: String } + + class UnitConfig < Orb::BaseModel + attr_accessor unit_amount: String + + def initialize: + (unit_amount: String) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::unit_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::unit_config + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_package_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::cadence, + item_id: String, + model_type: :package, + name: String, + package_config: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::PackageConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanPackagePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :package + + attr_accessor name: String + + attr_accessor package_config: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::PackageConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::cadence, + item_id: String, + name: String, + package_config: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::PackageConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :package + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_package_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::cadence] + end + + type package_config = + { package_amount: String, package_size: Integer } + + class PackageConfig < Orb::BaseModel + attr_accessor package_amount: String + + attr_accessor package_size: Integer + + def initialize: + (package_amount: String, package_size: Integer) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::package_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::package_config + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_matrix_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::cadence, + item_id: String, + matrix_config: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig, + model_type: :matrix, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanMatrixPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::cadence + + attr_accessor item_id: String + + attr_accessor matrix_config: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig + + attr_accessor model_type: :matrix + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::cadence, + item_id: String, + matrix_config: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :matrix + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_matrix_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_matrix_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::cadence] + end + + type matrix_config = + { + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig::MatrixValue] + } + + class MatrixConfig < Orb::BaseModel + attr_accessor default_unit_amount: String + + attr_accessor dimensions: Array[String?] + + attr_accessor matrix_values: Array[Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig::MatrixValue] + + def initialize: + ( + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig::MatrixValue] + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::matrix_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::matrix_config + + type matrix_value = + { dimension_values: Array[String?], unit_amount: String } + + class MatrixValue < Orb::BaseModel + attr_accessor dimension_values: Array[String?] + + attr_accessor unit_amount: String + + def initialize: + (dimension_values: Array[String?], unit_amount: String) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig::matrix_value + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::MatrixConfig::matrix_value + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_tiered_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::cadence, + item_id: String, + model_type: :tiered, + name: String, + tiered_config: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanTieredPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered + + attr_accessor name: String + + attr_accessor tiered_config: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::cadence, + item_id: String, + name: String, + tiered_config: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :tiered + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_tiered_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_tiered_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::cadence] + end + + type tiered_config = + { + tiers: Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig::Tier] + } + + class TieredConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig::Tier] + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::tiered_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::tiered_config + + type tier = + { first_unit: Float, unit_amount: String, last_unit: Float? } + + class Tier < Orb::BaseModel + attr_accessor first_unit: Float + + attr_accessor unit_amount: String + + attr_accessor last_unit: Float? + + def initialize: + ( + first_unit: Float, + unit_amount: String, + last_unit: Float? + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::TieredConfig::tier + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_tiered_bps_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::cadence, + item_id: String, + model_type: :tiered_bps, + name: String, + tiered_bps_config: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanTieredBpsPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_bps + + attr_accessor name: String + + attr_accessor tiered_bps_config: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::cadence, + item_id: String, + name: String, + tiered_bps_config: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :tiered_bps + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_tiered_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_tiered_bps_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::cadence] + end + + type tiered_bps_config = + { + tiers: Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig::Tier] + } + + class TieredBpsConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig::Tier] + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::tiered_bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::tiered_bps_config + + type tier = + { + bps: Float, + minimum_amount: String, + maximum_amount: String?, + per_unit_maximum: String? + } + + class Tier < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor minimum_amount: String + + attr_accessor maximum_amount: String? + + attr_accessor per_unit_maximum: String? + + def initialize: + ( + bps: Float, + minimum_amount: String, + maximum_amount: String?, + per_unit_maximum: String? + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::TieredBpsConfig::tier + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_bps_price = + { + bps_config: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BpsConfig, + cadence: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::cadence, + item_id: String, + model_type: :bps, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanBpsPrice < Orb::BaseModel + attr_accessor bps_config: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BpsConfig + + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bps + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + bps_config: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BpsConfig, + cadence: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :bps + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_bps_price + + type bps_config = { bps: Float, per_unit_maximum: String? } + + class BpsConfig < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor per_unit_maximum: String? + + def initialize: + (bps: Float, per_unit_maximum: String?) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::bps_config + end + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_bulk_bps_price = + { + bulk_bps_config: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig, + cadence: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::cadence, + item_id: String, + model_type: :bulk_bps, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanBulkBpsPrice < Orb::BaseModel + attr_accessor bulk_bps_config: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig + + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bulk_bps + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + bulk_bps_config: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig, + cadence: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :bulk_bps + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_bulk_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_bulk_bps_price + + type bulk_bps_config = + { + tiers: Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig::Tier] + } + + class BulkBpsConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig::Tier] + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::bulk_bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::bulk_bps_config + + type tier = + { bps: Float, maximum_amount: String?, per_unit_maximum: String? } + + class Tier < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor maximum_amount: String? + + attr_accessor per_unit_maximum: String? + + def initialize: + ( + bps: Float, + maximum_amount: String?, + per_unit_maximum: String? + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BulkBpsConfig::tier + end + end + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_bulk_price = + { + bulk_config: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig, + cadence: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::cadence, + item_id: String, + model_type: :bulk, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanBulkPrice < Orb::BaseModel + attr_accessor bulk_config: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig + + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bulk + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + bulk_config: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig, + cadence: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :bulk + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_bulk_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_bulk_price + + type bulk_config = + { + tiers: Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig::Tier] + } + + class BulkConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig::Tier] + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::bulk_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::bulk_config + + type tier = { unit_amount: String, maximum_units: Float? } + + class Tier < Orb::BaseModel + attr_accessor unit_amount: String + + attr_accessor maximum_units: Float? + + def initialize: + (unit_amount: String, maximum_units: Float?) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BulkConfig::tier + end + end + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_threshold_total_amount_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::cadence, + item_id: String, + model_type: :threshold_total_amount, + name: String, + threshold_total_amount_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanThresholdTotalAmountPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :threshold_total_amount + + attr_accessor name: String + + attr_accessor threshold_total_amount_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::cadence, + item_id: String, + name: String, + threshold_total_amount_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :threshold_total_amount + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_threshold_total_amount_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_threshold_total_amount_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_tiered_package_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::cadence, + item_id: String, + model_type: :tiered_package, + name: String, + tiered_package_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanTieredPackagePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_package + + attr_accessor name: String + + attr_accessor tiered_package_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::cadence, + item_id: String, + name: String, + tiered_package_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :tiered_package + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_tiered_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_tiered_package_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_tiered_with_minimum_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::cadence, + item_id: String, + model_type: :tiered_with_minimum, + name: String, + tiered_with_minimum_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanTieredWithMinimumPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_minimum + + attr_accessor name: String + + attr_accessor tiered_with_minimum_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::cadence, + item_id: String, + name: String, + tiered_with_minimum_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :tiered_with_minimum + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_tiered_with_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_tiered_with_minimum_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_unit_with_percent_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::cadence, + item_id: String, + model_type: :unit_with_percent, + name: String, + unit_with_percent_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanUnitWithPercentPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :unit_with_percent + + attr_accessor name: String + + attr_accessor unit_with_percent_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::cadence, + item_id: String, + name: String, + unit_with_percent_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :unit_with_percent + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_unit_with_percent_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_unit_with_percent_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_package_with_allocation_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::cadence, + item_id: String, + model_type: :package_with_allocation, + name: String, + package_with_allocation_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanPackageWithAllocationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :package_with_allocation + + attr_accessor name: String + + attr_accessor package_with_allocation_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::cadence, + item_id: String, + name: String, + package_with_allocation_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :package_with_allocation + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_package_with_allocation_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_package_with_allocation_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_tier_with_proration_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanTierWithProrationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_proration + + attr_accessor name: String + + attr_accessor tiered_with_proration_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::cadence, + item_id: String, + name: String, + tiered_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :tiered_with_proration + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_tier_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_tier_with_proration_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_unit_with_proration_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::cadence, + item_id: String, + model_type: :unit_with_proration, + name: String, + unit_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanUnitWithProrationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :unit_with_proration + + attr_accessor name: String + + attr_accessor unit_with_proration_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::cadence, + item_id: String, + name: String, + unit_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :unit_with_proration + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_unit_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_unit_with_proration_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_grouped_allocation_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::cadence, + grouped_allocation_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_allocation, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanGroupedAllocationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::cadence + + attr_accessor grouped_allocation_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_allocation + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::cadence, + grouped_allocation_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :grouped_allocation + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_grouped_allocation_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_grouped_allocation_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_grouped_with_prorated_minimum_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::cadence, + grouped_with_prorated_minimum_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_with_prorated_minimum, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanGroupedWithProratedMinimumPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::cadence + + attr_accessor grouped_with_prorated_minimum_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_prorated_minimum + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::cadence, + grouped_with_prorated_minimum_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :grouped_with_prorated_minimum + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_grouped_with_prorated_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_grouped_with_prorated_minimum_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_grouped_with_metered_minimum_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::cadence, + grouped_with_metered_minimum_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_with_metered_minimum, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanGroupedWithMeteredMinimumPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::cadence + + attr_accessor grouped_with_metered_minimum_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_metered_minimum + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::cadence, + grouped_with_metered_minimum_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :grouped_with_metered_minimum + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_grouped_with_metered_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_grouped_with_metered_minimum_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_matrix_with_display_name_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::cadence, + item_id: String, + matrix_with_display_name_config: Hash[Symbol, top], + model_type: :matrix_with_display_name, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanMatrixWithDisplayNamePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::cadence + + attr_accessor item_id: String + + attr_accessor matrix_with_display_name_config: Hash[Symbol, top] + + attr_accessor model_type: :matrix_with_display_name + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::cadence, + item_id: String, + matrix_with_display_name_config: Hash[Symbol, top], + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :matrix_with_display_name + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_matrix_with_display_name_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_matrix_with_display_name_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_bulk_with_proration_price = + { + bulk_with_proration_config: Hash[Symbol, top], + cadence: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::cadence, + item_id: String, + model_type: :bulk_with_proration, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanBulkWithProrationPrice < Orb::BaseModel + attr_accessor bulk_with_proration_config: Hash[Symbol, top] + + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bulk_with_proration + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + bulk_with_proration_config: Hash[Symbol, top], + cadence: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :bulk_with_proration + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_bulk_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_bulk_with_proration_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_grouped_tiered_package_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::cadence, + grouped_tiered_package_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_tiered_package, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanGroupedTieredPackagePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::cadence + + attr_accessor grouped_tiered_package_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_tiered_package + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::cadence, + grouped_tiered_package_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :grouped_tiered_package + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_grouped_tiered_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_grouped_tiered_package_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_max_group_tiered_package_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::cadence, + item_id: String, + max_group_tiered_package_config: Hash[Symbol, top], + model_type: :max_group_tiered_package, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanMaxGroupTieredPackagePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::cadence + + attr_accessor item_id: String + + attr_accessor max_group_tiered_package_config: Hash[Symbol, top] + + attr_accessor model_type: :max_group_tiered_package + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::cadence, + item_id: String, + max_group_tiered_package_config: Hash[Symbol, top], + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :max_group_tiered_package + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_max_group_tiered_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_max_group_tiered_package_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_scalable_matrix_with_unit_pricing_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::cadence, + item_id: String, + model_type: :scalable_matrix_with_unit_pricing, + name: String, + scalable_matrix_with_unit_pricing_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanScalableMatrixWithUnitPricingPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :scalable_matrix_with_unit_pricing + + attr_accessor name: String + + attr_accessor scalable_matrix_with_unit_pricing_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::cadence, + item_id: String, + name: String, + scalable_matrix_with_unit_pricing_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :scalable_matrix_with_unit_pricing + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_scalable_matrix_with_unit_pricing_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_scalable_matrix_with_unit_pricing_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_plan_scalable_matrix_with_tiered_pricing_price = + { + cadence: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::cadence, + item_id: String, + model_type: :scalable_matrix_with_tiered_pricing, + name: String, + scalable_matrix_with_tiered_pricing_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewPlanScalableMatrixWithTieredPricingPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :scalable_matrix_with_tiered_pricing + + attr_accessor name: String + + attr_accessor scalable_matrix_with_tiered_pricing_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::cadence, + item_id: String, + name: String, + scalable_matrix_with_tiered_pricing_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :scalable_matrix_with_tiered_pricing + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::new_plan_scalable_matrix_with_tiered_pricing_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::new_plan_scalable_matrix_with_tiered_pricing_price + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + private def self.variants: -> [[:unit, Orb::Models::PlanCreateParams::Price::NewPlanUnitPrice], [:package, Orb::Models::PlanCreateParams::Price::NewPlanPackagePrice], [:matrix, Orb::Models::PlanCreateParams::Price::NewPlanMatrixPrice], [:tiered, Orb::Models::PlanCreateParams::Price::NewPlanTieredPrice], [:tiered_bps, Orb::Models::PlanCreateParams::Price::NewPlanTieredBpsPrice], [:bps, Orb::Models::PlanCreateParams::Price::NewPlanBpsPrice], [:bulk_bps, Orb::Models::PlanCreateParams::Price::NewPlanBulkBpsPrice], [:bulk, Orb::Models::PlanCreateParams::Price::NewPlanBulkPrice], [:threshold_total_amount, Orb::Models::PlanCreateParams::Price::NewPlanThresholdTotalAmountPrice], [:tiered_package, Orb::Models::PlanCreateParams::Price::NewPlanTieredPackagePrice], [:tiered_with_minimum, Orb::Models::PlanCreateParams::Price::NewPlanTieredWithMinimumPrice], [:unit_with_percent, Orb::Models::PlanCreateParams::Price::NewPlanUnitWithPercentPrice], [:package_with_allocation, Orb::Models::PlanCreateParams::Price::NewPlanPackageWithAllocationPrice], [:tiered_with_proration, Orb::Models::PlanCreateParams::Price::NewPlanTierWithProrationPrice], [:unit_with_proration, Orb::Models::PlanCreateParams::Price::NewPlanUnitWithProrationPrice], [:grouped_allocation, Orb::Models::PlanCreateParams::Price::NewPlanGroupedAllocationPrice], [:grouped_with_prorated_minimum, Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithProratedMinimumPrice], [:grouped_with_metered_minimum, Orb::Models::PlanCreateParams::Price::NewPlanGroupedWithMeteredMinimumPrice], [:matrix_with_display_name, Orb::Models::PlanCreateParams::Price::NewPlanMatrixWithDisplayNamePrice], [:bulk_with_proration, Orb::Models::PlanCreateParams::Price::NewPlanBulkWithProrationPrice], [:grouped_tiered_package, Orb::Models::PlanCreateParams::Price::NewPlanGroupedTieredPackagePrice], [:max_group_tiered_package, Orb::Models::PlanCreateParams::Price::NewPlanMaxGroupTieredPackagePrice], [:scalable_matrix_with_unit_pricing, Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithUnitPricingPrice], [:scalable_matrix_with_tiered_pricing, Orb::Models::PlanCreateParams::Price::NewPlanScalableMatrixWithTieredPricingPrice]] + end + + type status = :active | :draft + + class Status < Orb::Enum + ACTIVE: :active + DRAFT: :draft + + def self.values: -> Array[Orb::Models::PlanCreateParams::status] + end + end + end +end diff --git a/sig/orb/models/plan_fetch_params.rbs b/sig/orb/models/plan_fetch_params.rbs new file mode 100644 index 00000000..7b10da7c --- /dev/null +++ b/sig/orb/models/plan_fetch_params.rbs @@ -0,0 +1,16 @@ +module Orb + module Models + type plan_fetch_params = { } & Orb::request_parameters + + class PlanFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | (?Orb::Models::plan_fetch_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::plan_fetch_params + end + end +end diff --git a/sig/orb/models/plan_list_params.rbs b/sig/orb/models/plan_list_params.rbs new file mode 100644 index 00000000..d346d7d5 --- /dev/null +++ b/sig/orb/models/plan_list_params.rbs @@ -0,0 +1,63 @@ +module Orb + module Models + type plan_list_params = + { + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + cursor: String?, + limit: Integer, + status: Orb::Models::PlanListParams::status + } + & Orb::request_parameters + + class PlanListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor created_at_gt: Time? + + attr_accessor created_at_gte: Time? + + attr_accessor created_at_lt: Time? + + attr_accessor created_at_lte: Time? + + attr_accessor cursor: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + attr_reader status: Orb::Models::PlanListParams::status? + + def status=: (Orb::Models::PlanListParams::status) -> void + + def initialize: + ( + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + cursor: String?, + limit: Integer, + status: Orb::Models::PlanListParams::status, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::plan_list_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::plan_list_params + + type status = :active | :archived | :draft + + class Status < Orb::Enum + ACTIVE: :active + ARCHIVED: :archived + DRAFT: :draft + + def self.values: -> Array[Orb::Models::PlanListParams::status] + end + end + end +end diff --git a/sig/orb/models/plan_update_params.rbs b/sig/orb/models/plan_update_params.rbs new file mode 100644 index 00000000..ed40d565 --- /dev/null +++ b/sig/orb/models/plan_update_params.rbs @@ -0,0 +1,26 @@ +module Orb + module Models + type plan_update_params = + { external_plan_id: String?, metadata: Hash[Symbol, String?]? } + & Orb::request_parameters + + class PlanUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor external_plan_id: String? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + external_plan_id: String?, + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::plan_update_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::plan_update_params + end + end +end diff --git a/sig/orb/models/plans/external_plan_id_fetch_params.rbs b/sig/orb/models/plans/external_plan_id_fetch_params.rbs new file mode 100644 index 00000000..ca8c0787 --- /dev/null +++ b/sig/orb/models/plans/external_plan_id_fetch_params.rbs @@ -0,0 +1,21 @@ +module Orb + module Models + module Plans + type external_plan_id_fetch_params = { } & Orb::request_parameters + + class ExternalPlanIDFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::Plans::external_plan_id_fetch_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Plans::external_plan_id_fetch_params + end + end + end +end diff --git a/sig/orb/models/plans/external_plan_id_update_params.rbs b/sig/orb/models/plans/external_plan_id_update_params.rbs new file mode 100644 index 00000000..06de127a --- /dev/null +++ b/sig/orb/models/plans/external_plan_id_update_params.rbs @@ -0,0 +1,31 @@ +module Orb + module Models + module Plans + type external_plan_id_update_params = + { external_plan_id: String?, metadata: Hash[Symbol, String?]? } + & Orb::request_parameters + + class ExternalPlanIDUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor external_plan_id: String? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + external_plan_id: String?, + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Plans::external_plan_id_update_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Plans::external_plan_id_update_params + end + end + end +end diff --git a/sig/orb/models/price.rbs b/sig/orb/models/price.rbs new file mode 100644 index 00000000..b6493360 --- /dev/null +++ b/sig/orb/models/price.rbs @@ -0,0 +1,8830 @@ +module Orb + module Models + type price = + Orb::Models::Price::UnitPrice + | Orb::Models::Price::PackagePrice + | Orb::Models::Price::MatrixPrice + | Orb::Models::Price::TieredPrice + | Orb::Models::Price::TieredBpsPrice + | Orb::Models::Price::BpsPrice + | Orb::Models::Price::BulkBpsPrice + | Orb::Models::Price::BulkPrice + | Orb::Models::Price::ThresholdTotalAmountPrice + | Orb::Models::Price::TieredPackagePrice + | Orb::Models::Price::GroupedTieredPrice + | Orb::Models::Price::TieredWithMinimumPrice + | Orb::Models::Price::TieredPackageWithMinimumPrice + | Orb::Models::Price::PackageWithAllocationPrice + | Orb::Models::Price::UnitWithPercentPrice + | Orb::Models::Price::MatrixWithAllocationPrice + | Orb::Models::Price::TieredWithProrationPrice + | Orb::Models::Price::UnitWithProrationPrice + | Orb::Models::Price::GroupedAllocationPrice + | Orb::Models::Price::GroupedWithProratedMinimumPrice + | Orb::Models::Price::GroupedWithMeteredMinimumPrice + | Orb::Models::Price::MatrixWithDisplayNamePrice + | Orb::Models::Price::BulkWithProrationPrice + | Orb::Models::Price::GroupedTieredPackagePrice + | Orb::Models::Price::MaxGroupTieredPackagePrice + | Orb::Models::Price::ScalableMatrixWithUnitPricingPrice + | Orb::Models::Price::ScalableMatrixWithTieredPricingPrice + + class Price < Orb::Union + type unit_price = + { + id: String, + billable_metric: Orb::Models::Price::UnitPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::UnitPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::UnitPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::UnitPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::UnitPrice::Item, + maximum: Orb::Models::Price::UnitPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::UnitPrice::Minimum?, + minimum_amount: String?, + model_type: :unit, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::UnitPrice::price_type, + unit_config: Orb::Models::Price::UnitPrice::UnitConfig, + dimensional_price_configuration: Orb::Models::Price::UnitPrice::DimensionalPriceConfiguration? + } + + class UnitPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::UnitPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::UnitPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::UnitPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::UnitPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::UnitPrice::Item + + attr_accessor maximum: Orb::Models::Price::UnitPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::UnitPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :unit + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::UnitPrice::price_type + + attr_accessor unit_config: Orb::Models::Price::UnitPrice::UnitConfig + + attr_accessor dimensional_price_configuration: Orb::Models::Price::UnitPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::UnitPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::UnitPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::UnitPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::UnitPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::UnitPrice::Item, + maximum: Orb::Models::Price::UnitPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::UnitPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::UnitPrice::price_type, + unit_config: Orb::Models::Price::UnitPrice::UnitConfig, + dimensional_price_configuration: Orb::Models::Price::UnitPrice::DimensionalPriceConfiguration?, + model_type: :unit + ) -> void + | (?Orb::Models::Price::unit_price | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Price::unit_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::UnitPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::UnitPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::UnitPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::UnitPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::UnitPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::UnitPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::UnitPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::UnitPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::UnitPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::UnitPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::UnitPrice::item | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::UnitPrice::maximum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::UnitPrice::minimum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::UnitPrice::price_type] + end + + type unit_config = { unit_amount: String } + + class UnitConfig < Orb::BaseModel + attr_accessor unit_amount: String + + def initialize: + (unit_amount: String) -> void + | ( + ?Orb::Models::Price::UnitPrice::unit_config | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitPrice::unit_config + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::UnitPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitPrice::dimensional_price_configuration + end + end + + type package_price = + { + id: String, + billable_metric: Orb::Models::Price::PackagePrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::PackagePrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::PackagePrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::PackagePrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::PackagePrice::Item, + maximum: Orb::Models::Price::PackagePrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::PackagePrice::Minimum?, + minimum_amount: String?, + model_type: :package, + name: String, + package_config: Orb::Models::Price::PackagePrice::PackageConfig, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::PackagePrice::price_type, + dimensional_price_configuration: Orb::Models::Price::PackagePrice::DimensionalPriceConfiguration? + } + + class PackagePrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::PackagePrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::PackagePrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::PackagePrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::PackagePrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::PackagePrice::Item + + attr_accessor maximum: Orb::Models::Price::PackagePrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::PackagePrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :package + + attr_accessor name: String + + attr_accessor package_config: Orb::Models::Price::PackagePrice::PackageConfig + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::PackagePrice::price_type + + attr_accessor dimensional_price_configuration: Orb::Models::Price::PackagePrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::PackagePrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::PackagePrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::PackagePrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::PackagePrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::PackagePrice::Item, + maximum: Orb::Models::Price::PackagePrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::PackagePrice::Minimum?, + minimum_amount: String?, + name: String, + package_config: Orb::Models::Price::PackagePrice::PackageConfig, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::PackagePrice::price_type, + dimensional_price_configuration: Orb::Models::Price::PackagePrice::DimensionalPriceConfiguration?, + model_type: :package + ) -> void + | (?Orb::Models::Price::package_price | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Price::package_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::PackagePrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackagePrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::PackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::PackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::PackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::PackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::PackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::PackagePrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::PackagePrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackagePrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::PackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::PackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::PackagePrice::item | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackagePrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::PackagePrice::maximum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackagePrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::PackagePrice::minimum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackagePrice::minimum + end + + type package_config = { package_amount: String, package_size: Integer } + + class PackageConfig < Orb::BaseModel + attr_accessor package_amount: String + + attr_accessor package_size: Integer + + def initialize: + (package_amount: String, package_size: Integer) -> void + | ( + ?Orb::Models::Price::PackagePrice::package_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackagePrice::package_config + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::PackagePrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::PackagePrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackagePrice::dimensional_price_configuration + end + end + + type matrix_price = + { + id: String, + billable_metric: Orb::Models::Price::MatrixPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::MatrixPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::MatrixPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::MatrixPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::MatrixPrice::Item, + matrix_config: Orb::Models::Price::MatrixPrice::MatrixConfig, + maximum: Orb::Models::Price::MatrixPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::MatrixPrice::Minimum?, + minimum_amount: String?, + model_type: :matrix, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::MatrixPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::MatrixPrice::DimensionalPriceConfiguration? + } + + class MatrixPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::MatrixPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::MatrixPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::MatrixPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::MatrixPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::MatrixPrice::Item + + attr_accessor matrix_config: Orb::Models::Price::MatrixPrice::MatrixConfig + + attr_accessor maximum: Orb::Models::Price::MatrixPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::MatrixPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :matrix + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::MatrixPrice::price_type + + attr_accessor dimensional_price_configuration: Orb::Models::Price::MatrixPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::MatrixPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::MatrixPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::MatrixPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::MatrixPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::MatrixPrice::Item, + matrix_config: Orb::Models::Price::MatrixPrice::MatrixConfig, + maximum: Orb::Models::Price::MatrixPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::MatrixPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::MatrixPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::MatrixPrice::DimensionalPriceConfiguration?, + model_type: :matrix + ) -> void + | (?Orb::Models::Price::matrix_price | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Price::matrix_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::MatrixPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::MatrixPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::MatrixPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::MatrixPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::MatrixPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::MatrixPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::MatrixPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::MatrixPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::MatrixPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::MatrixPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::MatrixPrice::item | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixPrice::item + end + + type matrix_config = + { + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::Price::MatrixPrice::MatrixConfig::MatrixValue] + } + + class MatrixConfig < Orb::BaseModel + attr_accessor default_unit_amount: String + + attr_accessor dimensions: Array[String?] + + attr_accessor matrix_values: Array[Orb::Models::Price::MatrixPrice::MatrixConfig::MatrixValue] + + def initialize: + ( + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::Price::MatrixPrice::MatrixConfig::MatrixValue] + ) -> void + | ( + ?Orb::Models::Price::MatrixPrice::matrix_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixPrice::matrix_config + + type matrix_value = + { dimension_values: Array[String?], unit_amount: String } + + class MatrixValue < Orb::BaseModel + attr_accessor dimension_values: Array[String?] + + attr_accessor unit_amount: String + + def initialize: + (dimension_values: Array[String?], unit_amount: String) -> void + | ( + ?Orb::Models::Price::MatrixPrice::MatrixConfig::matrix_value + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixPrice::MatrixConfig::matrix_value + end + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::MatrixPrice::maximum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::MatrixPrice::minimum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::MatrixPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::MatrixPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixPrice::dimensional_price_configuration + end + end + + type tiered_price = + { + id: String, + billable_metric: Orb::Models::Price::TieredPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::TieredPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::TieredPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::TieredPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::TieredPrice::Item, + maximum: Orb::Models::Price::TieredPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::TieredPrice::Minimum?, + minimum_amount: String?, + model_type: :tiered, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::TieredPrice::price_type, + tiered_config: Orb::Models::Price::TieredPrice::TieredConfig, + dimensional_price_configuration: Orb::Models::Price::TieredPrice::DimensionalPriceConfiguration? + } + + class TieredPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::TieredPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::TieredPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::TieredPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::TieredPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::TieredPrice::Item + + attr_accessor maximum: Orb::Models::Price::TieredPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::TieredPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :tiered + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::TieredPrice::price_type + + attr_accessor tiered_config: Orb::Models::Price::TieredPrice::TieredConfig + + attr_accessor dimensional_price_configuration: Orb::Models::Price::TieredPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::TieredPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::TieredPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::TieredPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::TieredPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::TieredPrice::Item, + maximum: Orb::Models::Price::TieredPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::TieredPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::TieredPrice::price_type, + tiered_config: Orb::Models::Price::TieredPrice::TieredConfig, + dimensional_price_configuration: Orb::Models::Price::TieredPrice::DimensionalPriceConfiguration?, + model_type: :tiered + ) -> void + | (?Orb::Models::Price::tiered_price | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Price::tiered_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::TieredPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::TieredPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::TieredPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::TieredPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::TieredPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::TieredPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::TieredPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::TieredPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::TieredPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::TieredPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::TieredPrice::item | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::TieredPrice::maximum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::TieredPrice::minimum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::TieredPrice::price_type] + end + + type tiered_config = + { tiers: Array[Orb::Models::Price::TieredPrice::TieredConfig::Tier] } + + class TieredConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::Price::TieredPrice::TieredConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::Price::TieredPrice::TieredConfig::Tier] + ) -> void + | ( + ?Orb::Models::Price::TieredPrice::tiered_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPrice::tiered_config + + type tier = + { first_unit: Float, unit_amount: String, last_unit: Float? } + + class Tier < Orb::BaseModel + attr_accessor first_unit: Float + + attr_accessor unit_amount: String + + attr_accessor last_unit: Float? + + def initialize: + ( + first_unit: Float, + unit_amount: String, + last_unit: Float? + ) -> void + | ( + ?Orb::Models::Price::TieredPrice::TieredConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPrice::TieredConfig::tier + end + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::TieredPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPrice::dimensional_price_configuration + end + end + + type tiered_bps_price = + { + id: String, + billable_metric: Orb::Models::Price::TieredBpsPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::TieredBpsPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::TieredBpsPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::TieredBpsPrice::Item, + maximum: Orb::Models::Price::TieredBpsPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::TieredBpsPrice::Minimum?, + minimum_amount: String?, + model_type: :tiered_bps, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::TieredBpsPrice::price_type, + tiered_bps_config: Orb::Models::Price::TieredBpsPrice::TieredBpsConfig, + dimensional_price_configuration: Orb::Models::Price::TieredBpsPrice::DimensionalPriceConfiguration? + } + + class TieredBpsPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::TieredBpsPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::TieredBpsPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::TieredBpsPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::TieredBpsPrice::Item + + attr_accessor maximum: Orb::Models::Price::TieredBpsPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::TieredBpsPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :tiered_bps + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::TieredBpsPrice::price_type + + attr_accessor tiered_bps_config: Orb::Models::Price::TieredBpsPrice::TieredBpsConfig + + attr_accessor dimensional_price_configuration: Orb::Models::Price::TieredBpsPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::TieredBpsPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::TieredBpsPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::TieredBpsPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::TieredBpsPrice::Item, + maximum: Orb::Models::Price::TieredBpsPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::TieredBpsPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::TieredBpsPrice::price_type, + tiered_bps_config: Orb::Models::Price::TieredBpsPrice::TieredBpsConfig, + dimensional_price_configuration: Orb::Models::Price::TieredBpsPrice::DimensionalPriceConfiguration?, + model_type: :tiered_bps + ) -> void + | ( + ?Orb::Models::Price::tiered_bps_price | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::tiered_bps_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::TieredBpsPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredBpsPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::TieredBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::TieredBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::TieredBpsPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::TieredBpsPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredBpsPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::TieredBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::TieredBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::TieredBpsPrice::item | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredBpsPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::TieredBpsPrice::maximum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredBpsPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::TieredBpsPrice::minimum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredBpsPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::TieredBpsPrice::price_type] + end + + type tiered_bps_config = + { + tiers: Array[Orb::Models::Price::TieredBpsPrice::TieredBpsConfig::Tier] + } + + class TieredBpsConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::Price::TieredBpsPrice::TieredBpsConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::Price::TieredBpsPrice::TieredBpsConfig::Tier] + ) -> void + | ( + ?Orb::Models::Price::TieredBpsPrice::tiered_bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredBpsPrice::tiered_bps_config + + type tier = + { + bps: Float, + minimum_amount: String, + maximum_amount: String?, + per_unit_maximum: String? + } + + class Tier < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor minimum_amount: String + + attr_accessor maximum_amount: String? + + attr_accessor per_unit_maximum: String? + + def initialize: + ( + bps: Float, + minimum_amount: String, + maximum_amount: String?, + per_unit_maximum: String? + ) -> void + | ( + ?Orb::Models::Price::TieredBpsPrice::TieredBpsConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredBpsPrice::TieredBpsConfig::tier + end + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::TieredBpsPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredBpsPrice::dimensional_price_configuration + end + end + + type bps_price = + { + id: String, + billable_metric: Orb::Models::Price::BpsPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::BpsPrice::BillingCycleConfiguration, + bps_config: Orb::Models::Price::BpsPrice::BpsConfig, + cadence: Orb::Models::Price::BpsPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::BpsPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::BpsPrice::Item, + maximum: Orb::Models::Price::BpsPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::BpsPrice::Minimum?, + minimum_amount: String?, + model_type: :bps, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::BpsPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::BpsPrice::DimensionalPriceConfiguration? + } + + class BpsPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::BpsPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::BpsPrice::BillingCycleConfiguration + + attr_accessor bps_config: Orb::Models::Price::BpsPrice::BpsConfig + + attr_accessor cadence: Orb::Models::Price::BpsPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::BpsPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::BpsPrice::Item + + attr_accessor maximum: Orb::Models::Price::BpsPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::BpsPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :bps + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::BpsPrice::price_type + + attr_accessor dimensional_price_configuration: Orb::Models::Price::BpsPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::BpsPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::BpsPrice::BillingCycleConfiguration, + bps_config: Orb::Models::Price::BpsPrice::BpsConfig, + cadence: Orb::Models::Price::BpsPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::BpsPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::BpsPrice::Item, + maximum: Orb::Models::Price::BpsPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::BpsPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::BpsPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::BpsPrice::DimensionalPriceConfiguration?, + model_type: :bps + ) -> void + | (?Orb::Models::Price::bps_price | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Price::bps_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::BpsPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BpsPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::BpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::BpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::BpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::BpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::BpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type bps_config = { bps: Float, per_unit_maximum: String? } + + class BpsConfig < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor per_unit_maximum: String? + + def initialize: + (bps: Float, per_unit_maximum: String?) -> void + | ( + ?Orb::Models::Price::BpsPrice::bps_config | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BpsPrice::bps_config + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::BpsPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::BpsPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BpsPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::BpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::BpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::BpsPrice::item | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BpsPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::BpsPrice::maximum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BpsPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::BpsPrice::minimum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BpsPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::BpsPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::BpsPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BpsPrice::dimensional_price_configuration + end + end + + type bulk_bps_price = + { + id: String, + billable_metric: Orb::Models::Price::BulkBpsPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration, + bulk_bps_config: Orb::Models::Price::BulkBpsPrice::BulkBpsConfig, + cadence: Orb::Models::Price::BulkBpsPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::BulkBpsPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::BulkBpsPrice::Item, + maximum: Orb::Models::Price::BulkBpsPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::BulkBpsPrice::Minimum?, + minimum_amount: String?, + model_type: :bulk_bps, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::BulkBpsPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::BulkBpsPrice::DimensionalPriceConfiguration? + } + + class BulkBpsPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::BulkBpsPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration + + attr_accessor bulk_bps_config: Orb::Models::Price::BulkBpsPrice::BulkBpsConfig + + attr_accessor cadence: Orb::Models::Price::BulkBpsPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::BulkBpsPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::BulkBpsPrice::Item + + attr_accessor maximum: Orb::Models::Price::BulkBpsPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::BulkBpsPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :bulk_bps + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::BulkBpsPrice::price_type + + attr_accessor dimensional_price_configuration: Orb::Models::Price::BulkBpsPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::BulkBpsPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration, + bulk_bps_config: Orb::Models::Price::BulkBpsPrice::BulkBpsConfig, + cadence: Orb::Models::Price::BulkBpsPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::BulkBpsPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::BulkBpsPrice::Item, + maximum: Orb::Models::Price::BulkBpsPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::BulkBpsPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::BulkBpsPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::BulkBpsPrice::DimensionalPriceConfiguration?, + model_type: :bulk_bps + ) -> void + | (?Orb::Models::Price::bulk_bps_price | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Price::bulk_bps_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::BulkBpsPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkBpsPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::BulkBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::BulkBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type bulk_bps_config = + { + tiers: Array[Orb::Models::Price::BulkBpsPrice::BulkBpsConfig::Tier] + } + + class BulkBpsConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::Price::BulkBpsPrice::BulkBpsConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::Price::BulkBpsPrice::BulkBpsConfig::Tier] + ) -> void + | ( + ?Orb::Models::Price::BulkBpsPrice::bulk_bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkBpsPrice::bulk_bps_config + + type tier = + { bps: Float, maximum_amount: String?, per_unit_maximum: String? } + + class Tier < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor maximum_amount: String? + + attr_accessor per_unit_maximum: String? + + def initialize: + ( + bps: Float, + maximum_amount: String?, + per_unit_maximum: String? + ) -> void + | ( + ?Orb::Models::Price::BulkBpsPrice::BulkBpsConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkBpsPrice::BulkBpsConfig::tier + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::BulkBpsPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::BulkBpsPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkBpsPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::BulkBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::BulkBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::BulkBpsPrice::item | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkBpsPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::BulkBpsPrice::maximum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkBpsPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::BulkBpsPrice::minimum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkBpsPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::BulkBpsPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::BulkBpsPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkBpsPrice::dimensional_price_configuration + end + end + + type bulk_price = + { + id: String, + billable_metric: Orb::Models::Price::BulkPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::BulkPrice::BillingCycleConfiguration, + bulk_config: Orb::Models::Price::BulkPrice::BulkConfig, + cadence: Orb::Models::Price::BulkPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::BulkPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::BulkPrice::Item, + maximum: Orb::Models::Price::BulkPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::BulkPrice::Minimum?, + minimum_amount: String?, + model_type: :bulk, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::BulkPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::BulkPrice::DimensionalPriceConfiguration? + } + + class BulkPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::BulkPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::BulkPrice::BillingCycleConfiguration + + attr_accessor bulk_config: Orb::Models::Price::BulkPrice::BulkConfig + + attr_accessor cadence: Orb::Models::Price::BulkPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::BulkPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::BulkPrice::Item + + attr_accessor maximum: Orb::Models::Price::BulkPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::BulkPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :bulk + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::BulkPrice::price_type + + attr_accessor dimensional_price_configuration: Orb::Models::Price::BulkPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::BulkPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::BulkPrice::BillingCycleConfiguration, + bulk_config: Orb::Models::Price::BulkPrice::BulkConfig, + cadence: Orb::Models::Price::BulkPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::BulkPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::BulkPrice::Item, + maximum: Orb::Models::Price::BulkPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::BulkPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::BulkPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::BulkPrice::DimensionalPriceConfiguration?, + model_type: :bulk + ) -> void + | (?Orb::Models::Price::bulk_price | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::Price::bulk_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::BulkPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::BulkPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::BulkPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::BulkPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::BulkPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::BulkPrice::BillingCycleConfiguration::duration_unit] + end + end + + type bulk_config = + { tiers: Array[Orb::Models::Price::BulkPrice::BulkConfig::Tier] } + + class BulkConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::Price::BulkPrice::BulkConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::Price::BulkPrice::BulkConfig::Tier] + ) -> void + | ( + ?Orb::Models::Price::BulkPrice::bulk_config | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkPrice::bulk_config + + type tier = { unit_amount: String, maximum_units: Float? } + + class Tier < Orb::BaseModel + attr_accessor unit_amount: String + + attr_accessor maximum_units: Float? + + def initialize: + (unit_amount: String, maximum_units: Float?) -> void + | ( + ?Orb::Models::Price::BulkPrice::BulkConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkPrice::BulkConfig::tier + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::BulkPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::BulkPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::BulkPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::BulkPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::BulkPrice::item | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::BulkPrice::maximum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::BulkPrice::minimum | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::BulkPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::BulkPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkPrice::dimensional_price_configuration + end + end + + type threshold_total_amount_price = + { + id: String, + billable_metric: Orb::Models::Price::ThresholdTotalAmountPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::ThresholdTotalAmountPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::ThresholdTotalAmountPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::ThresholdTotalAmountPrice::Item, + maximum: Orb::Models::Price::ThresholdTotalAmountPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::ThresholdTotalAmountPrice::Minimum?, + minimum_amount: String?, + model_type: :threshold_total_amount, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::ThresholdTotalAmountPrice::price_type, + threshold_total_amount_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::ThresholdTotalAmountPrice::DimensionalPriceConfiguration? + } + + class ThresholdTotalAmountPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::ThresholdTotalAmountPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::ThresholdTotalAmountPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::ThresholdTotalAmountPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::ThresholdTotalAmountPrice::Item + + attr_accessor maximum: Orb::Models::Price::ThresholdTotalAmountPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::ThresholdTotalAmountPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :threshold_total_amount + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::ThresholdTotalAmountPrice::price_type + + attr_accessor threshold_total_amount_config: Hash[Symbol, top] + + attr_accessor dimensional_price_configuration: Orb::Models::Price::ThresholdTotalAmountPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::ThresholdTotalAmountPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::ThresholdTotalAmountPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::ThresholdTotalAmountPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::ThresholdTotalAmountPrice::Item, + maximum: Orb::Models::Price::ThresholdTotalAmountPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::ThresholdTotalAmountPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::ThresholdTotalAmountPrice::price_type, + threshold_total_amount_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::ThresholdTotalAmountPrice::DimensionalPriceConfiguration?, + model_type: :threshold_total_amount + ) -> void + | ( + ?Orb::Models::Price::threshold_total_amount_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::threshold_total_amount_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::ThresholdTotalAmountPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ThresholdTotalAmountPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::ThresholdTotalAmountPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ThresholdTotalAmountPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::ThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::ThresholdTotalAmountPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::ThresholdTotalAmountPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ThresholdTotalAmountPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::ThresholdTotalAmountPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ThresholdTotalAmountPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::ThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::ThresholdTotalAmountPrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ThresholdTotalAmountPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::ThresholdTotalAmountPrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ThresholdTotalAmountPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::ThresholdTotalAmountPrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ThresholdTotalAmountPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::ThresholdTotalAmountPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::ThresholdTotalAmountPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ThresholdTotalAmountPrice::dimensional_price_configuration + end + end + + type tiered_package_price = + { + id: String, + billable_metric: Orb::Models::Price::TieredPackagePrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::TieredPackagePrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::TieredPackagePrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::TieredPackagePrice::Item, + maximum: Orb::Models::Price::TieredPackagePrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::TieredPackagePrice::Minimum?, + minimum_amount: String?, + model_type: :tiered_package, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::TieredPackagePrice::price_type, + tiered_package_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::TieredPackagePrice::DimensionalPriceConfiguration? + } + + class TieredPackagePrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::TieredPackagePrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::TieredPackagePrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::TieredPackagePrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::TieredPackagePrice::Item + + attr_accessor maximum: Orb::Models::Price::TieredPackagePrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::TieredPackagePrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :tiered_package + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::TieredPackagePrice::price_type + + attr_accessor tiered_package_config: Hash[Symbol, top] + + attr_accessor dimensional_price_configuration: Orb::Models::Price::TieredPackagePrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::TieredPackagePrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::TieredPackagePrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::TieredPackagePrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::TieredPackagePrice::Item, + maximum: Orb::Models::Price::TieredPackagePrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::TieredPackagePrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::TieredPackagePrice::price_type, + tiered_package_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::TieredPackagePrice::DimensionalPriceConfiguration?, + model_type: :tiered_package + ) -> void + | ( + ?Orb::Models::Price::tiered_package_price | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::tiered_package_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::TieredPackagePrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPackagePrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::TieredPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::TieredPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::TieredPackagePrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::TieredPackagePrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPackagePrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::TieredPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::TieredPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::TieredPackagePrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPackagePrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::TieredPackagePrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPackagePrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::TieredPackagePrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPackagePrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::TieredPackagePrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::TieredPackagePrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPackagePrice::dimensional_price_configuration + end + end + + type grouped_tiered_price = + { + id: String, + billable_metric: Orb::Models::Price::GroupedTieredPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::GroupedTieredPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::GroupedTieredPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + grouped_tiered_config: Hash[Symbol, top], + invoicing_cycle_configuration: Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::GroupedTieredPrice::Item, + maximum: Orb::Models::Price::GroupedTieredPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::GroupedTieredPrice::Minimum?, + minimum_amount: String?, + model_type: :grouped_tiered, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::GroupedTieredPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::GroupedTieredPrice::DimensionalPriceConfiguration? + } + + class GroupedTieredPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::GroupedTieredPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::GroupedTieredPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::GroupedTieredPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor grouped_tiered_config: Hash[Symbol, top] + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::GroupedTieredPrice::Item + + attr_accessor maximum: Orb::Models::Price::GroupedTieredPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::GroupedTieredPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :grouped_tiered + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::GroupedTieredPrice::price_type + + attr_accessor dimensional_price_configuration: Orb::Models::Price::GroupedTieredPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::GroupedTieredPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::GroupedTieredPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::GroupedTieredPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + grouped_tiered_config: Hash[Symbol, top], + invoicing_cycle_configuration: Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::GroupedTieredPrice::Item, + maximum: Orb::Models::Price::GroupedTieredPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::GroupedTieredPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::GroupedTieredPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::GroupedTieredPrice::DimensionalPriceConfiguration?, + model_type: :grouped_tiered + ) -> void + | ( + ?Orb::Models::Price::grouped_tiered_price | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::grouped_tiered_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::GroupedTieredPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedTieredPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::GroupedTieredPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedTieredPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::GroupedTieredPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::GroupedTieredPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::GroupedTieredPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedTieredPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::GroupedTieredPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedTieredPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::GroupedTieredPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::GroupedTieredPrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedTieredPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::GroupedTieredPrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedTieredPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::GroupedTieredPrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedTieredPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::GroupedTieredPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::GroupedTieredPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedTieredPrice::dimensional_price_configuration + end + end + + type tiered_with_minimum_price = + { + id: String, + billable_metric: Orb::Models::Price::TieredWithMinimumPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::TieredWithMinimumPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::TieredWithMinimumPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::TieredWithMinimumPrice::Item, + maximum: Orb::Models::Price::TieredWithMinimumPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::TieredWithMinimumPrice::Minimum?, + minimum_amount: String?, + model_type: :tiered_with_minimum, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::TieredWithMinimumPrice::price_type, + tiered_with_minimum_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::TieredWithMinimumPrice::DimensionalPriceConfiguration? + } + + class TieredWithMinimumPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::TieredWithMinimumPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::TieredWithMinimumPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::TieredWithMinimumPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::TieredWithMinimumPrice::Item + + attr_accessor maximum: Orb::Models::Price::TieredWithMinimumPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::TieredWithMinimumPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :tiered_with_minimum + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::TieredWithMinimumPrice::price_type + + attr_accessor tiered_with_minimum_config: Hash[Symbol, top] + + attr_accessor dimensional_price_configuration: Orb::Models::Price::TieredWithMinimumPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::TieredWithMinimumPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::TieredWithMinimumPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::TieredWithMinimumPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::TieredWithMinimumPrice::Item, + maximum: Orb::Models::Price::TieredWithMinimumPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::TieredWithMinimumPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::TieredWithMinimumPrice::price_type, + tiered_with_minimum_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::TieredWithMinimumPrice::DimensionalPriceConfiguration?, + model_type: :tiered_with_minimum + ) -> void + | ( + ?Orb::Models::Price::tiered_with_minimum_price | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::tiered_with_minimum_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::TieredWithMinimumPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredWithMinimumPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::TieredWithMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredWithMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::TieredWithMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::TieredWithMinimumPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::TieredWithMinimumPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredWithMinimumPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::TieredWithMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredWithMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::TieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::TieredWithMinimumPrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredWithMinimumPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::TieredWithMinimumPrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredWithMinimumPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::TieredWithMinimumPrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredWithMinimumPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::TieredWithMinimumPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::TieredWithMinimumPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredWithMinimumPrice::dimensional_price_configuration + end + end + + type tiered_package_with_minimum_price = + { + id: String, + billable_metric: Orb::Models::Price::TieredPackageWithMinimumPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::TieredPackageWithMinimumPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::TieredPackageWithMinimumPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::TieredPackageWithMinimumPrice::Item, + maximum: Orb::Models::Price::TieredPackageWithMinimumPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::TieredPackageWithMinimumPrice::Minimum?, + minimum_amount: String?, + model_type: :tiered_package_with_minimum, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::TieredPackageWithMinimumPrice::price_type, + tiered_package_with_minimum_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::TieredPackageWithMinimumPrice::DimensionalPriceConfiguration? + } + + class TieredPackageWithMinimumPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::TieredPackageWithMinimumPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::TieredPackageWithMinimumPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::TieredPackageWithMinimumPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::TieredPackageWithMinimumPrice::Item + + attr_accessor maximum: Orb::Models::Price::TieredPackageWithMinimumPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::TieredPackageWithMinimumPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :tiered_package_with_minimum + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::TieredPackageWithMinimumPrice::price_type + + attr_accessor tiered_package_with_minimum_config: Hash[Symbol, top] + + attr_accessor dimensional_price_configuration: Orb::Models::Price::TieredPackageWithMinimumPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::TieredPackageWithMinimumPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::TieredPackageWithMinimumPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::TieredPackageWithMinimumPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::TieredPackageWithMinimumPrice::Item, + maximum: Orb::Models::Price::TieredPackageWithMinimumPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::TieredPackageWithMinimumPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::TieredPackageWithMinimumPrice::price_type, + tiered_package_with_minimum_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::TieredPackageWithMinimumPrice::DimensionalPriceConfiguration?, + model_type: :tiered_package_with_minimum + ) -> void + | ( + ?Orb::Models::Price::tiered_package_with_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::tiered_package_with_minimum_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::TieredPackageWithMinimumPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPackageWithMinimumPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::TieredPackageWithMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPackageWithMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::TieredPackageWithMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::TieredPackageWithMinimumPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::TieredPackageWithMinimumPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPackageWithMinimumPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::TieredPackageWithMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPackageWithMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::TieredPackageWithMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::TieredPackageWithMinimumPrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPackageWithMinimumPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::TieredPackageWithMinimumPrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPackageWithMinimumPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::TieredPackageWithMinimumPrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPackageWithMinimumPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::TieredPackageWithMinimumPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::TieredPackageWithMinimumPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredPackageWithMinimumPrice::dimensional_price_configuration + end + end + + type package_with_allocation_price = + { + id: String, + billable_metric: Orb::Models::Price::PackageWithAllocationPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::PackageWithAllocationPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::PackageWithAllocationPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::PackageWithAllocationPrice::Item, + maximum: Orb::Models::Price::PackageWithAllocationPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::PackageWithAllocationPrice::Minimum?, + minimum_amount: String?, + model_type: :package_with_allocation, + name: String, + package_with_allocation_config: Hash[Symbol, top], + plan_phase_order: Integer?, + price_type: Orb::Models::Price::PackageWithAllocationPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::PackageWithAllocationPrice::DimensionalPriceConfiguration? + } + + class PackageWithAllocationPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::PackageWithAllocationPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::PackageWithAllocationPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::PackageWithAllocationPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::PackageWithAllocationPrice::Item + + attr_accessor maximum: Orb::Models::Price::PackageWithAllocationPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::PackageWithAllocationPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :package_with_allocation + + attr_accessor name: String + + attr_accessor package_with_allocation_config: Hash[Symbol, top] + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::PackageWithAllocationPrice::price_type + + attr_accessor dimensional_price_configuration: Orb::Models::Price::PackageWithAllocationPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::PackageWithAllocationPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::PackageWithAllocationPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::PackageWithAllocationPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::PackageWithAllocationPrice::Item, + maximum: Orb::Models::Price::PackageWithAllocationPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::PackageWithAllocationPrice::Minimum?, + minimum_amount: String?, + name: String, + package_with_allocation_config: Hash[Symbol, top], + plan_phase_order: Integer?, + price_type: Orb::Models::Price::PackageWithAllocationPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::PackageWithAllocationPrice::DimensionalPriceConfiguration?, + model_type: :package_with_allocation + ) -> void + | ( + ?Orb::Models::Price::package_with_allocation_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::package_with_allocation_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::PackageWithAllocationPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackageWithAllocationPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::PackageWithAllocationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackageWithAllocationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::PackageWithAllocationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::PackageWithAllocationPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::PackageWithAllocationPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackageWithAllocationPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::PackageWithAllocationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackageWithAllocationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::PackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::PackageWithAllocationPrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackageWithAllocationPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::PackageWithAllocationPrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackageWithAllocationPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::PackageWithAllocationPrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackageWithAllocationPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::PackageWithAllocationPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::PackageWithAllocationPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::PackageWithAllocationPrice::dimensional_price_configuration + end + end + + type unit_with_percent_price = + { + id: String, + billable_metric: Orb::Models::Price::UnitWithPercentPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::UnitWithPercentPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::UnitWithPercentPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::UnitWithPercentPrice::Item, + maximum: Orb::Models::Price::UnitWithPercentPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::UnitWithPercentPrice::Minimum?, + minimum_amount: String?, + model_type: :unit_with_percent, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::UnitWithPercentPrice::price_type, + unit_with_percent_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::UnitWithPercentPrice::DimensionalPriceConfiguration? + } + + class UnitWithPercentPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::UnitWithPercentPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::UnitWithPercentPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::UnitWithPercentPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::UnitWithPercentPrice::Item + + attr_accessor maximum: Orb::Models::Price::UnitWithPercentPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::UnitWithPercentPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :unit_with_percent + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::UnitWithPercentPrice::price_type + + attr_accessor unit_with_percent_config: Hash[Symbol, top] + + attr_accessor dimensional_price_configuration: Orb::Models::Price::UnitWithPercentPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::UnitWithPercentPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::UnitWithPercentPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::UnitWithPercentPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::UnitWithPercentPrice::Item, + maximum: Orb::Models::Price::UnitWithPercentPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::UnitWithPercentPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::UnitWithPercentPrice::price_type, + unit_with_percent_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::UnitWithPercentPrice::DimensionalPriceConfiguration?, + model_type: :unit_with_percent + ) -> void + | ( + ?Orb::Models::Price::unit_with_percent_price | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::unit_with_percent_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::UnitWithPercentPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitWithPercentPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::UnitWithPercentPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitWithPercentPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::UnitWithPercentPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::UnitWithPercentPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::UnitWithPercentPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitWithPercentPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::UnitWithPercentPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitWithPercentPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::UnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::UnitWithPercentPrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitWithPercentPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::UnitWithPercentPrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitWithPercentPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::UnitWithPercentPrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitWithPercentPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::UnitWithPercentPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::UnitWithPercentPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitWithPercentPrice::dimensional_price_configuration + end + end + + type matrix_with_allocation_price = + { + id: String, + billable_metric: Orb::Models::Price::MatrixWithAllocationPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::MatrixWithAllocationPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::MatrixWithAllocationPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::MatrixWithAllocationPrice::Item, + matrix_with_allocation_config: Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig, + maximum: Orb::Models::Price::MatrixWithAllocationPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::MatrixWithAllocationPrice::Minimum?, + minimum_amount: String?, + model_type: :matrix_with_allocation, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::MatrixWithAllocationPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::MatrixWithAllocationPrice::DimensionalPriceConfiguration? + } + + class MatrixWithAllocationPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::MatrixWithAllocationPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::MatrixWithAllocationPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::MatrixWithAllocationPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::MatrixWithAllocationPrice::Item + + attr_accessor matrix_with_allocation_config: Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig + + attr_accessor maximum: Orb::Models::Price::MatrixWithAllocationPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::MatrixWithAllocationPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :matrix_with_allocation + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::MatrixWithAllocationPrice::price_type + + attr_accessor dimensional_price_configuration: Orb::Models::Price::MatrixWithAllocationPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::MatrixWithAllocationPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::MatrixWithAllocationPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::MatrixWithAllocationPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::MatrixWithAllocationPrice::Item, + matrix_with_allocation_config: Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig, + maximum: Orb::Models::Price::MatrixWithAllocationPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::MatrixWithAllocationPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::MatrixWithAllocationPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::MatrixWithAllocationPrice::DimensionalPriceConfiguration?, + model_type: :matrix_with_allocation + ) -> void + | ( + ?Orb::Models::Price::matrix_with_allocation_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::matrix_with_allocation_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::MatrixWithAllocationPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithAllocationPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::MatrixWithAllocationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithAllocationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::MatrixWithAllocationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::MatrixWithAllocationPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::MatrixWithAllocationPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithAllocationPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::MatrixWithAllocationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithAllocationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::MatrixWithAllocationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::MatrixWithAllocationPrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithAllocationPrice::item + end + + type matrix_with_allocation_config = + { + allocation: Float, + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue] + } + + class MatrixWithAllocationConfig < Orb::BaseModel + attr_accessor allocation: Float + + attr_accessor default_unit_amount: String + + attr_accessor dimensions: Array[String?] + + attr_accessor matrix_values: Array[Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue] + + def initialize: + ( + allocation: Float, + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue] + ) -> void + | ( + ?Orb::Models::Price::MatrixWithAllocationPrice::matrix_with_allocation_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithAllocationPrice::matrix_with_allocation_config + + type matrix_value = + { dimension_values: Array[String?], unit_amount: String } + + class MatrixValue < Orb::BaseModel + attr_accessor dimension_values: Array[String?] + + attr_accessor unit_amount: String + + def initialize: + (dimension_values: Array[String?], unit_amount: String) -> void + | ( + ?Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig::matrix_value + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithAllocationPrice::MatrixWithAllocationConfig::matrix_value + end + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::MatrixWithAllocationPrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithAllocationPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::MatrixWithAllocationPrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithAllocationPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::MatrixWithAllocationPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::MatrixWithAllocationPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithAllocationPrice::dimensional_price_configuration + end + end + + type tiered_with_proration_price = + { + id: String, + billable_metric: Orb::Models::Price::TieredWithProrationPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::TieredWithProrationPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::TieredWithProrationPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::TieredWithProrationPrice::Item, + maximum: Orb::Models::Price::TieredWithProrationPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::TieredWithProrationPrice::Minimum?, + minimum_amount: String?, + model_type: :tiered_with_proration, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::TieredWithProrationPrice::price_type, + tiered_with_proration_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::TieredWithProrationPrice::DimensionalPriceConfiguration? + } + + class TieredWithProrationPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::TieredWithProrationPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::TieredWithProrationPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::TieredWithProrationPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::TieredWithProrationPrice::Item + + attr_accessor maximum: Orb::Models::Price::TieredWithProrationPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::TieredWithProrationPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :tiered_with_proration + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::TieredWithProrationPrice::price_type + + attr_accessor tiered_with_proration_config: Hash[Symbol, top] + + attr_accessor dimensional_price_configuration: Orb::Models::Price::TieredWithProrationPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::TieredWithProrationPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::TieredWithProrationPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::TieredWithProrationPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::TieredWithProrationPrice::Item, + maximum: Orb::Models::Price::TieredWithProrationPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::TieredWithProrationPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::TieredWithProrationPrice::price_type, + tiered_with_proration_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::TieredWithProrationPrice::DimensionalPriceConfiguration?, + model_type: :tiered_with_proration + ) -> void + | ( + ?Orb::Models::Price::tiered_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::tiered_with_proration_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::TieredWithProrationPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredWithProrationPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::TieredWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::TieredWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::TieredWithProrationPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::TieredWithProrationPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredWithProrationPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::TieredWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::TieredWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::TieredWithProrationPrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredWithProrationPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::TieredWithProrationPrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredWithProrationPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::TieredWithProrationPrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredWithProrationPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::TieredWithProrationPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::TieredWithProrationPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::TieredWithProrationPrice::dimensional_price_configuration + end + end + + type unit_with_proration_price = + { + id: String, + billable_metric: Orb::Models::Price::UnitWithProrationPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::UnitWithProrationPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::UnitWithProrationPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::UnitWithProrationPrice::Item, + maximum: Orb::Models::Price::UnitWithProrationPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::UnitWithProrationPrice::Minimum?, + minimum_amount: String?, + model_type: :unit_with_proration, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::UnitWithProrationPrice::price_type, + unit_with_proration_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::UnitWithProrationPrice::DimensionalPriceConfiguration? + } + + class UnitWithProrationPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::UnitWithProrationPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::UnitWithProrationPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::UnitWithProrationPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::UnitWithProrationPrice::Item + + attr_accessor maximum: Orb::Models::Price::UnitWithProrationPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::UnitWithProrationPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :unit_with_proration + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::UnitWithProrationPrice::price_type + + attr_accessor unit_with_proration_config: Hash[Symbol, top] + + attr_accessor dimensional_price_configuration: Orb::Models::Price::UnitWithProrationPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::UnitWithProrationPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::UnitWithProrationPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::UnitWithProrationPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::UnitWithProrationPrice::Item, + maximum: Orb::Models::Price::UnitWithProrationPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::UnitWithProrationPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::UnitWithProrationPrice::price_type, + unit_with_proration_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::UnitWithProrationPrice::DimensionalPriceConfiguration?, + model_type: :unit_with_proration + ) -> void + | ( + ?Orb::Models::Price::unit_with_proration_price | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::unit_with_proration_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::UnitWithProrationPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitWithProrationPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::UnitWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::UnitWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::UnitWithProrationPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::UnitWithProrationPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitWithProrationPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::UnitWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::UnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::UnitWithProrationPrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitWithProrationPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::UnitWithProrationPrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitWithProrationPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::UnitWithProrationPrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitWithProrationPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::UnitWithProrationPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::UnitWithProrationPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::UnitWithProrationPrice::dimensional_price_configuration + end + end + + type grouped_allocation_price = + { + id: String, + billable_metric: Orb::Models::Price::GroupedAllocationPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::GroupedAllocationPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::GroupedAllocationPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + grouped_allocation_config: Hash[Symbol, top], + invoicing_cycle_configuration: Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::GroupedAllocationPrice::Item, + maximum: Orb::Models::Price::GroupedAllocationPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::GroupedAllocationPrice::Minimum?, + minimum_amount: String?, + model_type: :grouped_allocation, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::GroupedAllocationPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::GroupedAllocationPrice::DimensionalPriceConfiguration? + } + + class GroupedAllocationPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::GroupedAllocationPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::GroupedAllocationPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::GroupedAllocationPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor grouped_allocation_config: Hash[Symbol, top] + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::GroupedAllocationPrice::Item + + attr_accessor maximum: Orb::Models::Price::GroupedAllocationPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::GroupedAllocationPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :grouped_allocation + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::GroupedAllocationPrice::price_type + + attr_accessor dimensional_price_configuration: Orb::Models::Price::GroupedAllocationPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::GroupedAllocationPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::GroupedAllocationPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::GroupedAllocationPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + grouped_allocation_config: Hash[Symbol, top], + invoicing_cycle_configuration: Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::GroupedAllocationPrice::Item, + maximum: Orb::Models::Price::GroupedAllocationPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::GroupedAllocationPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::GroupedAllocationPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::GroupedAllocationPrice::DimensionalPriceConfiguration?, + model_type: :grouped_allocation + ) -> void + | ( + ?Orb::Models::Price::grouped_allocation_price | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::grouped_allocation_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::GroupedAllocationPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedAllocationPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::GroupedAllocationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedAllocationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::GroupedAllocationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::GroupedAllocationPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::GroupedAllocationPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedAllocationPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::GroupedAllocationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedAllocationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::GroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::GroupedAllocationPrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedAllocationPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::GroupedAllocationPrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedAllocationPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::GroupedAllocationPrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedAllocationPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::GroupedAllocationPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::GroupedAllocationPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedAllocationPrice::dimensional_price_configuration + end + end + + type grouped_with_prorated_minimum_price = + { + id: String, + billable_metric: Orb::Models::Price::GroupedWithProratedMinimumPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::GroupedWithProratedMinimumPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::GroupedWithProratedMinimumPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + grouped_with_prorated_minimum_config: Hash[Symbol, top], + invoicing_cycle_configuration: Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::GroupedWithProratedMinimumPrice::Item, + maximum: Orb::Models::Price::GroupedWithProratedMinimumPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::GroupedWithProratedMinimumPrice::Minimum?, + minimum_amount: String?, + model_type: :grouped_with_prorated_minimum, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::GroupedWithProratedMinimumPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::GroupedWithProratedMinimumPrice::DimensionalPriceConfiguration? + } + + class GroupedWithProratedMinimumPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::GroupedWithProratedMinimumPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::GroupedWithProratedMinimumPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::GroupedWithProratedMinimumPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor grouped_with_prorated_minimum_config: Hash[Symbol, top] + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::GroupedWithProratedMinimumPrice::Item + + attr_accessor maximum: Orb::Models::Price::GroupedWithProratedMinimumPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::GroupedWithProratedMinimumPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :grouped_with_prorated_minimum + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::GroupedWithProratedMinimumPrice::price_type + + attr_accessor dimensional_price_configuration: Orb::Models::Price::GroupedWithProratedMinimumPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::GroupedWithProratedMinimumPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::GroupedWithProratedMinimumPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::GroupedWithProratedMinimumPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + grouped_with_prorated_minimum_config: Hash[Symbol, top], + invoicing_cycle_configuration: Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::GroupedWithProratedMinimumPrice::Item, + maximum: Orb::Models::Price::GroupedWithProratedMinimumPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::GroupedWithProratedMinimumPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::GroupedWithProratedMinimumPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::GroupedWithProratedMinimumPrice::DimensionalPriceConfiguration?, + model_type: :grouped_with_prorated_minimum + ) -> void + | ( + ?Orb::Models::Price::grouped_with_prorated_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::grouped_with_prorated_minimum_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::GroupedWithProratedMinimumPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedWithProratedMinimumPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::GroupedWithProratedMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedWithProratedMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::GroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::GroupedWithProratedMinimumPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::GroupedWithProratedMinimumPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedWithProratedMinimumPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::GroupedWithProratedMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedWithProratedMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::GroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::GroupedWithProratedMinimumPrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedWithProratedMinimumPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::GroupedWithProratedMinimumPrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedWithProratedMinimumPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::GroupedWithProratedMinimumPrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedWithProratedMinimumPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::GroupedWithProratedMinimumPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::GroupedWithProratedMinimumPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedWithProratedMinimumPrice::dimensional_price_configuration + end + end + + type grouped_with_metered_minimum_price = + { + id: String, + billable_metric: Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::GroupedWithMeteredMinimumPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::GroupedWithMeteredMinimumPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + grouped_with_metered_minimum_config: Hash[Symbol, top], + invoicing_cycle_configuration: Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::GroupedWithMeteredMinimumPrice::Item, + maximum: Orb::Models::Price::GroupedWithMeteredMinimumPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::GroupedWithMeteredMinimumPrice::Minimum?, + minimum_amount: String?, + model_type: :grouped_with_metered_minimum, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::GroupedWithMeteredMinimumPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::GroupedWithMeteredMinimumPrice::DimensionalPriceConfiguration? + } + + class GroupedWithMeteredMinimumPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::GroupedWithMeteredMinimumPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::GroupedWithMeteredMinimumPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor grouped_with_metered_minimum_config: Hash[Symbol, top] + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::GroupedWithMeteredMinimumPrice::Item + + attr_accessor maximum: Orb::Models::Price::GroupedWithMeteredMinimumPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::GroupedWithMeteredMinimumPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :grouped_with_metered_minimum + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::GroupedWithMeteredMinimumPrice::price_type + + attr_accessor dimensional_price_configuration: Orb::Models::Price::GroupedWithMeteredMinimumPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::GroupedWithMeteredMinimumPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::GroupedWithMeteredMinimumPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + grouped_with_metered_minimum_config: Hash[Symbol, top], + invoicing_cycle_configuration: Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::GroupedWithMeteredMinimumPrice::Item, + maximum: Orb::Models::Price::GroupedWithMeteredMinimumPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::GroupedWithMeteredMinimumPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::GroupedWithMeteredMinimumPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::GroupedWithMeteredMinimumPrice::DimensionalPriceConfiguration?, + model_type: :grouped_with_metered_minimum + ) -> void + | ( + ?Orb::Models::Price::grouped_with_metered_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::grouped_with_metered_minimum_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::GroupedWithMeteredMinimumPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedWithMeteredMinimumPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::GroupedWithMeteredMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedWithMeteredMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::GroupedWithMeteredMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::GroupedWithMeteredMinimumPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::GroupedWithMeteredMinimumPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedWithMeteredMinimumPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::GroupedWithMeteredMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedWithMeteredMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::GroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::GroupedWithMeteredMinimumPrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedWithMeteredMinimumPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::GroupedWithMeteredMinimumPrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedWithMeteredMinimumPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::GroupedWithMeteredMinimumPrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedWithMeteredMinimumPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::GroupedWithMeteredMinimumPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::GroupedWithMeteredMinimumPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedWithMeteredMinimumPrice::dimensional_price_configuration + end + end + + type matrix_with_display_name_price = + { + id: String, + billable_metric: Orb::Models::Price::MatrixWithDisplayNamePrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::MatrixWithDisplayNamePrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::MatrixWithDisplayNamePrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::MatrixWithDisplayNamePrice::Item, + matrix_with_display_name_config: Hash[Symbol, top], + maximum: Orb::Models::Price::MatrixWithDisplayNamePrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::MatrixWithDisplayNamePrice::Minimum?, + minimum_amount: String?, + model_type: :matrix_with_display_name, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::MatrixWithDisplayNamePrice::price_type, + dimensional_price_configuration: Orb::Models::Price::MatrixWithDisplayNamePrice::DimensionalPriceConfiguration? + } + + class MatrixWithDisplayNamePrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::MatrixWithDisplayNamePrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::MatrixWithDisplayNamePrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::MatrixWithDisplayNamePrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::MatrixWithDisplayNamePrice::Item + + attr_accessor matrix_with_display_name_config: Hash[Symbol, top] + + attr_accessor maximum: Orb::Models::Price::MatrixWithDisplayNamePrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::MatrixWithDisplayNamePrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :matrix_with_display_name + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::MatrixWithDisplayNamePrice::price_type + + attr_accessor dimensional_price_configuration: Orb::Models::Price::MatrixWithDisplayNamePrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::MatrixWithDisplayNamePrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::MatrixWithDisplayNamePrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::MatrixWithDisplayNamePrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::MatrixWithDisplayNamePrice::Item, + matrix_with_display_name_config: Hash[Symbol, top], + maximum: Orb::Models::Price::MatrixWithDisplayNamePrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::MatrixWithDisplayNamePrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::MatrixWithDisplayNamePrice::price_type, + dimensional_price_configuration: Orb::Models::Price::MatrixWithDisplayNamePrice::DimensionalPriceConfiguration?, + model_type: :matrix_with_display_name + ) -> void + | ( + ?Orb::Models::Price::matrix_with_display_name_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::matrix_with_display_name_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::MatrixWithDisplayNamePrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithDisplayNamePrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::MatrixWithDisplayNamePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithDisplayNamePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::MatrixWithDisplayNamePrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::MatrixWithDisplayNamePrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::MatrixWithDisplayNamePrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithDisplayNamePrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::MatrixWithDisplayNamePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithDisplayNamePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::MatrixWithDisplayNamePrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::MatrixWithDisplayNamePrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithDisplayNamePrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::MatrixWithDisplayNamePrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithDisplayNamePrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::MatrixWithDisplayNamePrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithDisplayNamePrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::MatrixWithDisplayNamePrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::MatrixWithDisplayNamePrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MatrixWithDisplayNamePrice::dimensional_price_configuration + end + end + + type bulk_with_proration_price = + { + id: String, + billable_metric: Orb::Models::Price::BulkWithProrationPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration, + bulk_with_proration_config: Hash[Symbol, top], + cadence: Orb::Models::Price::BulkWithProrationPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::BulkWithProrationPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::BulkWithProrationPrice::Item, + maximum: Orb::Models::Price::BulkWithProrationPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::BulkWithProrationPrice::Minimum?, + minimum_amount: String?, + model_type: :bulk_with_proration, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::BulkWithProrationPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::BulkWithProrationPrice::DimensionalPriceConfiguration? + } + + class BulkWithProrationPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::BulkWithProrationPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration + + attr_accessor bulk_with_proration_config: Hash[Symbol, top] + + attr_accessor cadence: Orb::Models::Price::BulkWithProrationPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::BulkWithProrationPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::BulkWithProrationPrice::Item + + attr_accessor maximum: Orb::Models::Price::BulkWithProrationPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::BulkWithProrationPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :bulk_with_proration + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::BulkWithProrationPrice::price_type + + attr_accessor dimensional_price_configuration: Orb::Models::Price::BulkWithProrationPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::BulkWithProrationPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration, + bulk_with_proration_config: Hash[Symbol, top], + cadence: Orb::Models::Price::BulkWithProrationPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::BulkWithProrationPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::BulkWithProrationPrice::Item, + maximum: Orb::Models::Price::BulkWithProrationPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::BulkWithProrationPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::BulkWithProrationPrice::price_type, + dimensional_price_configuration: Orb::Models::Price::BulkWithProrationPrice::DimensionalPriceConfiguration?, + model_type: :bulk_with_proration + ) -> void + | ( + ?Orb::Models::Price::bulk_with_proration_price | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::bulk_with_proration_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::BulkWithProrationPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkWithProrationPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::BulkWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::BulkWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::BulkWithProrationPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::BulkWithProrationPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkWithProrationPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::BulkWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::BulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::BulkWithProrationPrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkWithProrationPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::BulkWithProrationPrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkWithProrationPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::BulkWithProrationPrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkWithProrationPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::BulkWithProrationPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::BulkWithProrationPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::BulkWithProrationPrice::dimensional_price_configuration + end + end + + type grouped_tiered_package_price = + { + id: String, + billable_metric: Orb::Models::Price::GroupedTieredPackagePrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::GroupedTieredPackagePrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::GroupedTieredPackagePrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + grouped_tiered_package_config: Hash[Symbol, top], + invoicing_cycle_configuration: Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::GroupedTieredPackagePrice::Item, + maximum: Orb::Models::Price::GroupedTieredPackagePrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::GroupedTieredPackagePrice::Minimum?, + minimum_amount: String?, + model_type: :grouped_tiered_package, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::GroupedTieredPackagePrice::price_type, + dimensional_price_configuration: Orb::Models::Price::GroupedTieredPackagePrice::DimensionalPriceConfiguration? + } + + class GroupedTieredPackagePrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::GroupedTieredPackagePrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::GroupedTieredPackagePrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::GroupedTieredPackagePrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor grouped_tiered_package_config: Hash[Symbol, top] + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::GroupedTieredPackagePrice::Item + + attr_accessor maximum: Orb::Models::Price::GroupedTieredPackagePrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::GroupedTieredPackagePrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :grouped_tiered_package + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::GroupedTieredPackagePrice::price_type + + attr_accessor dimensional_price_configuration: Orb::Models::Price::GroupedTieredPackagePrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::GroupedTieredPackagePrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::GroupedTieredPackagePrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::GroupedTieredPackagePrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + grouped_tiered_package_config: Hash[Symbol, top], + invoicing_cycle_configuration: Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::GroupedTieredPackagePrice::Item, + maximum: Orb::Models::Price::GroupedTieredPackagePrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::GroupedTieredPackagePrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::GroupedTieredPackagePrice::price_type, + dimensional_price_configuration: Orb::Models::Price::GroupedTieredPackagePrice::DimensionalPriceConfiguration?, + model_type: :grouped_tiered_package + ) -> void + | ( + ?Orb::Models::Price::grouped_tiered_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::grouped_tiered_package_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::GroupedTieredPackagePrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedTieredPackagePrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::GroupedTieredPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedTieredPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::GroupedTieredPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::GroupedTieredPackagePrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::GroupedTieredPackagePrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedTieredPackagePrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::GroupedTieredPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedTieredPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::GroupedTieredPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::GroupedTieredPackagePrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedTieredPackagePrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::GroupedTieredPackagePrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedTieredPackagePrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::GroupedTieredPackagePrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedTieredPackagePrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::GroupedTieredPackagePrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::GroupedTieredPackagePrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::GroupedTieredPackagePrice::dimensional_price_configuration + end + end + + type max_group_tiered_package_price = + { + id: String, + billable_metric: Orb::Models::Price::MaxGroupTieredPackagePrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::MaxGroupTieredPackagePrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::MaxGroupTieredPackagePrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::MaxGroupTieredPackagePrice::Item, + max_group_tiered_package_config: Hash[Symbol, top], + maximum: Orb::Models::Price::MaxGroupTieredPackagePrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::MaxGroupTieredPackagePrice::Minimum?, + minimum_amount: String?, + model_type: :max_group_tiered_package, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::MaxGroupTieredPackagePrice::price_type, + dimensional_price_configuration: Orb::Models::Price::MaxGroupTieredPackagePrice::DimensionalPriceConfiguration? + } + + class MaxGroupTieredPackagePrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::MaxGroupTieredPackagePrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::MaxGroupTieredPackagePrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::MaxGroupTieredPackagePrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::MaxGroupTieredPackagePrice::Item + + attr_accessor max_group_tiered_package_config: Hash[Symbol, top] + + attr_accessor maximum: Orb::Models::Price::MaxGroupTieredPackagePrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::MaxGroupTieredPackagePrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :max_group_tiered_package + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::MaxGroupTieredPackagePrice::price_type + + attr_accessor dimensional_price_configuration: Orb::Models::Price::MaxGroupTieredPackagePrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::MaxGroupTieredPackagePrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::MaxGroupTieredPackagePrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::MaxGroupTieredPackagePrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::MaxGroupTieredPackagePrice::Item, + max_group_tiered_package_config: Hash[Symbol, top], + maximum: Orb::Models::Price::MaxGroupTieredPackagePrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::MaxGroupTieredPackagePrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::MaxGroupTieredPackagePrice::price_type, + dimensional_price_configuration: Orb::Models::Price::MaxGroupTieredPackagePrice::DimensionalPriceConfiguration?, + model_type: :max_group_tiered_package + ) -> void + | ( + ?Orb::Models::Price::max_group_tiered_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::max_group_tiered_package_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::MaxGroupTieredPackagePrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MaxGroupTieredPackagePrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::MaxGroupTieredPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MaxGroupTieredPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::MaxGroupTieredPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::MaxGroupTieredPackagePrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::MaxGroupTieredPackagePrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MaxGroupTieredPackagePrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::MaxGroupTieredPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MaxGroupTieredPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::MaxGroupTieredPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::MaxGroupTieredPackagePrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MaxGroupTieredPackagePrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::MaxGroupTieredPackagePrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MaxGroupTieredPackagePrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::MaxGroupTieredPackagePrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MaxGroupTieredPackagePrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::MaxGroupTieredPackagePrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::MaxGroupTieredPackagePrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::MaxGroupTieredPackagePrice::dimensional_price_configuration + end + end + + type scalable_matrix_with_unit_pricing_price = + { + id: String, + billable_metric: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Item, + maximum: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Minimum?, + minimum_amount: String?, + model_type: :scalable_matrix_with_unit_pricing, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::price_type, + scalable_matrix_with_unit_pricing_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::DimensionalPriceConfiguration? + } + + class ScalableMatrixWithUnitPricingPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Item + + attr_accessor maximum: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :scalable_matrix_with_unit_pricing + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::price_type + + attr_accessor scalable_matrix_with_unit_pricing_config: Hash[Symbol, top] + + attr_accessor dimensional_price_configuration: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Item, + maximum: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::price_type, + scalable_matrix_with_unit_pricing_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::DimensionalPriceConfiguration?, + model_type: :scalable_matrix_with_unit_pricing + ) -> void + | ( + ?Orb::Models::Price::scalable_matrix_with_unit_pricing_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::scalable_matrix_with_unit_pricing_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ScalableMatrixWithUnitPricingPrice::dimensional_price_configuration + end + end + + type scalable_matrix_with_tiered_pricing_price = + { + id: String, + billable_metric: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Item, + maximum: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Minimum?, + minimum_amount: String?, + model_type: :scalable_matrix_with_tiered_pricing, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::price_type, + scalable_matrix_with_tiered_pricing_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::DimensionalPriceConfiguration? + } + + class ScalableMatrixWithTieredPricingPrice < Orb::BaseModel + attr_accessor id: String + + attr_accessor billable_metric: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillableMetric? + + attr_accessor billing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration + + attr_accessor cadence: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::cadence + + attr_accessor conversion_rate: Float? + + attr_accessor created_at: Time + + attr_accessor credit_allocation: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::CreditAllocation? + + attr_accessor currency: String + + attr_accessor discount: Orb::Models::discount? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoicing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration? + + attr_accessor item: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Item + + attr_accessor maximum: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Maximum? + + attr_accessor maximum_amount: String? + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Minimum? + + attr_accessor minimum_amount: String? + + attr_accessor model_type: :scalable_matrix_with_tiered_pricing + + attr_accessor name: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor price_type: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::price_type + + attr_accessor scalable_matrix_with_tiered_pricing_config: Hash[Symbol, top] + + attr_accessor dimensional_price_configuration: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::DimensionalPriceConfiguration? + + def initialize: + ( + id: String, + billable_metric: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillableMetric?, + billing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration, + cadence: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::cadence, + conversion_rate: Float?, + created_at: Time, + credit_allocation: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::CreditAllocation?, + currency: String, + discount: Orb::Models::discount?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoicing_cycle_configuration: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration?, + item: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Item, + maximum: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Maximum?, + maximum_amount: String?, + metadata: Hash[Symbol, String], + minimum: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::Minimum?, + minimum_amount: String?, + name: String, + plan_phase_order: Integer?, + price_type: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::price_type, + scalable_matrix_with_tiered_pricing_config: Hash[Symbol, top], + dimensional_price_configuration: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::DimensionalPriceConfiguration?, + model_type: :scalable_matrix_with_tiered_pricing + ) -> void + | ( + ?Orb::Models::Price::scalable_matrix_with_tiered_pricing_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::scalable_matrix_with_tiered_pricing_price + + type billable_metric = { id: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + def initialize: + (id: String) -> void + | ( + ?Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::billable_metric + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::duration_unit] + end + end + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::cadence] + end + + type credit_allocation = { allows_rollover: bool, currency: String } + + class CreditAllocation < Orb::BaseModel + attr_accessor allows_rollover: bool + + attr_accessor currency: String + + def initialize: + (allows_rollover: bool, currency: String) -> void + | ( + ?Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::credit_allocation + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::credit_allocation + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::duration_unit] + end + end + + type item = { id: String, name: String } + + class Item < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::item + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::item + end + + type maximum = + { applies_to_price_ids: Array[String], maximum_amount: String } + + class Maximum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String + ) -> void + | ( + ?Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::maximum + end + + type minimum = + { applies_to_price_ids: Array[String], minimum_amount: String } + + class Minimum < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor minimum_amount: String + + def initialize: + ( + applies_to_price_ids: Array[String], + minimum_amount: String + ) -> void + | ( + ?Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::minimum + end + + type price_type = :usage_price | :fixed_price + + class PriceType < Orb::Enum + USAGE_PRICE: :usage_price + FIXED_PRICE: :fixed_price + + def self.values: -> Array[Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::price_type] + end + + type dimensional_price_configuration = + { + dimension_values: Array[String], + dimensional_price_group_id: String + } + + class DimensionalPriceConfiguration < Orb::BaseModel + attr_accessor dimension_values: Array[String] + + attr_accessor dimensional_price_group_id: String + + def initialize: + ( + dimension_values: Array[String], + dimensional_price_group_id: String + ) -> void + | ( + ?Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::dimensional_price_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Price::ScalableMatrixWithTieredPricingPrice::dimensional_price_configuration + end + end + + private def self.variants: -> [[:unit, Orb::Models::Price::UnitPrice], [:package, Orb::Models::Price::PackagePrice], [:matrix, Orb::Models::Price::MatrixPrice], [:tiered, Orb::Models::Price::TieredPrice], [:tiered_bps, Orb::Models::Price::TieredBpsPrice], [:bps, Orb::Models::Price::BpsPrice], [:bulk_bps, Orb::Models::Price::BulkBpsPrice], [:bulk, Orb::Models::Price::BulkPrice], [:threshold_total_amount, Orb::Models::Price::ThresholdTotalAmountPrice], [:tiered_package, Orb::Models::Price::TieredPackagePrice], [:grouped_tiered, Orb::Models::Price::GroupedTieredPrice], [:tiered_with_minimum, Orb::Models::Price::TieredWithMinimumPrice], [:tiered_package_with_minimum, Orb::Models::Price::TieredPackageWithMinimumPrice], [:package_with_allocation, Orb::Models::Price::PackageWithAllocationPrice], [:unit_with_percent, Orb::Models::Price::UnitWithPercentPrice], [:matrix_with_allocation, Orb::Models::Price::MatrixWithAllocationPrice], [:tiered_with_proration, Orb::Models::Price::TieredWithProrationPrice], [:unit_with_proration, Orb::Models::Price::UnitWithProrationPrice], [:grouped_allocation, Orb::Models::Price::GroupedAllocationPrice], [:grouped_with_prorated_minimum, Orb::Models::Price::GroupedWithProratedMinimumPrice], [:grouped_with_metered_minimum, Orb::Models::Price::GroupedWithMeteredMinimumPrice], [:matrix_with_display_name, Orb::Models::Price::MatrixWithDisplayNamePrice], [:bulk_with_proration, Orb::Models::Price::BulkWithProrationPrice], [:grouped_tiered_package, Orb::Models::Price::GroupedTieredPackagePrice], [:max_group_tiered_package, Orb::Models::Price::MaxGroupTieredPackagePrice], [:scalable_matrix_with_unit_pricing, Orb::Models::Price::ScalableMatrixWithUnitPricingPrice], [:scalable_matrix_with_tiered_pricing, Orb::Models::Price::ScalableMatrixWithTieredPricingPrice]] + end + end +end diff --git a/sig/orb/models/price_create_params.rbs b/sig/orb/models/price_create_params.rbs new file mode 100644 index 00000000..cc2cb76a --- /dev/null +++ b/sig/orb/models/price_create_params.rbs @@ -0,0 +1,578 @@ +module Orb + module Models + type price_create_params = + { + cadence: Orb::Models::PriceCreateParams::cadence, + currency: String, + item_id: String, + model_type: Orb::Models::PriceCreateParams::model_type, + name: String, + unit_config: Orb::Models::PriceCreateParams::UnitConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PriceCreateParams::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PriceCreateParams::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + package_config: Orb::Models::PriceCreateParams::PackageConfig, + matrix_config: Orb::Models::PriceCreateParams::MatrixConfig, + matrix_with_allocation_config: Orb::Models::PriceCreateParams::MatrixWithAllocationConfig, + tiered_config: Orb::Models::PriceCreateParams::TieredConfig, + tiered_bps_config: Orb::Models::PriceCreateParams::TieredBpsConfig, + bps_config: Orb::Models::PriceCreateParams::BpsConfig, + bulk_bps_config: Orb::Models::PriceCreateParams::BulkBpsConfig, + bulk_config: Orb::Models::PriceCreateParams::BulkConfig, + threshold_total_amount_config: Hash[Symbol, top], + tiered_package_config: Hash[Symbol, top], + grouped_tiered_config: Hash[Symbol, top], + max_group_tiered_package_config: Hash[Symbol, top], + tiered_with_minimum_config: Hash[Symbol, top], + package_with_allocation_config: Hash[Symbol, top], + tiered_package_with_minimum_config: Hash[Symbol, top], + unit_with_percent_config: Hash[Symbol, top], + tiered_with_proration_config: Hash[Symbol, top], + unit_with_proration_config: Hash[Symbol, top], + grouped_allocation_config: Hash[Symbol, top], + grouped_with_prorated_minimum_config: Hash[Symbol, top], + grouped_with_metered_minimum_config: Hash[Symbol, top], + matrix_with_display_name_config: Hash[Symbol, top], + bulk_with_proration_config: Hash[Symbol, top], + grouped_tiered_package_config: Hash[Symbol, top], + scalable_matrix_with_unit_pricing_config: Hash[Symbol, top], + scalable_matrix_with_tiered_pricing_config: Hash[Symbol, top] + } + & Orb::request_parameters + + class PriceCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor cadence: Orb::Models::PriceCreateParams::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: Orb::Models::PriceCreateParams::model_type + + attr_accessor name: String + + attr_accessor unit_config: Orb::Models::PriceCreateParams::UnitConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::PriceCreateParams::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::PriceCreateParams::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor package_config: Orb::Models::PriceCreateParams::PackageConfig + + attr_accessor matrix_config: Orb::Models::PriceCreateParams::MatrixConfig + + attr_accessor matrix_with_allocation_config: Orb::Models::PriceCreateParams::MatrixWithAllocationConfig + + attr_accessor tiered_config: Orb::Models::PriceCreateParams::TieredConfig + + attr_accessor tiered_bps_config: Orb::Models::PriceCreateParams::TieredBpsConfig + + attr_accessor bps_config: Orb::Models::PriceCreateParams::BpsConfig + + attr_accessor bulk_bps_config: Orb::Models::PriceCreateParams::BulkBpsConfig + + attr_accessor bulk_config: Orb::Models::PriceCreateParams::BulkConfig + + attr_accessor threshold_total_amount_config: Hash[Symbol, top] + + attr_accessor tiered_package_config: Hash[Symbol, top] + + attr_accessor grouped_tiered_config: Hash[Symbol, top] + + attr_accessor max_group_tiered_package_config: Hash[Symbol, top] + + attr_accessor tiered_with_minimum_config: Hash[Symbol, top] + + attr_accessor package_with_allocation_config: Hash[Symbol, top] + + attr_accessor tiered_package_with_minimum_config: Hash[Symbol, top] + + attr_accessor unit_with_percent_config: Hash[Symbol, top] + + attr_accessor tiered_with_proration_config: Hash[Symbol, top] + + attr_accessor unit_with_proration_config: Hash[Symbol, top] + + attr_accessor grouped_allocation_config: Hash[Symbol, top] + + attr_accessor grouped_with_prorated_minimum_config: Hash[Symbol, top] + + attr_accessor grouped_with_metered_minimum_config: Hash[Symbol, top] + + attr_accessor matrix_with_display_name_config: Hash[Symbol, top] + + attr_accessor bulk_with_proration_config: Hash[Symbol, top] + + attr_accessor grouped_tiered_package_config: Hash[Symbol, top] + + attr_accessor scalable_matrix_with_unit_pricing_config: Hash[Symbol, top] + + attr_accessor scalable_matrix_with_tiered_pricing_config: Hash[Symbol, top] + + def initialize: + ( + cadence: Orb::Models::PriceCreateParams::cadence, + currency: String, + item_id: String, + model_type: Orb::Models::PriceCreateParams::model_type, + name: String, + unit_config: Orb::Models::PriceCreateParams::UnitConfig, + package_config: Orb::Models::PriceCreateParams::PackageConfig, + matrix_config: Orb::Models::PriceCreateParams::MatrixConfig, + matrix_with_allocation_config: Orb::Models::PriceCreateParams::MatrixWithAllocationConfig, + tiered_config: Orb::Models::PriceCreateParams::TieredConfig, + tiered_bps_config: Orb::Models::PriceCreateParams::TieredBpsConfig, + bps_config: Orb::Models::PriceCreateParams::BpsConfig, + bulk_bps_config: Orb::Models::PriceCreateParams::BulkBpsConfig, + bulk_config: Orb::Models::PriceCreateParams::BulkConfig, + threshold_total_amount_config: Hash[Symbol, top], + tiered_package_config: Hash[Symbol, top], + grouped_tiered_config: Hash[Symbol, top], + max_group_tiered_package_config: Hash[Symbol, top], + tiered_with_minimum_config: Hash[Symbol, top], + package_with_allocation_config: Hash[Symbol, top], + tiered_package_with_minimum_config: Hash[Symbol, top], + unit_with_percent_config: Hash[Symbol, top], + tiered_with_proration_config: Hash[Symbol, top], + unit_with_proration_config: Hash[Symbol, top], + grouped_allocation_config: Hash[Symbol, top], + grouped_with_prorated_minimum_config: Hash[Symbol, top], + grouped_with_metered_minimum_config: Hash[Symbol, top], + matrix_with_display_name_config: Hash[Symbol, top], + bulk_with_proration_config: Hash[Symbol, top], + grouped_tiered_package_config: Hash[Symbol, top], + scalable_matrix_with_unit_pricing_config: Hash[Symbol, top], + scalable_matrix_with_tiered_pricing_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PriceCreateParams::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PriceCreateParams::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::price_create_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::price_create_params + + type cadence = + :annual | :semi_annual | :monthly | :quarterly | :one_time | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::PriceCreateParams::cadence] + end + + type model_type = :scalable_matrix_with_tiered_pricing + + class ModelType < Orb::Enum + SCALABLE_MATRIX_WITH_TIERED_PRICING: :scalable_matrix_with_tiered_pricing + + def self.values: -> Array[Orb::Models::PriceCreateParams::model_type] + end + + type unit_config = { unit_amount: String } + + class UnitConfig < Orb::BaseModel + attr_accessor unit_amount: String + + def initialize: + (unit_amount: String) -> void + | ( + ?Orb::Models::PriceCreateParams::unit_config | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::unit_config + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PriceCreateParams::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PriceCreateParams::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PriceCreateParams::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PriceCreateParams::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PriceCreateParams::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::PriceCreateParams::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::PriceCreateParams::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::PriceCreateParams::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::PriceCreateParams::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::PriceCreateParams::InvoicingCycleConfiguration::duration_unit] + end + end + + type package_config = { package_amount: String, package_size: Integer } + + class PackageConfig < Orb::BaseModel + attr_accessor package_amount: String + + attr_accessor package_size: Integer + + def initialize: + (package_amount: String, package_size: Integer) -> void + | ( + ?Orb::Models::PriceCreateParams::package_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::package_config + end + + type matrix_config = + { + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::PriceCreateParams::MatrixConfig::MatrixValue] + } + + class MatrixConfig < Orb::BaseModel + attr_accessor default_unit_amount: String + + attr_accessor dimensions: Array[String?] + + attr_accessor matrix_values: Array[Orb::Models::PriceCreateParams::MatrixConfig::MatrixValue] + + def initialize: + ( + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::PriceCreateParams::MatrixConfig::MatrixValue] + ) -> void + | ( + ?Orb::Models::PriceCreateParams::matrix_config | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::matrix_config + + type matrix_value = + { dimension_values: Array[String?], unit_amount: String } + + class MatrixValue < Orb::BaseModel + attr_accessor dimension_values: Array[String?] + + attr_accessor unit_amount: String + + def initialize: + (dimension_values: Array[String?], unit_amount: String) -> void + | ( + ?Orb::Models::PriceCreateParams::MatrixConfig::matrix_value + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::MatrixConfig::matrix_value + end + end + + type matrix_with_allocation_config = + { + allocation: Float, + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::PriceCreateParams::MatrixWithAllocationConfig::MatrixValue] + } + + class MatrixWithAllocationConfig < Orb::BaseModel + attr_accessor allocation: Float + + attr_accessor default_unit_amount: String + + attr_accessor dimensions: Array[String?] + + attr_accessor matrix_values: Array[Orb::Models::PriceCreateParams::MatrixWithAllocationConfig::MatrixValue] + + def initialize: + ( + allocation: Float, + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::PriceCreateParams::MatrixWithAllocationConfig::MatrixValue] + ) -> void + | ( + ?Orb::Models::PriceCreateParams::matrix_with_allocation_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::matrix_with_allocation_config + + type matrix_value = + { dimension_values: Array[String?], unit_amount: String } + + class MatrixValue < Orb::BaseModel + attr_accessor dimension_values: Array[String?] + + attr_accessor unit_amount: String + + def initialize: + (dimension_values: Array[String?], unit_amount: String) -> void + | ( + ?Orb::Models::PriceCreateParams::MatrixWithAllocationConfig::matrix_value + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::MatrixWithAllocationConfig::matrix_value + end + end + + type tiered_config = + { tiers: Array[Orb::Models::PriceCreateParams::TieredConfig::Tier] } + + class TieredConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::PriceCreateParams::TieredConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::PriceCreateParams::TieredConfig::Tier] + ) -> void + | ( + ?Orb::Models::PriceCreateParams::tiered_config | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::tiered_config + + type tier = + { first_unit: Float, unit_amount: String, last_unit: Float? } + + class Tier < Orb::BaseModel + attr_accessor first_unit: Float + + attr_accessor unit_amount: String + + attr_accessor last_unit: Float? + + def initialize: + (first_unit: Float, unit_amount: String, last_unit: Float?) -> void + | ( + ?Orb::Models::PriceCreateParams::TieredConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::TieredConfig::tier + end + end + + type tiered_bps_config = + { tiers: Array[Orb::Models::PriceCreateParams::TieredBpsConfig::Tier] } + + class TieredBpsConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::PriceCreateParams::TieredBpsConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::PriceCreateParams::TieredBpsConfig::Tier] + ) -> void + | ( + ?Orb::Models::PriceCreateParams::tiered_bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::tiered_bps_config + + type tier = + { + bps: Float, + minimum_amount: String, + maximum_amount: String?, + per_unit_maximum: String? + } + + class Tier < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor minimum_amount: String + + attr_accessor maximum_amount: String? + + attr_accessor per_unit_maximum: String? + + def initialize: + ( + bps: Float, + minimum_amount: String, + maximum_amount: String?, + per_unit_maximum: String? + ) -> void + | ( + ?Orb::Models::PriceCreateParams::TieredBpsConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::TieredBpsConfig::tier + end + end + + type bps_config = { bps: Float, per_unit_maximum: String? } + + class BpsConfig < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor per_unit_maximum: String? + + def initialize: + (bps: Float, per_unit_maximum: String?) -> void + | ( + ?Orb::Models::PriceCreateParams::bps_config | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::bps_config + end + + type bulk_bps_config = + { tiers: Array[Orb::Models::PriceCreateParams::BulkBpsConfig::Tier] } + + class BulkBpsConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::PriceCreateParams::BulkBpsConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::PriceCreateParams::BulkBpsConfig::Tier] + ) -> void + | ( + ?Orb::Models::PriceCreateParams::bulk_bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::bulk_bps_config + + type tier = + { bps: Float, maximum_amount: String?, per_unit_maximum: String? } + + class Tier < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor maximum_amount: String? + + attr_accessor per_unit_maximum: String? + + def initialize: + ( + bps: Float, + maximum_amount: String?, + per_unit_maximum: String? + ) -> void + | ( + ?Orb::Models::PriceCreateParams::BulkBpsConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::BulkBpsConfig::tier + end + end + + type bulk_config = + { tiers: Array[Orb::Models::PriceCreateParams::BulkConfig::Tier] } + + class BulkConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::PriceCreateParams::BulkConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::PriceCreateParams::BulkConfig::Tier] + ) -> void + | ( + ?Orb::Models::PriceCreateParams::bulk_config | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::bulk_config + + type tier = { unit_amount: String, maximum_units: Float? } + + class Tier < Orb::BaseModel + attr_accessor unit_amount: String + + attr_accessor maximum_units: Float? + + def initialize: + (unit_amount: String, maximum_units: Float?) -> void + | ( + ?Orb::Models::PriceCreateParams::BulkConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::PriceCreateParams::BulkConfig::tier + end + end + end + end +end diff --git a/sig/orb/models/price_evaluate_params.rbs b/sig/orb/models/price_evaluate_params.rbs new file mode 100644 index 00000000..8b8fdc08 --- /dev/null +++ b/sig/orb/models/price_evaluate_params.rbs @@ -0,0 +1,47 @@ +module Orb + module Models + type price_evaluate_params = + { + timeframe_end: Time, + timeframe_start: Time, + customer_id: String?, + external_customer_id: String?, + filter: String?, + grouping_keys: Array[String] + } + & Orb::request_parameters + + class PriceEvaluateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor timeframe_end: Time + + attr_accessor timeframe_start: Time + + attr_accessor customer_id: String? + + attr_accessor external_customer_id: String? + + attr_accessor filter: String? + + attr_reader grouping_keys: Array[String]? + + def grouping_keys=: (Array[String]) -> void + + def initialize: + ( + timeframe_end: Time, + timeframe_start: Time, + customer_id: String?, + external_customer_id: String?, + filter: String?, + grouping_keys: Array[String], + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::price_evaluate_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::price_evaluate_params + end + end +end diff --git a/sig/orb/models/price_evaluate_response.rbs b/sig/orb/models/price_evaluate_response.rbs new file mode 100644 index 00000000..0e441694 --- /dev/null +++ b/sig/orb/models/price_evaluate_response.rbs @@ -0,0 +1,16 @@ +module Orb + module Models + type price_evaluate_response = + { data: Array[Orb::Models::EvaluatePriceGroup] } + + class PriceEvaluateResponse < Orb::BaseModel + attr_accessor data: Array[Orb::Models::EvaluatePriceGroup] + + def initialize: + (data: Array[Orb::Models::EvaluatePriceGroup]) -> void + | (?Orb::Models::price_evaluate_response | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::price_evaluate_response + end + end +end diff --git a/sig/orb/models/price_fetch_params.rbs b/sig/orb/models/price_fetch_params.rbs new file mode 100644 index 00000000..ff8c82a1 --- /dev/null +++ b/sig/orb/models/price_fetch_params.rbs @@ -0,0 +1,16 @@ +module Orb + module Models + type price_fetch_params = { } & Orb::request_parameters + + class PriceFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | (?Orb::Models::price_fetch_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::price_fetch_params + end + end +end diff --git a/sig/orb/models/price_list_params.rbs b/sig/orb/models/price_list_params.rbs new file mode 100644 index 00000000..dddd335d --- /dev/null +++ b/sig/orb/models/price_list_params.rbs @@ -0,0 +1,27 @@ +module Orb + module Models + type price_list_params = + { cursor: String?, limit: Integer } & Orb::request_parameters + + class PriceListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor cursor: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + def initialize: + ( + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::price_list_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::price_list_params + end + end +end diff --git a/sig/orb/models/price_update_params.rbs b/sig/orb/models/price_update_params.rbs new file mode 100644 index 00000000..5652a29b --- /dev/null +++ b/sig/orb/models/price_update_params.rbs @@ -0,0 +1,22 @@ +module Orb + module Models + type price_update_params = + { metadata: Hash[Symbol, String?]? } & Orb::request_parameters + + class PriceUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::price_update_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::price_update_params + end + end +end diff --git a/sig/orb/models/prices/external_price_id_fetch_params.rbs b/sig/orb/models/prices/external_price_id_fetch_params.rbs new file mode 100644 index 00000000..9f310f0d --- /dev/null +++ b/sig/orb/models/prices/external_price_id_fetch_params.rbs @@ -0,0 +1,21 @@ +module Orb + module Models + module Prices + type external_price_id_fetch_params = { } & Orb::request_parameters + + class ExternalPriceIDFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::Prices::external_price_id_fetch_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Prices::external_price_id_fetch_params + end + end + end +end diff --git a/sig/orb/models/prices/external_price_id_update_params.rbs b/sig/orb/models/prices/external_price_id_update_params.rbs new file mode 100644 index 00000000..88e192a5 --- /dev/null +++ b/sig/orb/models/prices/external_price_id_update_params.rbs @@ -0,0 +1,27 @@ +module Orb + module Models + module Prices + type external_price_id_update_params = + { metadata: Hash[Symbol, String?]? } & Orb::request_parameters + + class ExternalPriceIDUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::Prices::external_price_id_update_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Prices::external_price_id_update_params + end + end + end +end diff --git a/sig/orb/models/subscription.rbs b/sig/orb/models/subscription.rbs new file mode 100644 index 00000000..5110cf72 --- /dev/null +++ b/sig/orb/models/subscription.rbs @@ -0,0 +1,743 @@ +module Orb + module Models + type subscription = + { + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::Subscription::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::Subscription::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::Subscription::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::Subscription::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::Subscription::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::Subscription::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::Subscription::PriceInterval], + redeemed_coupon: Orb::Models::Subscription::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::Subscription::status, + trial_info: Orb::Models::Subscription::TrialInfo + } + + class Subscription < Orb::BaseModel + attr_accessor id: String + + attr_accessor active_plan_phase_order: Integer? + + attr_accessor adjustment_intervals: Array[Orb::Models::Subscription::AdjustmentInterval] + + attr_accessor auto_collection: bool? + + attr_accessor billing_cycle_anchor_configuration: Orb::Models::Subscription::BillingCycleAnchorConfiguration + + attr_accessor billing_cycle_day: Integer + + attr_accessor created_at: Time + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor customer: Orb::Models::Customer + + attr_accessor default_invoice_memo: String? + + attr_accessor discount_intervals: Array[Orb::Models::Subscription::discount_interval] + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_schedule: Array[Orb::Models::Subscription::FixedFeeQuantitySchedule] + + attr_accessor invoicing_threshold: String? + + attr_accessor maximum_intervals: Array[Orb::Models::Subscription::MaximumInterval] + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum_intervals: Array[Orb::Models::Subscription::MinimumInterval] + + attr_accessor net_terms: Integer + + attr_accessor plan: Orb::Models::Plan + + attr_accessor price_intervals: Array[Orb::Models::Subscription::PriceInterval] + + attr_accessor redeemed_coupon: Orb::Models::Subscription::RedeemedCoupon? + + attr_accessor start_date: Time + + attr_accessor status: Orb::Models::Subscription::status + + attr_accessor trial_info: Orb::Models::Subscription::TrialInfo + + def initialize: + ( + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::Subscription::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::Subscription::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::Subscription::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::Subscription::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::Subscription::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::Subscription::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::Subscription::PriceInterval], + redeemed_coupon: Orb::Models::Subscription::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::Subscription::status, + trial_info: Orb::Models::Subscription::TrialInfo + ) -> void + | (?Orb::Models::subscription | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::subscription + + type adjustment_interval = + { + id: String, + adjustment: Orb::Models::Subscription::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + } + + class AdjustmentInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment: Orb::Models::Subscription::AdjustmentInterval::adjustment + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + adjustment: Orb::Models::Subscription::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + ) -> void + | ( + ?Orb::Models::Subscription::adjustment_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::adjustment_interval + + type adjustment = + Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + | Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + | Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + | Orb::Models::Subscription::AdjustmentInterval::Adjustment::MinimumAdjustment + | Orb::Models::Subscription::AdjustmentInterval::Adjustment::MaximumAdjustment + + class Adjustment < Orb::Union + type amount_discount_adjustment = + { + id: String, + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String? + } + + class AmountDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::Subscription::AdjustmentInterval::Adjustment::amount_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::AdjustmentInterval::Adjustment::amount_discount_adjustment + end + + type percentage_discount_adjustment = + { + id: String, + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String? + } + + class PercentageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor percentage_discount: Float + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::Subscription::AdjustmentInterval::Adjustment::percentage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::AdjustmentInterval::Adjustment::percentage_discount_adjustment + end + + type usage_discount_adjustment = + { + id: String, + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float + } + + class UsageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + attr_accessor usage_discount: Float + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::Subscription::AdjustmentInterval::Adjustment::usage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::AdjustmentInterval::Adjustment::usage_discount_adjustment + end + + type minimum_adjustment = + { + id: String, + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MinimumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::Subscription::AdjustmentInterval::Adjustment::minimum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::AdjustmentInterval::Adjustment::minimum_adjustment + end + + type maximum_adjustment = + { + id: String, + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MaximumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor maximum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::Subscription::AdjustmentInterval::Adjustment::maximum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::AdjustmentInterval::Adjustment::maximum_adjustment + end + + private def self.variants: -> [[:amount_discount, Orb::Models::Subscription::AdjustmentInterval::Adjustment::AmountDiscountAdjustment], [:percentage_discount, Orb::Models::Subscription::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment], [:usage_discount, Orb::Models::Subscription::AdjustmentInterval::Adjustment::UsageDiscountAdjustment], [:minimum, Orb::Models::Subscription::AdjustmentInterval::Adjustment::MinimumAdjustment], [:maximum, Orb::Models::Subscription::AdjustmentInterval::Adjustment::MaximumAdjustment]] + end + end + + type billing_cycle_anchor_configuration = + { day: Integer, month: Integer?, year: Integer? } + + class BillingCycleAnchorConfiguration < Orb::BaseModel + attr_accessor day: Integer + + attr_accessor month: Integer? + + attr_accessor year: Integer? + + def initialize: + (day: Integer, month: Integer?, year: Integer?) -> void + | ( + ?Orb::Models::Subscription::billing_cycle_anchor_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::billing_cycle_anchor_configuration + end + + type discount_interval = + Orb::Models::Subscription::DiscountInterval::AmountDiscountInterval + | Orb::Models::Subscription::DiscountInterval::PercentageDiscountInterval + | Orb::Models::Subscription::DiscountInterval::UsageDiscountInterval + + class DiscountInterval < Orb::Union + type amount_discount_interval = + { + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :amount, + end_date: Time?, + start_date: Time + } + + class AmountDiscountInterval < Orb::BaseModel + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :amount + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + discount_type: :amount + ) -> void + | ( + ?Orb::Models::Subscription::DiscountInterval::amount_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::DiscountInterval::amount_discount_interval + end + + type percentage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :percentage, + end_date: Time?, + percentage_discount: Float, + start_date: Time + } + + class PercentageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :percentage + + attr_accessor end_date: Time? + + attr_accessor percentage_discount: Float + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + percentage_discount: Float, + start_date: Time, + discount_type: :percentage + ) -> void + | ( + ?Orb::Models::Subscription::DiscountInterval::percentage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::DiscountInterval::percentage_discount_interval + end + + type usage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :usage, + end_date: Time?, + start_date: Time, + usage_discount: Float + } + + class UsageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :usage + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + attr_accessor usage_discount: Float + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + usage_discount: Float, + discount_type: :usage + ) -> void + | ( + ?Orb::Models::Subscription::DiscountInterval::usage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::DiscountInterval::usage_discount_interval + end + + private def self.variants: -> [[:amount, Orb::Models::Subscription::DiscountInterval::AmountDiscountInterval], [:percentage, Orb::Models::Subscription::DiscountInterval::PercentageDiscountInterval], [:usage, Orb::Models::Subscription::DiscountInterval::UsageDiscountInterval]] + end + + type fixed_fee_quantity_schedule = + { end_date: Time?, price_id: String, quantity: Float, start_date: Time } + + class FixedFeeQuantitySchedule < Orb::BaseModel + attr_accessor end_date: Time? + + attr_accessor price_id: String + + attr_accessor quantity: Float + + attr_accessor start_date: Time + + def initialize: + ( + end_date: Time?, + price_id: String, + quantity: Float, + start_date: Time + ) -> void + | ( + ?Orb::Models::Subscription::fixed_fee_quantity_schedule + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::fixed_fee_quantity_schedule + end + + type maximum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + } + + class MaximumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor maximum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::Subscription::maximum_interval | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::maximum_interval + end + + type minimum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + } + + class MinimumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor minimum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::Subscription::minimum_interval | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::minimum_interval + end + + type price_interval = + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::Subscription::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + } + + class PriceInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor billing_cycle_day: Integer + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_transitions: Array[Orb::Models::Subscription::PriceInterval::FixedFeeQuantityTransition]? + + attr_accessor price: Orb::Models::price + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::Subscription::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + ) -> void + | ( + ?Orb::Models::Subscription::price_interval | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::price_interval + + type fixed_fee_quantity_transition = + { effective_date: Time, price_id: String, quantity: Integer } + + class FixedFeeQuantityTransition < Orb::BaseModel + attr_accessor effective_date: Time + + attr_accessor price_id: String + + attr_accessor quantity: Integer + + def initialize: + (effective_date: Time, price_id: String, quantity: Integer) -> void + | ( + ?Orb::Models::Subscription::PriceInterval::fixed_fee_quantity_transition + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::PriceInterval::fixed_fee_quantity_transition + end + end + + type redeemed_coupon = + { coupon_id: String, end_date: Time?, start_date: Time } + + class RedeemedCoupon < Orb::BaseModel + attr_accessor coupon_id: String + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + (coupon_id: String, end_date: Time?, start_date: Time) -> void + | ( + ?Orb::Models::Subscription::redeemed_coupon | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::redeemed_coupon + end + + type status = :active | :ended | :upcoming + + class Status < Orb::Enum + ACTIVE: :active + ENDED: :ended + UPCOMING: :upcoming + + def self.values: -> Array[Orb::Models::Subscription::status] + end + + type trial_info = { end_date: Time? } + + class TrialInfo < Orb::BaseModel + attr_accessor end_date: Time? + + def initialize: + (end_date: Time?) -> void + | ( + ?Orb::Models::Subscription::trial_info | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::Subscription::trial_info + end + end + end +end diff --git a/sig/orb/models/subscription_cancel_params.rbs b/sig/orb/models/subscription_cancel_params.rbs new file mode 100644 index 00000000..56b5a7f8 --- /dev/null +++ b/sig/orb/models/subscription_cancel_params.rbs @@ -0,0 +1,42 @@ +module Orb + module Models + type subscription_cancel_params = + { + cancel_option: Orb::Models::SubscriptionCancelParams::cancel_option, + cancellation_date: Time? + } + & Orb::request_parameters + + class SubscriptionCancelParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor cancel_option: Orb::Models::SubscriptionCancelParams::cancel_option + + attr_accessor cancellation_date: Time? + + def initialize: + ( + cancel_option: Orb::Models::SubscriptionCancelParams::cancel_option, + cancellation_date: Time?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::subscription_cancel_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_cancel_params + + type cancel_option = + :end_of_subscription_term | :immediate | :requested_date + + class CancelOption < Orb::Enum + END_OF_SUBSCRIPTION_TERM: :end_of_subscription_term + IMMEDIATE: :immediate + REQUESTED_DATE: :requested_date + + def self.values: -> Array[Orb::Models::SubscriptionCancelParams::cancel_option] + end + end + end +end diff --git a/sig/orb/models/subscription_cancel_response.rbs b/sig/orb/models/subscription_cancel_response.rbs new file mode 100644 index 00000000..42fbd964 --- /dev/null +++ b/sig/orb/models/subscription_cancel_response.rbs @@ -0,0 +1,750 @@ +module Orb + module Models + type subscription_cancel_response = + { + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionCancelResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionCancelResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionCancelResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionCancelResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionCancelResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionCancelResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionCancelResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionCancelResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionCancelResponse::status, + trial_info: Orb::Models::SubscriptionCancelResponse::TrialInfo + } + + class SubscriptionCancelResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor active_plan_phase_order: Integer? + + attr_accessor adjustment_intervals: Array[Orb::Models::SubscriptionCancelResponse::AdjustmentInterval] + + attr_accessor auto_collection: bool? + + attr_accessor billing_cycle_anchor_configuration: Orb::Models::SubscriptionCancelResponse::BillingCycleAnchorConfiguration + + attr_accessor billing_cycle_day: Integer + + attr_accessor created_at: Time + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor customer: Orb::Models::Customer + + attr_accessor default_invoice_memo: String? + + attr_accessor discount_intervals: Array[Orb::Models::SubscriptionCancelResponse::discount_interval] + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionCancelResponse::FixedFeeQuantitySchedule] + + attr_accessor invoicing_threshold: String? + + attr_accessor maximum_intervals: Array[Orb::Models::SubscriptionCancelResponse::MaximumInterval] + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum_intervals: Array[Orb::Models::SubscriptionCancelResponse::MinimumInterval] + + attr_accessor net_terms: Integer + + attr_accessor plan: Orb::Models::Plan + + attr_accessor price_intervals: Array[Orb::Models::SubscriptionCancelResponse::PriceInterval] + + attr_accessor redeemed_coupon: Orb::Models::SubscriptionCancelResponse::RedeemedCoupon? + + attr_accessor start_date: Time + + attr_accessor status: Orb::Models::SubscriptionCancelResponse::status + + attr_accessor trial_info: Orb::Models::SubscriptionCancelResponse::TrialInfo + + def initialize: + ( + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionCancelResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionCancelResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionCancelResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionCancelResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionCancelResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionCancelResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionCancelResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionCancelResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionCancelResponse::status, + trial_info: Orb::Models::SubscriptionCancelResponse::TrialInfo + ) -> void + | ( + ?Orb::Models::subscription_cancel_response | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_cancel_response + + type adjustment_interval = + { + id: String, + adjustment: Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + } + + class AdjustmentInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment: Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::adjustment + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + adjustment: Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::adjustment_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::adjustment_interval + + type adjustment = + Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + | Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + | Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + | Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + | Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + + class Adjustment < Orb::Union + type amount_discount_adjustment = + { + id: String, + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String? + } + + class AmountDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + end + + type percentage_discount_adjustment = + { + id: String, + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String? + } + + class PercentageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor percentage_discount: Float + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + end + + type usage_discount_adjustment = + { + id: String, + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float + } + + class UsageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + attr_accessor usage_discount: Float + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + end + + type minimum_adjustment = + { + id: String, + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MinimumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::minimum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::minimum_adjustment + end + + type maximum_adjustment = + { + id: String, + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MaximumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor maximum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::maximum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::maximum_adjustment + end + + private def self.variants: -> [[:amount_discount, Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment], [:percentage_discount, Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment], [:usage_discount, Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment], [:minimum, Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MinimumAdjustment], [:maximum, Orb::Models::SubscriptionCancelResponse::AdjustmentInterval::Adjustment::MaximumAdjustment]] + end + end + + type billing_cycle_anchor_configuration = + { day: Integer, month: Integer?, year: Integer? } + + class BillingCycleAnchorConfiguration < Orb::BaseModel + attr_accessor day: Integer + + attr_accessor month: Integer? + + attr_accessor year: Integer? + + def initialize: + (day: Integer, month: Integer?, year: Integer?) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::billing_cycle_anchor_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::billing_cycle_anchor_configuration + end + + type discount_interval = + Orb::Models::SubscriptionCancelResponse::DiscountInterval::AmountDiscountInterval + | Orb::Models::SubscriptionCancelResponse::DiscountInterval::PercentageDiscountInterval + | Orb::Models::SubscriptionCancelResponse::DiscountInterval::UsageDiscountInterval + + class DiscountInterval < Orb::Union + type amount_discount_interval = + { + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :amount, + end_date: Time?, + start_date: Time + } + + class AmountDiscountInterval < Orb::BaseModel + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :amount + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + discount_type: :amount + ) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::DiscountInterval::amount_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::DiscountInterval::amount_discount_interval + end + + type percentage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :percentage, + end_date: Time?, + percentage_discount: Float, + start_date: Time + } + + class PercentageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :percentage + + attr_accessor end_date: Time? + + attr_accessor percentage_discount: Float + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + percentage_discount: Float, + start_date: Time, + discount_type: :percentage + ) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::DiscountInterval::percentage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::DiscountInterval::percentage_discount_interval + end + + type usage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :usage, + end_date: Time?, + start_date: Time, + usage_discount: Float + } + + class UsageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :usage + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + attr_accessor usage_discount: Float + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + usage_discount: Float, + discount_type: :usage + ) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::DiscountInterval::usage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::DiscountInterval::usage_discount_interval + end + + private def self.variants: -> [[:amount, Orb::Models::SubscriptionCancelResponse::DiscountInterval::AmountDiscountInterval], [:percentage, Orb::Models::SubscriptionCancelResponse::DiscountInterval::PercentageDiscountInterval], [:usage, Orb::Models::SubscriptionCancelResponse::DiscountInterval::UsageDiscountInterval]] + end + + type fixed_fee_quantity_schedule = + { end_date: Time?, price_id: String, quantity: Float, start_date: Time } + + class FixedFeeQuantitySchedule < Orb::BaseModel + attr_accessor end_date: Time? + + attr_accessor price_id: String + + attr_accessor quantity: Float + + attr_accessor start_date: Time + + def initialize: + ( + end_date: Time?, + price_id: String, + quantity: Float, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::fixed_fee_quantity_schedule + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::fixed_fee_quantity_schedule + end + + type maximum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + } + + class MaximumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor maximum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::maximum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::maximum_interval + end + + type minimum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + } + + class MinimumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor minimum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::minimum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::minimum_interval + end + + type price_interval = + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionCancelResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + } + + class PriceInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor billing_cycle_day: Integer + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionCancelResponse::PriceInterval::FixedFeeQuantityTransition]? + + attr_accessor price: Orb::Models::price + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionCancelResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::price_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::price_interval + + type fixed_fee_quantity_transition = + { effective_date: Time, price_id: String, quantity: Integer } + + class FixedFeeQuantityTransition < Orb::BaseModel + attr_accessor effective_date: Time + + attr_accessor price_id: String + + attr_accessor quantity: Integer + + def initialize: + (effective_date: Time, price_id: String, quantity: Integer) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::PriceInterval::fixed_fee_quantity_transition + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::PriceInterval::fixed_fee_quantity_transition + end + end + + type redeemed_coupon = + { coupon_id: String, end_date: Time?, start_date: Time } + + class RedeemedCoupon < Orb::BaseModel + attr_accessor coupon_id: String + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + (coupon_id: String, end_date: Time?, start_date: Time) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::redeemed_coupon + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::redeemed_coupon + end + + type status = :active | :ended | :upcoming + + class Status < Orb::Enum + ACTIVE: :active + ENDED: :ended + UPCOMING: :upcoming + + def self.values: -> Array[Orb::Models::SubscriptionCancelResponse::status] + end + + type trial_info = { end_date: Time? } + + class TrialInfo < Orb::BaseModel + attr_accessor end_date: Time? + + def initialize: + (end_date: Time?) -> void + | ( + ?Orb::Models::SubscriptionCancelResponse::trial_info + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCancelResponse::trial_info + end + end + end +end diff --git a/sig/orb/models/subscription_create_params.rbs b/sig/orb/models/subscription_create_params.rbs new file mode 100644 index 00000000..f031ad9b --- /dev/null +++ b/sig/orb/models/subscription_create_params.rbs @@ -0,0 +1,7365 @@ +module Orb + module Models + type subscription_create_params = + { + add_adjustments: Array[Orb::Models::SubscriptionCreateParams::AddAdjustment]?, + add_prices: Array[Orb::Models::SubscriptionCreateParams::AddPrice]?, + align_billing_with_subscription_start_date: bool, + auto_collection: bool?, + aws_region: String?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionCreateParams::BillingCycleAnchorConfiguration?, + coupon_redemption_code: String?, + credits_overage_rate: Float?, + customer_id: String?, + default_invoice_memo: String?, + end_date: Time?, + external_customer_id: String?, + external_marketplace: Orb::Models::SubscriptionCreateParams::external_marketplace?, + external_marketplace_reporting_id: String?, + external_plan_id: String?, + filter: String?, + initial_phase_order: Integer?, + invoicing_threshold: String?, + metadata: Hash[Symbol, String?]?, + net_terms: Integer?, + per_credit_overage_amount: Float?, + plan_id: String?, + plan_version_number: Integer?, + price_overrides: Array[top]?, + remove_adjustments: Array[Orb::Models::SubscriptionCreateParams::RemoveAdjustment]?, + remove_prices: Array[Orb::Models::SubscriptionCreateParams::RemovePrice]?, + replace_adjustments: Array[Orb::Models::SubscriptionCreateParams::ReplaceAdjustment]?, + replace_prices: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice]?, + start_date: Time?, + trial_duration_days: Integer? + } + & Orb::request_parameters + + class SubscriptionCreateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor add_adjustments: Array[Orb::Models::SubscriptionCreateParams::AddAdjustment]? + + attr_accessor add_prices: Array[Orb::Models::SubscriptionCreateParams::AddPrice]? + + attr_reader align_billing_with_subscription_start_date: bool? + + def align_billing_with_subscription_start_date=: (bool) -> void + + attr_accessor auto_collection: bool? + + attr_accessor aws_region: String? + + attr_accessor billing_cycle_anchor_configuration: Orb::Models::SubscriptionCreateParams::BillingCycleAnchorConfiguration? + + attr_accessor coupon_redemption_code: String? + + attr_accessor credits_overage_rate: Float? + + attr_accessor customer_id: String? + + attr_accessor default_invoice_memo: String? + + attr_accessor end_date: Time? + + attr_accessor external_customer_id: String? + + attr_accessor external_marketplace: Orb::Models::SubscriptionCreateParams::external_marketplace? + + attr_accessor external_marketplace_reporting_id: String? + + attr_accessor external_plan_id: String? + + attr_accessor filter: String? + + attr_accessor initial_phase_order: Integer? + + attr_accessor invoicing_threshold: String? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor net_terms: Integer? + + attr_accessor per_credit_overage_amount: Float? + + attr_accessor plan_id: String? + + attr_accessor plan_version_number: Integer? + + attr_accessor price_overrides: Array[top]? + + attr_accessor remove_adjustments: Array[Orb::Models::SubscriptionCreateParams::RemoveAdjustment]? + + attr_accessor remove_prices: Array[Orb::Models::SubscriptionCreateParams::RemovePrice]? + + attr_accessor replace_adjustments: Array[Orb::Models::SubscriptionCreateParams::ReplaceAdjustment]? + + attr_accessor replace_prices: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice]? + + attr_accessor start_date: Time? + + attr_accessor trial_duration_days: Integer? + + def initialize: + ( + add_adjustments: Array[Orb::Models::SubscriptionCreateParams::AddAdjustment]?, + add_prices: Array[Orb::Models::SubscriptionCreateParams::AddPrice]?, + align_billing_with_subscription_start_date: bool, + auto_collection: bool?, + aws_region: String?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionCreateParams::BillingCycleAnchorConfiguration?, + coupon_redemption_code: String?, + credits_overage_rate: Float?, + customer_id: String?, + default_invoice_memo: String?, + end_date: Time?, + external_customer_id: String?, + external_marketplace: Orb::Models::SubscriptionCreateParams::external_marketplace?, + external_marketplace_reporting_id: String?, + external_plan_id: String?, + filter: String?, + initial_phase_order: Integer?, + invoicing_threshold: String?, + metadata: Hash[Symbol, String?]?, + net_terms: Integer?, + per_credit_overage_amount: Float?, + plan_id: String?, + plan_version_number: Integer?, + price_overrides: Array[top]?, + remove_adjustments: Array[Orb::Models::SubscriptionCreateParams::RemoveAdjustment]?, + remove_prices: Array[Orb::Models::SubscriptionCreateParams::RemovePrice]?, + replace_adjustments: Array[Orb::Models::SubscriptionCreateParams::ReplaceAdjustment]?, + replace_prices: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice]?, + start_date: Time?, + trial_duration_days: Integer?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::subscription_create_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_create_params + + type add_adjustment = + { + adjustment: Orb::Models::SubscriptionCreateParams::AddAdjustment::adjustment, + end_date: Time?, + plan_phase_order: Integer?, + start_date: Time? + } + + class AddAdjustment < Orb::BaseModel + attr_accessor adjustment: Orb::Models::SubscriptionCreateParams::AddAdjustment::adjustment + + attr_accessor end_date: Time? + + attr_accessor plan_phase_order: Integer? + + attr_accessor start_date: Time? + + def initialize: + ( + adjustment: Orb::Models::SubscriptionCreateParams::AddAdjustment::adjustment, + end_date: Time?, + plan_phase_order: Integer?, + start_date: Time? + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::add_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::add_adjustment + + type adjustment = + Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewPercentageDiscount + | Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewUsageDiscount + | Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewAmountDiscount + | Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMinimum + | Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMaximum + + class Adjustment < Orb::Union + type new_percentage_discount = + { + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + percentage_discount: Float, + is_invoice_level: bool + } + + class NewPercentageDiscount < Orb::BaseModel + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor percentage_discount: Float + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + percentage_discount: Float, + is_invoice_level: bool, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::new_percentage_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::new_percentage_discount + end + + type new_usage_discount = + { + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + usage_discount: Float, + is_invoice_level: bool + } + + class NewUsageDiscount < Orb::BaseModel + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor usage_discount: Float + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + usage_discount: Float, + is_invoice_level: bool, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::new_usage_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::new_usage_discount + end + + type new_amount_discount = + { + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool + } + + class NewAmountDiscount < Orb::BaseModel + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::new_amount_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::new_amount_discount + end + + type new_minimum = + { + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: bool + } + + class NewMinimum < Orb::BaseModel + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: bool, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::new_minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::new_minimum + end + + type new_maximum = + { + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + maximum_amount: String, + is_invoice_level: bool + } + + class NewMaximum < Orb::BaseModel + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String, + is_invoice_level: bool, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::new_maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::new_maximum + end + + private def self.variants: -> [[:percentage_discount, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewPercentageDiscount], [:usage_discount, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewUsageDiscount], [:amount_discount, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewAmountDiscount], [:minimum, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMinimum], [:maximum, Orb::Models::SubscriptionCreateParams::AddAdjustment::Adjustment::NewMaximum]] + end + end + + type add_price = + { + discounts: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Discount]?, + end_date: Time?, + external_price_id: String?, + maximum_amount: String?, + minimum_amount: String?, + plan_phase_order: Integer?, + price: Orb::Models::SubscriptionCreateParams::AddPrice::price?, + price_id: String?, + start_date: Time? + } + + class AddPrice < Orb::BaseModel + attr_accessor discounts: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Discount]? + + attr_accessor end_date: Time? + + attr_accessor external_price_id: String? + + attr_accessor maximum_amount: String? + + attr_accessor minimum_amount: String? + + attr_accessor plan_phase_order: Integer? + + attr_accessor price: Orb::Models::SubscriptionCreateParams::AddPrice::price? + + attr_accessor price_id: String? + + attr_accessor start_date: Time? + + def initialize: + ( + discounts: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Discount]?, + end_date: Time?, + external_price_id: String?, + maximum_amount: String?, + minimum_amount: String?, + plan_phase_order: Integer?, + price: Orb::Models::SubscriptionCreateParams::AddPrice::price?, + price_id: String?, + start_date: Time? + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::add_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::add_price + + type discount = + { + discount_type: Orb::Models::SubscriptionCreateParams::AddPrice::Discount::discount_type, + amount_discount: String?, + percentage_discount: Float?, + usage_discount: Float? + } + + class Discount < Orb::BaseModel + attr_accessor discount_type: Orb::Models::SubscriptionCreateParams::AddPrice::Discount::discount_type + + attr_accessor amount_discount: String? + + attr_accessor percentage_discount: Float? + + attr_accessor usage_discount: Float? + + def initialize: + ( + discount_type: Orb::Models::SubscriptionCreateParams::AddPrice::Discount::discount_type, + amount_discount: String?, + percentage_discount: Float?, + usage_discount: Float? + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::discount + + type discount_type = :percentage | :usage | :amount + + class DiscountType < Orb::Enum + PERCENTAGE: :percentage + USAGE: :usage + AMOUNT: :amount + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Discount::discount_type] + end + end + + type price = + Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice + | Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice + + class Price < Orb::Union + type new_subscription_unit_price = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::cadence, + item_id: String, + model_type: :unit, + name: String, + unit_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionUnitPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :unit + + attr_accessor name: String + + attr_accessor unit_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::cadence, + item_id: String, + name: String, + unit_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_unit_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_unit_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::cadence] + end + + type unit_config = { unit_amount: String } + + class UnitConfig < Orb::BaseModel + attr_accessor unit_amount: String + + def initialize: + (unit_amount: String) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::unit_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::unit_config + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_package_price = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::cadence, + item_id: String, + model_type: :package, + name: String, + package_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionPackagePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :package + + attr_accessor name: String + + attr_accessor package_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::cadence, + item_id: String, + name: String, + package_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :package + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_package_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::cadence] + end + + type package_config = + { package_amount: String, package_size: Integer } + + class PackageConfig < Orb::BaseModel + attr_accessor package_amount: String + + attr_accessor package_size: Integer + + def initialize: + (package_amount: String, package_size: Integer) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::package_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::package_config + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_matrix_price = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::cadence, + item_id: String, + matrix_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + model_type: :matrix, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionMatrixPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::cadence + + attr_accessor item_id: String + + attr_accessor matrix_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig + + attr_accessor model_type: :matrix + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::cadence, + item_id: String, + matrix_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :matrix + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_matrix_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_matrix_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::cadence] + end + + type matrix_config = + { + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + } + + class MatrixConfig < Orb::BaseModel + attr_accessor default_unit_amount: String + + attr_accessor dimensions: Array[String?] + + attr_accessor matrix_values: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + + def initialize: + ( + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::matrix_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::matrix_config + + type matrix_value = + { dimension_values: Array[String?], unit_amount: String } + + class MatrixValue < Orb::BaseModel + attr_accessor dimension_values: Array[String?] + + attr_accessor unit_amount: String + + def initialize: + ( + dimension_values: Array[String?], + unit_amount: String + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::matrix_value + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::matrix_value + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tiered_price = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::cadence, + item_id: String, + model_type: :tiered, + name: String, + tiered_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTieredPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered + + attr_accessor name: String + + attr_accessor tiered_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::cadence, + item_id: String, + name: String, + tiered_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_tiered_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_tiered_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::cadence] + end + + type tiered_config = + { + tiers: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + } + + class TieredConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::tiered_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::tiered_config + + type tier = + { first_unit: Float, unit_amount: String, last_unit: Float? } + + class Tier < Orb::BaseModel + attr_accessor first_unit: Float + + attr_accessor unit_amount: String + + attr_accessor last_unit: Float? + + def initialize: + ( + first_unit: Float, + unit_amount: String, + last_unit: Float? + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::tier + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tiered_bps_price = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::cadence, + item_id: String, + model_type: :tiered_bps, + name: String, + tiered_bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTieredBpsPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_bps + + attr_accessor name: String + + attr_accessor tiered_bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::cadence, + item_id: String, + name: String, + tiered_bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered_bps + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_tiered_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_tiered_bps_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::cadence] + end + + type tiered_bps_config = + { + tiers: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + } + + class TieredBpsConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::tiered_bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::tiered_bps_config + + type tier = + { + bps: Float, + minimum_amount: String, + maximum_amount: String?, + per_unit_maximum: String? + } + + class Tier < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor minimum_amount: String + + attr_accessor maximum_amount: String? + + attr_accessor per_unit_maximum: String? + + def initialize: + ( + bps: Float, + minimum_amount: String, + maximum_amount: String?, + per_unit_maximum: String? + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::tier + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_bps_price = + { + bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig, + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::cadence, + item_id: String, + model_type: :bps, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionBpsPrice < Orb::BaseModel + attr_accessor bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig + + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bps + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig, + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :bps + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_bps_price + + type bps_config = { bps: Float, per_unit_maximum: String? } + + class BpsConfig < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor per_unit_maximum: String? + + def initialize: + (bps: Float, per_unit_maximum: String?) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::bps_config + end + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_bulk_bps_price = + { + bulk_bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::cadence, + item_id: String, + model_type: :bulk_bps, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionBulkBpsPrice < Orb::BaseModel + attr_accessor bulk_bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig + + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bulk_bps + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + bulk_bps_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :bulk_bps + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_bulk_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_bulk_bps_price + + type bulk_bps_config = + { + tiers: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + } + + class BulkBpsConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::bulk_bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::bulk_bps_config + + type tier = + { + bps: Float, + maximum_amount: String?, + per_unit_maximum: String? + } + + class Tier < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor maximum_amount: String? + + attr_accessor per_unit_maximum: String? + + def initialize: + ( + bps: Float, + maximum_amount: String?, + per_unit_maximum: String? + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::tier + end + end + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_bulk_price = + { + bulk_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig, + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::cadence, + item_id: String, + model_type: :bulk, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionBulkPrice < Orb::BaseModel + attr_accessor bulk_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig + + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bulk + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + bulk_config: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig, + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :bulk + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_bulk_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_bulk_price + + type bulk_config = + { + tiers: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + } + + class BulkConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::bulk_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::bulk_config + + type tier = { unit_amount: String, maximum_units: Float? } + + class Tier < Orb::BaseModel + attr_accessor unit_amount: String + + attr_accessor maximum_units: Float? + + def initialize: + (unit_amount: String, maximum_units: Float?) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::tier + end + end + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_threshold_total_amount_price = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::cadence, + item_id: String, + model_type: :threshold_total_amount, + name: String, + threshold_total_amount_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionThresholdTotalAmountPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :threshold_total_amount + + attr_accessor name: String + + attr_accessor threshold_total_amount_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::cadence, + item_id: String, + name: String, + threshold_total_amount_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :threshold_total_amount + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_threshold_total_amount_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_threshold_total_amount_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tiered_package_price = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::cadence, + item_id: String, + model_type: :tiered_package, + name: String, + tiered_package_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTieredPackagePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_package + + attr_accessor name: String + + attr_accessor tiered_package_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::cadence, + item_id: String, + name: String, + tiered_package_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered_package + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_tiered_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_tiered_package_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tiered_with_minimum_price = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::cadence, + item_id: String, + model_type: :tiered_with_minimum, + name: String, + tiered_with_minimum_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTieredWithMinimumPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_minimum + + attr_accessor name: String + + attr_accessor tiered_with_minimum_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::cadence, + item_id: String, + name: String, + tiered_with_minimum_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered_with_minimum + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_tiered_with_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_tiered_with_minimum_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_unit_with_percent_price = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::cadence, + item_id: String, + model_type: :unit_with_percent, + name: String, + unit_with_percent_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionUnitWithPercentPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :unit_with_percent + + attr_accessor name: String + + attr_accessor unit_with_percent_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::cadence, + item_id: String, + name: String, + unit_with_percent_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :unit_with_percent + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_unit_with_percent_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_unit_with_percent_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_package_with_allocation_price = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::cadence, + item_id: String, + model_type: :package_with_allocation, + name: String, + package_with_allocation_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionPackageWithAllocationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :package_with_allocation + + attr_accessor name: String + + attr_accessor package_with_allocation_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::cadence, + item_id: String, + name: String, + package_with_allocation_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :package_with_allocation + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_package_with_allocation_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_package_with_allocation_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tier_with_proration_price = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTierWithProrationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_proration + + attr_accessor name: String + + attr_accessor tiered_with_proration_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::cadence, + item_id: String, + name: String, + tiered_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered_with_proration + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_tier_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_tier_with_proration_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_unit_with_proration_price = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::cadence, + item_id: String, + model_type: :unit_with_proration, + name: String, + unit_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionUnitWithProrationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :unit_with_proration + + attr_accessor name: String + + attr_accessor unit_with_proration_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::cadence, + item_id: String, + name: String, + unit_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :unit_with_proration + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_unit_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_unit_with_proration_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_grouped_allocation_price = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::cadence, + grouped_allocation_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_allocation, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionGroupedAllocationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::cadence + + attr_accessor grouped_allocation_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_allocation + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::cadence, + grouped_allocation_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :grouped_allocation + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_grouped_allocation_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_grouped_allocation_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_grouped_with_prorated_minimum_price = + { + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::cadence, + grouped_with_prorated_minimum_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_with_prorated_minimum, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionGroupedWithProratedMinimumPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::cadence + + attr_accessor grouped_with_prorated_minimum_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_prorated_minimum + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::cadence, + grouped_with_prorated_minimum_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :grouped_with_prorated_minimum + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_grouped_with_prorated_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_grouped_with_prorated_minimum_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_bulk_with_proration_price = + { + bulk_with_proration_config: Hash[Symbol, top], + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::cadence, + item_id: String, + model_type: :bulk_with_proration, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionBulkWithProrationPrice < Orb::BaseModel + attr_accessor bulk_with_proration_config: Hash[Symbol, top] + + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bulk_with_proration + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + bulk_with_proration_config: Hash[Symbol, top], + cadence: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :bulk_with_proration + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_bulk_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::new_subscription_bulk_with_proration_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + private def self.variants: -> [[:unit, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitPrice], [:package, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackagePrice], [:matrix, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionMatrixPrice], [:tiered, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPrice], [:tiered_bps, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredBpsPrice], [:bps, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBpsPrice], [:bulk_bps, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkBpsPrice], [:bulk, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkPrice], [:threshold_total_amount, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice], [:tiered_package, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredPackagePrice], [:tiered_with_minimum, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice], [:unit_with_percent, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice], [:package_with_allocation, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice], [:tiered_with_proration, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice], [:unit_with_proration, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice], [:grouped_allocation, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice], [:grouped_with_prorated_minimum, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice], [:bulk_with_proration, Orb::Models::SubscriptionCreateParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice]] + end + end + + type billing_cycle_anchor_configuration = + { day: Integer, month: Integer?, year: Integer? } + + class BillingCycleAnchorConfiguration < Orb::BaseModel + attr_accessor day: Integer + + attr_accessor month: Integer? + + attr_accessor year: Integer? + + def initialize: + (day: Integer, month: Integer?, year: Integer?) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::billing_cycle_anchor_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::billing_cycle_anchor_configuration + end + + type external_marketplace = :google | :aws | :azure + + class ExternalMarketplace < Orb::Enum + GOOGLE: :google + AWS: :aws + AZURE: :azure + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::external_marketplace] + end + + type remove_adjustment = { adjustment_id: String } + + class RemoveAdjustment < Orb::BaseModel + attr_accessor adjustment_id: String + + def initialize: + (adjustment_id: String) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::remove_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::remove_adjustment + end + + type remove_price = { external_price_id: String?, price_id: String? } + + class RemovePrice < Orb::BaseModel + attr_accessor external_price_id: String? + + attr_accessor price_id: String? + + def initialize: + (external_price_id: String?, price_id: String?) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::remove_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::remove_price + end + + type replace_adjustment = + { + adjustment: Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::adjustment, + replaces_adjustment_id: String + } + + class ReplaceAdjustment < Orb::BaseModel + attr_accessor adjustment: Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::adjustment + + attr_accessor replaces_adjustment_id: String + + def initialize: + ( + adjustment: Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::adjustment, + replaces_adjustment_id: String + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::replace_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::replace_adjustment + + type adjustment = + Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount + | Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewUsageDiscount + | Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewAmountDiscount + | Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMinimum + | Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMaximum + + class Adjustment < Orb::Union + type new_percentage_discount = + { + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + percentage_discount: Float, + is_invoice_level: bool + } + + class NewPercentageDiscount < Orb::BaseModel + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor percentage_discount: Float + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + percentage_discount: Float, + is_invoice_level: bool, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::new_percentage_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::new_percentage_discount + end + + type new_usage_discount = + { + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + usage_discount: Float, + is_invoice_level: bool + } + + class NewUsageDiscount < Orb::BaseModel + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor usage_discount: Float + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + usage_discount: Float, + is_invoice_level: bool, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::new_usage_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::new_usage_discount + end + + type new_amount_discount = + { + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool + } + + class NewAmountDiscount < Orb::BaseModel + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::new_amount_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::new_amount_discount + end + + type new_minimum = + { + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: bool + } + + class NewMinimum < Orb::BaseModel + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: bool, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::new_minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::new_minimum + end + + type new_maximum = + { + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + maximum_amount: String, + is_invoice_level: bool + } + + class NewMaximum < Orb::BaseModel + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String, + is_invoice_level: bool, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::new_maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::new_maximum + end + + private def self.variants: -> [[:percentage_discount, Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount], [:usage_discount, Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewUsageDiscount], [:amount_discount, Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewAmountDiscount], [:minimum, Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMinimum], [:maximum, Orb::Models::SubscriptionCreateParams::ReplaceAdjustment::Adjustment::NewMaximum]] + end + end + + type replace_price = + { + replaces_price_id: String, + discounts: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount]?, + external_price_id: String?, + fixed_price_quantity: Float?, + maximum_amount: String?, + minimum_amount: String?, + price: Orb::Models::SubscriptionCreateParams::ReplacePrice::price?, + price_id: String? + } + + class ReplacePrice < Orb::BaseModel + attr_accessor replaces_price_id: String + + attr_accessor discounts: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount]? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor maximum_amount: String? + + attr_accessor minimum_amount: String? + + attr_accessor price: Orb::Models::SubscriptionCreateParams::ReplacePrice::price? + + attr_accessor price_id: String? + + def initialize: + ( + replaces_price_id: String, + discounts: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount]?, + external_price_id: String?, + fixed_price_quantity: Float?, + maximum_amount: String?, + minimum_amount: String?, + price: Orb::Models::SubscriptionCreateParams::ReplacePrice::price?, + price_id: String? + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::replace_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::replace_price + + type discount = + { + discount_type: Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount::discount_type, + amount_discount: String?, + percentage_discount: Float?, + usage_discount: Float? + } + + class Discount < Orb::BaseModel + attr_accessor discount_type: Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount::discount_type + + attr_accessor amount_discount: String? + + attr_accessor percentage_discount: Float? + + attr_accessor usage_discount: Float? + + def initialize: + ( + discount_type: Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount::discount_type, + amount_discount: String?, + percentage_discount: Float?, + usage_discount: Float? + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::discount + + type discount_type = :percentage | :usage | :amount + + class DiscountType < Orb::Enum + PERCENTAGE: :percentage + USAGE: :usage + AMOUNT: :amount + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Discount::discount_type] + end + end + + type price = + Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice + | Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice + + class Price < Orb::Union + type new_subscription_unit_price = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::cadence, + item_id: String, + model_type: :unit, + name: String, + unit_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionUnitPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :unit + + attr_accessor name: String + + attr_accessor unit_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::cadence, + item_id: String, + name: String, + unit_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_unit_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_unit_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::cadence] + end + + type unit_config = { unit_amount: String } + + class UnitConfig < Orb::BaseModel + attr_accessor unit_amount: String + + def initialize: + (unit_amount: String) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::unit_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::unit_config + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_package_price = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::cadence, + item_id: String, + model_type: :package, + name: String, + package_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionPackagePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :package + + attr_accessor name: String + + attr_accessor package_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::cadence, + item_id: String, + name: String, + package_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :package + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_package_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::cadence] + end + + type package_config = + { package_amount: String, package_size: Integer } + + class PackageConfig < Orb::BaseModel + attr_accessor package_amount: String + + attr_accessor package_size: Integer + + def initialize: + (package_amount: String, package_size: Integer) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::package_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::package_config + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_matrix_price = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::cadence, + item_id: String, + matrix_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + model_type: :matrix, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionMatrixPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::cadence + + attr_accessor item_id: String + + attr_accessor matrix_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig + + attr_accessor model_type: :matrix + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::cadence, + item_id: String, + matrix_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :matrix + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_matrix_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_matrix_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::cadence] + end + + type matrix_config = + { + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + } + + class MatrixConfig < Orb::BaseModel + attr_accessor default_unit_amount: String + + attr_accessor dimensions: Array[String?] + + attr_accessor matrix_values: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + + def initialize: + ( + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::matrix_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::matrix_config + + type matrix_value = + { dimension_values: Array[String?], unit_amount: String } + + class MatrixValue < Orb::BaseModel + attr_accessor dimension_values: Array[String?] + + attr_accessor unit_amount: String + + def initialize: + ( + dimension_values: Array[String?], + unit_amount: String + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::matrix_value + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::matrix_value + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tiered_price = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::cadence, + item_id: String, + model_type: :tiered, + name: String, + tiered_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTieredPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered + + attr_accessor name: String + + attr_accessor tiered_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::cadence, + item_id: String, + name: String, + tiered_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_tiered_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_tiered_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::cadence] + end + + type tiered_config = + { + tiers: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + } + + class TieredConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::tiered_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::tiered_config + + type tier = + { first_unit: Float, unit_amount: String, last_unit: Float? } + + class Tier < Orb::BaseModel + attr_accessor first_unit: Float + + attr_accessor unit_amount: String + + attr_accessor last_unit: Float? + + def initialize: + ( + first_unit: Float, + unit_amount: String, + last_unit: Float? + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::tier + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tiered_bps_price = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::cadence, + item_id: String, + model_type: :tiered_bps, + name: String, + tiered_bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTieredBpsPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_bps + + attr_accessor name: String + + attr_accessor tiered_bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::cadence, + item_id: String, + name: String, + tiered_bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered_bps + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_tiered_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_tiered_bps_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::cadence] + end + + type tiered_bps_config = + { + tiers: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + } + + class TieredBpsConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::tiered_bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::tiered_bps_config + + type tier = + { + bps: Float, + minimum_amount: String, + maximum_amount: String?, + per_unit_maximum: String? + } + + class Tier < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor minimum_amount: String + + attr_accessor maximum_amount: String? + + attr_accessor per_unit_maximum: String? + + def initialize: + ( + bps: Float, + minimum_amount: String, + maximum_amount: String?, + per_unit_maximum: String? + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::tier + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_bps_price = + { + bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig, + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::cadence, + item_id: String, + model_type: :bps, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionBpsPrice < Orb::BaseModel + attr_accessor bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig + + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bps + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig, + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :bps + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_bps_price + + type bps_config = { bps: Float, per_unit_maximum: String? } + + class BpsConfig < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor per_unit_maximum: String? + + def initialize: + (bps: Float, per_unit_maximum: String?) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::bps_config + end + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_bulk_bps_price = + { + bulk_bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::cadence, + item_id: String, + model_type: :bulk_bps, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionBulkBpsPrice < Orb::BaseModel + attr_accessor bulk_bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig + + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bulk_bps + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + bulk_bps_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :bulk_bps + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_bulk_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_bulk_bps_price + + type bulk_bps_config = + { + tiers: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + } + + class BulkBpsConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::bulk_bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::bulk_bps_config + + type tier = + { + bps: Float, + maximum_amount: String?, + per_unit_maximum: String? + } + + class Tier < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor maximum_amount: String? + + attr_accessor per_unit_maximum: String? + + def initialize: + ( + bps: Float, + maximum_amount: String?, + per_unit_maximum: String? + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::tier + end + end + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_bulk_price = + { + bulk_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig, + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::cadence, + item_id: String, + model_type: :bulk, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionBulkPrice < Orb::BaseModel + attr_accessor bulk_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig + + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bulk + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + bulk_config: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig, + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :bulk + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_bulk_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_bulk_price + + type bulk_config = + { + tiers: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + } + + class BulkConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::bulk_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::bulk_config + + type tier = { unit_amount: String, maximum_units: Float? } + + class Tier < Orb::BaseModel + attr_accessor unit_amount: String + + attr_accessor maximum_units: Float? + + def initialize: + (unit_amount: String, maximum_units: Float?) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::tier + end + end + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_threshold_total_amount_price = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::cadence, + item_id: String, + model_type: :threshold_total_amount, + name: String, + threshold_total_amount_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionThresholdTotalAmountPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :threshold_total_amount + + attr_accessor name: String + + attr_accessor threshold_total_amount_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::cadence, + item_id: String, + name: String, + threshold_total_amount_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :threshold_total_amount + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_threshold_total_amount_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_threshold_total_amount_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tiered_package_price = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::cadence, + item_id: String, + model_type: :tiered_package, + name: String, + tiered_package_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTieredPackagePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_package + + attr_accessor name: String + + attr_accessor tiered_package_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::cadence, + item_id: String, + name: String, + tiered_package_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered_package + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_tiered_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_tiered_package_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tiered_with_minimum_price = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::cadence, + item_id: String, + model_type: :tiered_with_minimum, + name: String, + tiered_with_minimum_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTieredWithMinimumPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_minimum + + attr_accessor name: String + + attr_accessor tiered_with_minimum_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::cadence, + item_id: String, + name: String, + tiered_with_minimum_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered_with_minimum + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_tiered_with_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_tiered_with_minimum_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_unit_with_percent_price = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::cadence, + item_id: String, + model_type: :unit_with_percent, + name: String, + unit_with_percent_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionUnitWithPercentPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :unit_with_percent + + attr_accessor name: String + + attr_accessor unit_with_percent_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::cadence, + item_id: String, + name: String, + unit_with_percent_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :unit_with_percent + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_unit_with_percent_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_unit_with_percent_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_package_with_allocation_price = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::cadence, + item_id: String, + model_type: :package_with_allocation, + name: String, + package_with_allocation_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionPackageWithAllocationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :package_with_allocation + + attr_accessor name: String + + attr_accessor package_with_allocation_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::cadence, + item_id: String, + name: String, + package_with_allocation_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :package_with_allocation + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_package_with_allocation_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_package_with_allocation_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tier_with_proration_price = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTierWithProrationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_proration + + attr_accessor name: String + + attr_accessor tiered_with_proration_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::cadence, + item_id: String, + name: String, + tiered_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered_with_proration + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_tier_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_tier_with_proration_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_unit_with_proration_price = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::cadence, + item_id: String, + model_type: :unit_with_proration, + name: String, + unit_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionUnitWithProrationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :unit_with_proration + + attr_accessor name: String + + attr_accessor unit_with_proration_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::cadence, + item_id: String, + name: String, + unit_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :unit_with_proration + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_unit_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_unit_with_proration_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_grouped_allocation_price = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::cadence, + grouped_allocation_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_allocation, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionGroupedAllocationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::cadence + + attr_accessor grouped_allocation_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_allocation + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::cadence, + grouped_allocation_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :grouped_allocation + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_grouped_allocation_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_grouped_allocation_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_grouped_with_prorated_minimum_price = + { + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::cadence, + grouped_with_prorated_minimum_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_with_prorated_minimum, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionGroupedWithProratedMinimumPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::cadence + + attr_accessor grouped_with_prorated_minimum_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_prorated_minimum + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::cadence, + grouped_with_prorated_minimum_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :grouped_with_prorated_minimum + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_grouped_with_prorated_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_grouped_with_prorated_minimum_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_bulk_with_proration_price = + { + bulk_with_proration_config: Hash[Symbol, top], + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::cadence, + item_id: String, + model_type: :bulk_with_proration, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionBulkWithProrationPrice < Orb::BaseModel + attr_accessor bulk_with_proration_config: Hash[Symbol, top] + + attr_accessor cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bulk_with_proration + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + bulk_with_proration_config: Hash[Symbol, top], + cadence: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :bulk_with_proration + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_bulk_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::new_subscription_bulk_with_proration_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + private def self.variants: -> [[:unit, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitPrice], [:package, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackagePrice], [:matrix, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionMatrixPrice], [:tiered, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPrice], [:tiered_bps, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice], [:bps, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBpsPrice], [:bulk_bps, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice], [:bulk, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkPrice], [:threshold_total_amount, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice], [:tiered_package, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice], [:tiered_with_minimum, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice], [:unit_with_percent, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice], [:package_with_allocation, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice], [:tiered_with_proration, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice], [:unit_with_proration, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice], [:grouped_allocation, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice], [:grouped_with_prorated_minimum, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice], [:bulk_with_proration, Orb::Models::SubscriptionCreateParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice]] + end + end + end + end +end diff --git a/sig/orb/models/subscription_create_response.rbs b/sig/orb/models/subscription_create_response.rbs new file mode 100644 index 00000000..aa4c8265 --- /dev/null +++ b/sig/orb/models/subscription_create_response.rbs @@ -0,0 +1,750 @@ +module Orb + module Models + type subscription_create_response = + { + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionCreateResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionCreateResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionCreateResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionCreateResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionCreateResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionCreateResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionCreateResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionCreateResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionCreateResponse::status, + trial_info: Orb::Models::SubscriptionCreateResponse::TrialInfo + } + + class SubscriptionCreateResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor active_plan_phase_order: Integer? + + attr_accessor adjustment_intervals: Array[Orb::Models::SubscriptionCreateResponse::AdjustmentInterval] + + attr_accessor auto_collection: bool? + + attr_accessor billing_cycle_anchor_configuration: Orb::Models::SubscriptionCreateResponse::BillingCycleAnchorConfiguration + + attr_accessor billing_cycle_day: Integer + + attr_accessor created_at: Time + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor customer: Orb::Models::Customer + + attr_accessor default_invoice_memo: String? + + attr_accessor discount_intervals: Array[Orb::Models::SubscriptionCreateResponse::discount_interval] + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionCreateResponse::FixedFeeQuantitySchedule] + + attr_accessor invoicing_threshold: String? + + attr_accessor maximum_intervals: Array[Orb::Models::SubscriptionCreateResponse::MaximumInterval] + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum_intervals: Array[Orb::Models::SubscriptionCreateResponse::MinimumInterval] + + attr_accessor net_terms: Integer + + attr_accessor plan: Orb::Models::Plan + + attr_accessor price_intervals: Array[Orb::Models::SubscriptionCreateResponse::PriceInterval] + + attr_accessor redeemed_coupon: Orb::Models::SubscriptionCreateResponse::RedeemedCoupon? + + attr_accessor start_date: Time + + attr_accessor status: Orb::Models::SubscriptionCreateResponse::status + + attr_accessor trial_info: Orb::Models::SubscriptionCreateResponse::TrialInfo + + def initialize: + ( + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionCreateResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionCreateResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionCreateResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionCreateResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionCreateResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionCreateResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionCreateResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionCreateResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionCreateResponse::status, + trial_info: Orb::Models::SubscriptionCreateResponse::TrialInfo + ) -> void + | ( + ?Orb::Models::subscription_create_response | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_create_response + + type adjustment_interval = + { + id: String, + adjustment: Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + } + + class AdjustmentInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment: Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::adjustment + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + adjustment: Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::adjustment_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::adjustment_interval + + type adjustment = + Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + | Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + | Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + | Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + | Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + + class Adjustment < Orb::Union + type amount_discount_adjustment = + { + id: String, + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String? + } + + class AmountDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + end + + type percentage_discount_adjustment = + { + id: String, + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String? + } + + class PercentageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor percentage_discount: Float + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + end + + type usage_discount_adjustment = + { + id: String, + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float + } + + class UsageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + attr_accessor usage_discount: Float + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + end + + type minimum_adjustment = + { + id: String, + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MinimumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::minimum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::minimum_adjustment + end + + type maximum_adjustment = + { + id: String, + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MaximumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor maximum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::maximum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::maximum_adjustment + end + + private def self.variants: -> [[:amount_discount, Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment], [:percentage_discount, Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment], [:usage_discount, Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment], [:minimum, Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MinimumAdjustment], [:maximum, Orb::Models::SubscriptionCreateResponse::AdjustmentInterval::Adjustment::MaximumAdjustment]] + end + end + + type billing_cycle_anchor_configuration = + { day: Integer, month: Integer?, year: Integer? } + + class BillingCycleAnchorConfiguration < Orb::BaseModel + attr_accessor day: Integer + + attr_accessor month: Integer? + + attr_accessor year: Integer? + + def initialize: + (day: Integer, month: Integer?, year: Integer?) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::billing_cycle_anchor_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::billing_cycle_anchor_configuration + end + + type discount_interval = + Orb::Models::SubscriptionCreateResponse::DiscountInterval::AmountDiscountInterval + | Orb::Models::SubscriptionCreateResponse::DiscountInterval::PercentageDiscountInterval + | Orb::Models::SubscriptionCreateResponse::DiscountInterval::UsageDiscountInterval + + class DiscountInterval < Orb::Union + type amount_discount_interval = + { + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :amount, + end_date: Time?, + start_date: Time + } + + class AmountDiscountInterval < Orb::BaseModel + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :amount + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + discount_type: :amount + ) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::DiscountInterval::amount_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::DiscountInterval::amount_discount_interval + end + + type percentage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :percentage, + end_date: Time?, + percentage_discount: Float, + start_date: Time + } + + class PercentageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :percentage + + attr_accessor end_date: Time? + + attr_accessor percentage_discount: Float + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + percentage_discount: Float, + start_date: Time, + discount_type: :percentage + ) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::DiscountInterval::percentage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::DiscountInterval::percentage_discount_interval + end + + type usage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :usage, + end_date: Time?, + start_date: Time, + usage_discount: Float + } + + class UsageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :usage + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + attr_accessor usage_discount: Float + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + usage_discount: Float, + discount_type: :usage + ) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::DiscountInterval::usage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::DiscountInterval::usage_discount_interval + end + + private def self.variants: -> [[:amount, Orb::Models::SubscriptionCreateResponse::DiscountInterval::AmountDiscountInterval], [:percentage, Orb::Models::SubscriptionCreateResponse::DiscountInterval::PercentageDiscountInterval], [:usage, Orb::Models::SubscriptionCreateResponse::DiscountInterval::UsageDiscountInterval]] + end + + type fixed_fee_quantity_schedule = + { end_date: Time?, price_id: String, quantity: Float, start_date: Time } + + class FixedFeeQuantitySchedule < Orb::BaseModel + attr_accessor end_date: Time? + + attr_accessor price_id: String + + attr_accessor quantity: Float + + attr_accessor start_date: Time + + def initialize: + ( + end_date: Time?, + price_id: String, + quantity: Float, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::fixed_fee_quantity_schedule + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::fixed_fee_quantity_schedule + end + + type maximum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + } + + class MaximumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor maximum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::maximum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::maximum_interval + end + + type minimum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + } + + class MinimumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor minimum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::minimum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::minimum_interval + end + + type price_interval = + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionCreateResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + } + + class PriceInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor billing_cycle_day: Integer + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionCreateResponse::PriceInterval::FixedFeeQuantityTransition]? + + attr_accessor price: Orb::Models::price + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionCreateResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::price_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::price_interval + + type fixed_fee_quantity_transition = + { effective_date: Time, price_id: String, quantity: Integer } + + class FixedFeeQuantityTransition < Orb::BaseModel + attr_accessor effective_date: Time + + attr_accessor price_id: String + + attr_accessor quantity: Integer + + def initialize: + (effective_date: Time, price_id: String, quantity: Integer) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::PriceInterval::fixed_fee_quantity_transition + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::PriceInterval::fixed_fee_quantity_transition + end + end + + type redeemed_coupon = + { coupon_id: String, end_date: Time?, start_date: Time } + + class RedeemedCoupon < Orb::BaseModel + attr_accessor coupon_id: String + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + (coupon_id: String, end_date: Time?, start_date: Time) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::redeemed_coupon + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::redeemed_coupon + end + + type status = :active | :ended | :upcoming + + class Status < Orb::Enum + ACTIVE: :active + ENDED: :ended + UPCOMING: :upcoming + + def self.values: -> Array[Orb::Models::SubscriptionCreateResponse::status] + end + + type trial_info = { end_date: Time? } + + class TrialInfo < Orb::BaseModel + attr_accessor end_date: Time? + + def initialize: + (end_date: Time?) -> void + | ( + ?Orb::Models::SubscriptionCreateResponse::trial_info + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionCreateResponse::trial_info + end + end + end +end diff --git a/sig/orb/models/subscription_fetch_costs_params.rbs b/sig/orb/models/subscription_fetch_costs_params.rbs new file mode 100644 index 00000000..5ee96b5c --- /dev/null +++ b/sig/orb/models/subscription_fetch_costs_params.rbs @@ -0,0 +1,48 @@ +module Orb + module Models + type subscription_fetch_costs_params = + { + currency: String?, + timeframe_end: Time?, + timeframe_start: Time?, + view_mode: Orb::Models::SubscriptionFetchCostsParams::view_mode? + } + & Orb::request_parameters + + class SubscriptionFetchCostsParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor currency: String? + + attr_accessor timeframe_end: Time? + + attr_accessor timeframe_start: Time? + + attr_accessor view_mode: Orb::Models::SubscriptionFetchCostsParams::view_mode? + + def initialize: + ( + currency: String?, + timeframe_end: Time?, + timeframe_start: Time?, + view_mode: Orb::Models::SubscriptionFetchCostsParams::view_mode?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::subscription_fetch_costs_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_fetch_costs_params + + type view_mode = :periodic | :cumulative + + class ViewMode < Orb::Enum + PERIODIC: :periodic + CUMULATIVE: :cumulative + + def self.values: -> Array[Orb::Models::SubscriptionFetchCostsParams::view_mode] + end + end + end +end diff --git a/sig/orb/models/subscription_fetch_costs_response.rbs b/sig/orb/models/subscription_fetch_costs_response.rbs new file mode 100644 index 00000000..cc8cf092 --- /dev/null +++ b/sig/orb/models/subscription_fetch_costs_response.rbs @@ -0,0 +1,86 @@ +module Orb + module Models + type subscription_fetch_costs_response = + { data: Array[Orb::Models::SubscriptionFetchCostsResponse::Data] } + + class SubscriptionFetchCostsResponse < Orb::BaseModel + attr_accessor data: Array[Orb::Models::SubscriptionFetchCostsResponse::Data] + + def initialize: + (data: Array[Orb::Models::SubscriptionFetchCostsResponse::Data]) -> void + | ( + ?Orb::Models::subscription_fetch_costs_response | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_fetch_costs_response + + type data = + { + per_price_costs: Array[Orb::Models::SubscriptionFetchCostsResponse::Data::PerPriceCost], + subtotal: String, + timeframe_end: Time, + timeframe_start: Time, + total: String + } + + class Data < Orb::BaseModel + attr_accessor per_price_costs: Array[Orb::Models::SubscriptionFetchCostsResponse::Data::PerPriceCost] + + attr_accessor subtotal: String + + attr_accessor timeframe_end: Time + + attr_accessor timeframe_start: Time + + attr_accessor total: String + + def initialize: + ( + per_price_costs: Array[Orb::Models::SubscriptionFetchCostsResponse::Data::PerPriceCost], + subtotal: String, + timeframe_end: Time, + timeframe_start: Time, + total: String + ) -> void + | ( + ?Orb::Models::SubscriptionFetchCostsResponse::data + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionFetchCostsResponse::data + + type per_price_cost = + { + price: Orb::Models::price, + subtotal: String, + total: String, + quantity: Float? + } + + class PerPriceCost < Orb::BaseModel + attr_accessor price: Orb::Models::price + + attr_accessor subtotal: String + + attr_accessor total: String + + attr_accessor quantity: Float? + + def initialize: + ( + price: Orb::Models::price, + subtotal: String, + total: String, + quantity: Float? + ) -> void + | ( + ?Orb::Models::SubscriptionFetchCostsResponse::Data::per_price_cost + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionFetchCostsResponse::Data::per_price_cost + end + end + end + end +end diff --git a/sig/orb/models/subscription_fetch_params.rbs b/sig/orb/models/subscription_fetch_params.rbs new file mode 100644 index 00000000..99367a8b --- /dev/null +++ b/sig/orb/models/subscription_fetch_params.rbs @@ -0,0 +1,18 @@ +module Orb + module Models + type subscription_fetch_params = { } & Orb::request_parameters + + class SubscriptionFetchParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::subscription_fetch_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_fetch_params + end + end +end diff --git a/sig/orb/models/subscription_fetch_schedule_params.rbs b/sig/orb/models/subscription_fetch_schedule_params.rbs new file mode 100644 index 00000000..9418163b --- /dev/null +++ b/sig/orb/models/subscription_fetch_schedule_params.rbs @@ -0,0 +1,49 @@ +module Orb + module Models + type subscription_fetch_schedule_params = + { + cursor: String?, + limit: Integer, + start_date_gt: Time?, + start_date_gte: Time?, + start_date_lt: Time?, + start_date_lte: Time? + } + & Orb::request_parameters + + class SubscriptionFetchScheduleParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor cursor: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + attr_accessor start_date_gt: Time? + + attr_accessor start_date_gte: Time? + + attr_accessor start_date_lt: Time? + + attr_accessor start_date_lte: Time? + + def initialize: + ( + cursor: String?, + limit: Integer, + start_date_gt: Time?, + start_date_gte: Time?, + start_date_lt: Time?, + start_date_lte: Time?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::subscription_fetch_schedule_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_fetch_schedule_params + end + end +end diff --git a/sig/orb/models/subscription_fetch_schedule_response.rbs b/sig/orb/models/subscription_fetch_schedule_response.rbs new file mode 100644 index 00000000..13bfd094 --- /dev/null +++ b/sig/orb/models/subscription_fetch_schedule_response.rbs @@ -0,0 +1,54 @@ +module Orb + module Models + type subscription_fetch_schedule_response = + { + created_at: Time, + end_date: Time?, + plan: Orb::Models::SubscriptionFetchScheduleResponse::Plan, + start_date: Time + } + + class SubscriptionFetchScheduleResponse < Orb::BaseModel + attr_accessor created_at: Time + + attr_accessor end_date: Time? + + attr_accessor plan: Orb::Models::SubscriptionFetchScheduleResponse::Plan + + attr_accessor start_date: Time + + def initialize: + ( + created_at: Time, + end_date: Time?, + plan: Orb::Models::SubscriptionFetchScheduleResponse::Plan, + start_date: Time + ) -> void + | ( + ?Orb::Models::subscription_fetch_schedule_response + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_fetch_schedule_response + + type plan = { id: String?, external_plan_id: String?, name: String? } + + class Plan < Orb::BaseModel + attr_accessor id: String? + + attr_accessor external_plan_id: String? + + attr_accessor name: String? + + def initialize: + (id: String?, external_plan_id: String?, name: String?) -> void + | ( + ?Orb::Models::SubscriptionFetchScheduleResponse::plan + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionFetchScheduleResponse::plan + end + end + end +end diff --git a/sig/orb/models/subscription_fetch_usage_params.rbs b/sig/orb/models/subscription_fetch_usage_params.rbs new file mode 100644 index 00000000..8bdbae17 --- /dev/null +++ b/sig/orb/models/subscription_fetch_usage_params.rbs @@ -0,0 +1,80 @@ +module Orb + module Models + type subscription_fetch_usage_params = + { + billable_metric_id: String?, + first_dimension_key: String?, + first_dimension_value: String?, + granularity: Orb::Models::SubscriptionFetchUsageParams::granularity?, + group_by: String?, + second_dimension_key: String?, + second_dimension_value: String?, + timeframe_end: Time?, + timeframe_start: Time?, + view_mode: Orb::Models::SubscriptionFetchUsageParams::view_mode? + } + & Orb::request_parameters + + class SubscriptionFetchUsageParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor billable_metric_id: String? + + attr_accessor first_dimension_key: String? + + attr_accessor first_dimension_value: String? + + attr_accessor granularity: Orb::Models::SubscriptionFetchUsageParams::granularity? + + attr_accessor group_by: String? + + attr_accessor second_dimension_key: String? + + attr_accessor second_dimension_value: String? + + attr_accessor timeframe_end: Time? + + attr_accessor timeframe_start: Time? + + attr_accessor view_mode: Orb::Models::SubscriptionFetchUsageParams::view_mode? + + def initialize: + ( + billable_metric_id: String?, + first_dimension_key: String?, + first_dimension_value: String?, + granularity: Orb::Models::SubscriptionFetchUsageParams::granularity?, + group_by: String?, + second_dimension_key: String?, + second_dimension_value: String?, + timeframe_end: Time?, + timeframe_start: Time?, + view_mode: Orb::Models::SubscriptionFetchUsageParams::view_mode?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::subscription_fetch_usage_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_fetch_usage_params + + type granularity = :day + + class Granularity < Orb::Enum + DAY: :day + + def self.values: -> Array[Orb::Models::SubscriptionFetchUsageParams::granularity] + end + + type view_mode = :periodic | :cumulative + + class ViewMode < Orb::Enum + PERIODIC: :periodic + CUMULATIVE: :cumulative + + def self.values: -> Array[Orb::Models::SubscriptionFetchUsageParams::view_mode] + end + end + end +end diff --git a/sig/orb/models/subscription_list_params.rbs b/sig/orb/models/subscription_list_params.rbs new file mode 100644 index 00000000..b51a957c --- /dev/null +++ b/sig/orb/models/subscription_list_params.rbs @@ -0,0 +1,69 @@ +module Orb + module Models + type subscription_list_params = + { + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + cursor: String?, + customer_id: Array[String]?, + external_customer_id: String?, + limit: Integer, + status: Orb::Models::SubscriptionListParams::status? + } + & Orb::request_parameters + + class SubscriptionListParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor created_at_gt: Time? + + attr_accessor created_at_gte: Time? + + attr_accessor created_at_lt: Time? + + attr_accessor created_at_lte: Time? + + attr_accessor cursor: String? + + attr_accessor customer_id: Array[String]? + + attr_accessor external_customer_id: String? + + attr_reader limit: Integer? + + def limit=: (Integer) -> void + + attr_accessor status: Orb::Models::SubscriptionListParams::status? + + def initialize: + ( + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + cursor: String?, + customer_id: Array[String]?, + external_customer_id: String?, + limit: Integer, + status: Orb::Models::SubscriptionListParams::status?, + request_options: Orb::request_opts + ) -> void + | (?Orb::Models::subscription_list_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::subscription_list_params + + type status = :active | :ended | :upcoming + + class Status < Orb::Enum + ACTIVE: :active + ENDED: :ended + UPCOMING: :upcoming + + def self.values: -> Array[Orb::Models::SubscriptionListParams::status] + end + end + end +end diff --git a/sig/orb/models/subscription_price_intervals_params.rbs b/sig/orb/models/subscription_price_intervals_params.rbs new file mode 100644 index 00000000..8753447d --- /dev/null +++ b/sig/orb/models/subscription_price_intervals_params.rbs @@ -0,0 +1,5303 @@ +module Orb + module Models + type subscription_price_intervals_params = + { + add: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add], + add_adjustments: Array[Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment], + edit: Array[Orb::Models::SubscriptionPriceIntervalsParams::Edit], + edit_adjustments: Array[Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment] + } + & Orb::request_parameters + + class SubscriptionPriceIntervalsParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_reader add: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add]? + + def add=: ( + Array[Orb::Models::SubscriptionPriceIntervalsParams::Add] + ) -> void + + attr_reader add_adjustments: Array[Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment]? + + def add_adjustments=: ( + Array[Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment] + ) -> void + + attr_reader edit: Array[Orb::Models::SubscriptionPriceIntervalsParams::Edit]? + + def edit=: ( + Array[Orb::Models::SubscriptionPriceIntervalsParams::Edit] + ) -> void + + attr_reader edit_adjustments: Array[Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment]? + + def edit_adjustments=: ( + Array[Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment] + ) -> void + + def initialize: + ( + add: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add], + add_adjustments: Array[Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment], + edit: Array[Orb::Models::SubscriptionPriceIntervalsParams::Edit], + edit_adjustments: Array[Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment], + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::subscription_price_intervals_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_price_intervals_params + + type add = + { + start_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::start_date, + allocation_price: Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice?, + discounts: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::discount]?, + end_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::end_date?, + external_price_id: String?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::FixedFeeQuantityTransition]?, + maximum_amount: Float?, + minimum_amount: Float?, + price: Orb::Models::SubscriptionPriceIntervalsParams::Add::price?, + price_id: String? + } + + class Add < Orb::BaseModel + attr_accessor start_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::start_date + + attr_accessor allocation_price: Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice? + + attr_accessor discounts: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::discount]? + + attr_accessor end_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::end_date? + + attr_accessor external_price_id: String? + + attr_accessor fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::FixedFeeQuantityTransition]? + + attr_accessor maximum_amount: Float? + + attr_accessor minimum_amount: Float? + + attr_accessor price: Orb::Models::SubscriptionPriceIntervalsParams::Add::price? + + attr_accessor price_id: String? + + def initialize: + ( + start_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::start_date, + allocation_price: Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice?, + discounts: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::discount]?, + end_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::end_date?, + external_price_id: String?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::FixedFeeQuantityTransition]?, + maximum_amount: Float?, + minimum_amount: Float?, + price: Orb::Models::SubscriptionPriceIntervalsParams::Add::price?, + price_id: String? + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::add + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::add + + type start_date = Time | Orb::Models::billing_cycle_relative_date + + class StartDate < Orb::Union + private def self.variants: -> [[nil, Time], [nil, Orb::Models::billing_cycle_relative_date]] + end + + type allocation_price = + { + amount: String, + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice::cadence, + currency: String, + expires_at_end_of_cadence: bool + } + + class AllocationPrice < Orb::BaseModel + attr_accessor amount: String + + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice::cadence + + attr_accessor currency: String + + attr_accessor expires_at_end_of_cadence: bool + + def initialize: + ( + amount: String, + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice::cadence, + currency: String, + expires_at_end_of_cadence: bool + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::allocation_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::allocation_price + + type cadence = + :one_time | :monthly | :quarterly | :semi_annual | :annual | :custom + + class Cadence < Orb::Enum + ONE_TIME: :one_time + MONTHLY: :monthly + QUARTERLY: :quarterly + SEMI_ANNUAL: :semi_annual + ANNUAL: :annual + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::AllocationPrice::cadence] + end + end + + type discount = + Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::AmountDiscountCreationParams + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::PercentageDiscountCreationParams + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::UsageDiscountCreationParams + + class Discount < Orb::Union + type amount_discount_creation_params = + { amount_discount: Float, discount_type: :amount } + + class AmountDiscountCreationParams < Orb::BaseModel + attr_accessor amount_discount: Float + + attr_accessor discount_type: :amount + + def initialize: + (amount_discount: Float, discount_type: :amount) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::amount_discount_creation_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::amount_discount_creation_params + end + + type percentage_discount_creation_params = + { discount_type: :percentage, percentage_discount: Float } + + class PercentageDiscountCreationParams < Orb::BaseModel + attr_accessor discount_type: :percentage + + attr_accessor percentage_discount: Float + + def initialize: + (percentage_discount: Float, discount_type: :percentage) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::percentage_discount_creation_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::percentage_discount_creation_params + end + + type usage_discount_creation_params = + { discount_type: :usage, usage_discount: Float } + + class UsageDiscountCreationParams < Orb::BaseModel + attr_accessor discount_type: :usage + + attr_accessor usage_discount: Float + + def initialize: + (usage_discount: Float, discount_type: :usage) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::usage_discount_creation_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::usage_discount_creation_params + end + + private def self.variants: -> [[:amount, Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::AmountDiscountCreationParams], [:percentage, Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::PercentageDiscountCreationParams], [:usage, Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::UsageDiscountCreationParams]] + end + + type end_date = Time | Orb::Models::billing_cycle_relative_date + + class EndDate < Orb::Union + private def self.variants: -> [[nil, Time], [nil, Orb::Models::billing_cycle_relative_date]] + end + + type fixed_fee_quantity_transition = + { effective_date: Time, quantity: Integer } + + class FixedFeeQuantityTransition < Orb::BaseModel + attr_accessor effective_date: Time + + attr_accessor quantity: Integer + + def initialize: + (effective_date: Time, quantity: Integer) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::fixed_fee_quantity_transition + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::fixed_fee_quantity_transition + end + + type price = + Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice + | Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice + + class Price < Orb::Union + type new_floating_unit_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::cadence, + currency: String, + item_id: String, + model_type: :unit, + name: String, + unit_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::UnitConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingUnitPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :unit + + attr_accessor name: String + + attr_accessor unit_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::UnitConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::cadence, + currency: String, + item_id: String, + name: String, + unit_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::UnitConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_unit_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_unit_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::cadence] + end + + type unit_config = { unit_amount: String } + + class UnitConfig < Orb::BaseModel + attr_accessor unit_amount: String + + def initialize: + (unit_amount: String) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::unit_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::unit_config + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_package_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::cadence, + currency: String, + item_id: String, + model_type: :package, + name: String, + package_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::PackageConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingPackagePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :package + + attr_accessor name: String + + attr_accessor package_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::PackageConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::cadence, + currency: String, + item_id: String, + name: String, + package_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::PackageConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :package + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_package_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::cadence] + end + + type package_config = + { package_amount: String, package_size: Integer } + + class PackageConfig < Orb::BaseModel + attr_accessor package_amount: String + + attr_accessor package_size: Integer + + def initialize: + (package_amount: String, package_size: Integer) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::package_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::package_config + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_matrix_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::cadence, + currency: String, + item_id: String, + matrix_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig, + model_type: :matrix, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingMatrixPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor matrix_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig + + attr_accessor model_type: :matrix + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::cadence, + currency: String, + item_id: String, + matrix_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :matrix + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_matrix_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_matrix_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::cadence] + end + + type matrix_config = + { + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig::MatrixValue] + } + + class MatrixConfig < Orb::BaseModel + attr_accessor default_unit_amount: String + + attr_accessor dimensions: Array[String?] + + attr_accessor matrix_values: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig::MatrixValue] + + def initialize: + ( + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig::MatrixValue] + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::matrix_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::matrix_config + + type matrix_value = + { dimension_values: Array[String?], unit_amount: String } + + class MatrixValue < Orb::BaseModel + attr_accessor dimension_values: Array[String?] + + attr_accessor unit_amount: String + + def initialize: + ( + dimension_values: Array[String?], + unit_amount: String + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig::matrix_value + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::MatrixConfig::matrix_value + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_matrix_with_allocation_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::cadence, + currency: String, + item_id: String, + matrix_with_allocation_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig, + model_type: :matrix_with_allocation, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingMatrixWithAllocationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor matrix_with_allocation_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig + + attr_accessor model_type: :matrix_with_allocation + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::cadence, + currency: String, + item_id: String, + matrix_with_allocation_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :matrix_with_allocation + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_matrix_with_allocation_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_matrix_with_allocation_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::cadence] + end + + type matrix_with_allocation_config = + { + allocation: Float, + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue] + } + + class MatrixWithAllocationConfig < Orb::BaseModel + attr_accessor allocation: Float + + attr_accessor default_unit_amount: String + + attr_accessor dimensions: Array[String?] + + attr_accessor matrix_values: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue] + + def initialize: + ( + allocation: Float, + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig::MatrixValue] + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::matrix_with_allocation_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::matrix_with_allocation_config + + type matrix_value = + { dimension_values: Array[String?], unit_amount: String } + + class MatrixValue < Orb::BaseModel + attr_accessor dimension_values: Array[String?] + + attr_accessor unit_amount: String + + def initialize: + ( + dimension_values: Array[String?], + unit_amount: String + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig::matrix_value + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::MatrixWithAllocationConfig::matrix_value + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_tiered_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::cadence, + currency: String, + item_id: String, + model_type: :tiered, + name: String, + tiered_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingTieredPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :tiered + + attr_accessor name: String + + attr_accessor tiered_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::cadence, + currency: String, + item_id: String, + name: String, + tiered_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :tiered + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_tiered_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_tiered_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::cadence] + end + + type tiered_config = + { + tiers: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig::Tier] + } + + class TieredConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::tiered_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::tiered_config + + type tier = + { first_unit: Float, unit_amount: String, last_unit: Float? } + + class Tier < Orb::BaseModel + attr_accessor first_unit: Float + + attr_accessor unit_amount: String + + attr_accessor last_unit: Float? + + def initialize: + ( + first_unit: Float, + unit_amount: String, + last_unit: Float? + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::TieredConfig::tier + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_tiered_bps_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::cadence, + currency: String, + item_id: String, + model_type: :tiered_bps, + name: String, + tiered_bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingTieredBpsPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_bps + + attr_accessor name: String + + attr_accessor tiered_bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::cadence, + currency: String, + item_id: String, + name: String, + tiered_bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :tiered_bps + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_tiered_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_tiered_bps_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::cadence] + end + + type tiered_bps_config = + { + tiers: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig::Tier] + } + + class TieredBpsConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::tiered_bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::tiered_bps_config + + type tier = + { + bps: Float, + minimum_amount: String, + maximum_amount: String?, + per_unit_maximum: String? + } + + class Tier < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor minimum_amount: String + + attr_accessor maximum_amount: String? + + attr_accessor per_unit_maximum: String? + + def initialize: + ( + bps: Float, + minimum_amount: String, + maximum_amount: String?, + per_unit_maximum: String? + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::TieredBpsConfig::tier + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_bps_price = + { + bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BpsConfig, + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::cadence, + currency: String, + item_id: String, + model_type: :bps, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingBpsPrice < Orb::BaseModel + attr_accessor bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BpsConfig + + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :bps + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BpsConfig, + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::cadence, + currency: String, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :bps + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_bps_price + + type bps_config = { bps: Float, per_unit_maximum: String? } + + class BpsConfig < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor per_unit_maximum: String? + + def initialize: + (bps: Float, per_unit_maximum: String?) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::bps_config + end + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_bulk_bps_price = + { + bulk_bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig, + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::cadence, + currency: String, + item_id: String, + model_type: :bulk_bps, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingBulkBpsPrice < Orb::BaseModel + attr_accessor bulk_bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig + + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :bulk_bps + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + bulk_bps_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig, + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::cadence, + currency: String, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :bulk_bps + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_bulk_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_bulk_bps_price + + type bulk_bps_config = + { + tiers: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig::Tier] + } + + class BulkBpsConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::bulk_bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::bulk_bps_config + + type tier = + { + bps: Float, + maximum_amount: String?, + per_unit_maximum: String? + } + + class Tier < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor maximum_amount: String? + + attr_accessor per_unit_maximum: String? + + def initialize: + ( + bps: Float, + maximum_amount: String?, + per_unit_maximum: String? + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BulkBpsConfig::tier + end + end + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_bulk_price = + { + bulk_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig, + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::cadence, + currency: String, + item_id: String, + model_type: :bulk, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingBulkPrice < Orb::BaseModel + attr_accessor bulk_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig + + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :bulk + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + bulk_config: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig, + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::cadence, + currency: String, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :bulk + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_bulk_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_bulk_price + + type bulk_config = + { + tiers: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig::Tier] + } + + class BulkConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::bulk_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::bulk_config + + type tier = { unit_amount: String, maximum_units: Float? } + + class Tier < Orb::BaseModel + attr_accessor unit_amount: String + + attr_accessor maximum_units: Float? + + def initialize: + (unit_amount: String, maximum_units: Float?) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BulkConfig::tier + end + end + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_threshold_total_amount_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::cadence, + currency: String, + item_id: String, + model_type: :threshold_total_amount, + name: String, + threshold_total_amount_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingThresholdTotalAmountPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :threshold_total_amount + + attr_accessor name: String + + attr_accessor threshold_total_amount_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::cadence, + currency: String, + item_id: String, + name: String, + threshold_total_amount_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :threshold_total_amount + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_threshold_total_amount_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_threshold_total_amount_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_tiered_package_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::cadence, + currency: String, + item_id: String, + model_type: :tiered_package, + name: String, + tiered_package_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingTieredPackagePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_package + + attr_accessor name: String + + attr_accessor tiered_package_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::cadence, + currency: String, + item_id: String, + name: String, + tiered_package_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :tiered_package + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_tiered_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_tiered_package_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_grouped_tiered_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::cadence, + currency: String, + grouped_tiered_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_tiered, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingGroupedTieredPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::cadence + + attr_accessor currency: String + + attr_accessor grouped_tiered_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_tiered + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::cadence, + currency: String, + grouped_tiered_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :grouped_tiered + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_grouped_tiered_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_grouped_tiered_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_max_group_tiered_package_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::cadence, + currency: String, + item_id: String, + max_group_tiered_package_config: Hash[Symbol, top], + model_type: :max_group_tiered_package, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingMaxGroupTieredPackagePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor max_group_tiered_package_config: Hash[Symbol, top] + + attr_accessor model_type: :max_group_tiered_package + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::cadence, + currency: String, + item_id: String, + max_group_tiered_package_config: Hash[Symbol, top], + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :max_group_tiered_package + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_max_group_tiered_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_max_group_tiered_package_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_tiered_with_minimum_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::cadence, + currency: String, + item_id: String, + model_type: :tiered_with_minimum, + name: String, + tiered_with_minimum_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingTieredWithMinimumPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_minimum + + attr_accessor name: String + + attr_accessor tiered_with_minimum_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::cadence, + currency: String, + item_id: String, + name: String, + tiered_with_minimum_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :tiered_with_minimum + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_tiered_with_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_tiered_with_minimum_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_package_with_allocation_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::cadence, + currency: String, + item_id: String, + model_type: :package_with_allocation, + name: String, + package_with_allocation_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingPackageWithAllocationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :package_with_allocation + + attr_accessor name: String + + attr_accessor package_with_allocation_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::cadence, + currency: String, + item_id: String, + name: String, + package_with_allocation_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :package_with_allocation + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_package_with_allocation_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_package_with_allocation_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_tiered_package_with_minimum_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::cadence, + currency: String, + item_id: String, + model_type: :tiered_package_with_minimum, + name: String, + tiered_package_with_minimum_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingTieredPackageWithMinimumPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_package_with_minimum + + attr_accessor name: String + + attr_accessor tiered_package_with_minimum_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::cadence, + currency: String, + item_id: String, + name: String, + tiered_package_with_minimum_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :tiered_package_with_minimum + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_tiered_package_with_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_tiered_package_with_minimum_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_unit_with_percent_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::cadence, + currency: String, + item_id: String, + model_type: :unit_with_percent, + name: String, + unit_with_percent_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingUnitWithPercentPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :unit_with_percent + + attr_accessor name: String + + attr_accessor unit_with_percent_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::cadence, + currency: String, + item_id: String, + name: String, + unit_with_percent_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :unit_with_percent + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_unit_with_percent_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_unit_with_percent_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_tiered_with_proration_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::cadence, + currency: String, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingTieredWithProrationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_proration + + attr_accessor name: String + + attr_accessor tiered_with_proration_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::cadence, + currency: String, + item_id: String, + name: String, + tiered_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :tiered_with_proration + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_tiered_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_tiered_with_proration_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_unit_with_proration_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::cadence, + currency: String, + item_id: String, + model_type: :unit_with_proration, + name: String, + unit_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingUnitWithProrationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :unit_with_proration + + attr_accessor name: String + + attr_accessor unit_with_proration_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::cadence, + currency: String, + item_id: String, + name: String, + unit_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :unit_with_proration + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_unit_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_unit_with_proration_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_grouped_allocation_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::cadence, + currency: String, + grouped_allocation_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_allocation, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingGroupedAllocationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::cadence + + attr_accessor currency: String + + attr_accessor grouped_allocation_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_allocation + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::cadence, + currency: String, + grouped_allocation_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :grouped_allocation + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_grouped_allocation_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_grouped_allocation_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_grouped_with_prorated_minimum_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::cadence, + currency: String, + grouped_with_prorated_minimum_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_with_prorated_minimum, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingGroupedWithProratedMinimumPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::cadence + + attr_accessor currency: String + + attr_accessor grouped_with_prorated_minimum_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_prorated_minimum + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::cadence, + currency: String, + grouped_with_prorated_minimum_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :grouped_with_prorated_minimum + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_grouped_with_prorated_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_grouped_with_prorated_minimum_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_grouped_with_metered_minimum_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::cadence, + currency: String, + grouped_with_metered_minimum_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_with_metered_minimum, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingGroupedWithMeteredMinimumPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::cadence + + attr_accessor currency: String + + attr_accessor grouped_with_metered_minimum_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_metered_minimum + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::cadence, + currency: String, + grouped_with_metered_minimum_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :grouped_with_metered_minimum + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_grouped_with_metered_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_grouped_with_metered_minimum_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_matrix_with_display_name_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::cadence, + currency: String, + item_id: String, + matrix_with_display_name_config: Hash[Symbol, top], + model_type: :matrix_with_display_name, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingMatrixWithDisplayNamePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor matrix_with_display_name_config: Hash[Symbol, top] + + attr_accessor model_type: :matrix_with_display_name + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::cadence, + currency: String, + item_id: String, + matrix_with_display_name_config: Hash[Symbol, top], + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :matrix_with_display_name + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_matrix_with_display_name_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_matrix_with_display_name_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_bulk_with_proration_price = + { + bulk_with_proration_config: Hash[Symbol, top], + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::cadence, + currency: String, + item_id: String, + model_type: :bulk_with_proration, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingBulkWithProrationPrice < Orb::BaseModel + attr_accessor bulk_with_proration_config: Hash[Symbol, top] + + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :bulk_with_proration + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + bulk_with_proration_config: Hash[Symbol, top], + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::cadence, + currency: String, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :bulk_with_proration + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_bulk_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_bulk_with_proration_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_grouped_tiered_package_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::cadence, + currency: String, + grouped_tiered_package_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_tiered_package, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingGroupedTieredPackagePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::cadence + + attr_accessor currency: String + + attr_accessor grouped_tiered_package_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_tiered_package + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::cadence, + currency: String, + grouped_tiered_package_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :grouped_tiered_package + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_grouped_tiered_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_grouped_tiered_package_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_scalable_matrix_with_unit_pricing_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::cadence, + currency: String, + item_id: String, + model_type: :scalable_matrix_with_unit_pricing, + name: String, + scalable_matrix_with_unit_pricing_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingScalableMatrixWithUnitPricingPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :scalable_matrix_with_unit_pricing + + attr_accessor name: String + + attr_accessor scalable_matrix_with_unit_pricing_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::cadence, + currency: String, + item_id: String, + name: String, + scalable_matrix_with_unit_pricing_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :scalable_matrix_with_unit_pricing + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_scalable_matrix_with_unit_pricing_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_scalable_matrix_with_unit_pricing_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_floating_scalable_matrix_with_tiered_pricing_price = + { + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::cadence, + currency: String, + item_id: String, + model_type: :scalable_matrix_with_tiered_pricing, + name: String, + scalable_matrix_with_tiered_pricing_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]? + } + + class NewFloatingScalableMatrixWithTieredPricingPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::cadence + + attr_accessor currency: String + + attr_accessor item_id: String + + attr_accessor model_type: :scalable_matrix_with_tiered_pricing + + attr_accessor name: String + + attr_accessor scalable_matrix_with_tiered_pricing_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + def initialize: + ( + cadence: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::cadence, + currency: String, + item_id: String, + name: String, + scalable_matrix_with_tiered_pricing_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + model_type: :scalable_matrix_with_tiered_pricing + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_scalable_matrix_with_tiered_pricing_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::new_floating_scalable_matrix_with_tiered_pricing_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + private def self.variants: -> [[:unit, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitPrice], [:package, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackagePrice], [:matrix, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixPrice], [:matrix_with_allocation, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithAllocationPrice], [:tiered, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPrice], [:tiered_bps, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredBpsPrice], [:bps, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBpsPrice], [:bulk_bps, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkBpsPrice], [:bulk, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkPrice], [:threshold_total_amount, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingThresholdTotalAmountPrice], [:tiered_package, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackagePrice], [:grouped_tiered, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPrice], [:max_group_tiered_package, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMaxGroupTieredPackagePrice], [:tiered_with_minimum, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithMinimumPrice], [:package_with_allocation, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingPackageWithAllocationPrice], [:tiered_package_with_minimum, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredPackageWithMinimumPrice], [:unit_with_percent, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithPercentPrice], [:tiered_with_proration, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingTieredWithProrationPrice], [:unit_with_proration, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingUnitWithProrationPrice], [:grouped_allocation, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedAllocationPrice], [:grouped_with_prorated_minimum, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithProratedMinimumPrice], [:grouped_with_metered_minimum, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedWithMeteredMinimumPrice], [:matrix_with_display_name, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingMatrixWithDisplayNamePrice], [:bulk_with_proration, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingBulkWithProrationPrice], [:grouped_tiered_package, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingGroupedTieredPackagePrice], [:scalable_matrix_with_unit_pricing, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithUnitPricingPrice], [:scalable_matrix_with_tiered_pricing, Orb::Models::SubscriptionPriceIntervalsParams::Add::Price::NewFloatingScalableMatrixWithTieredPricingPrice]] + end + end + + type add_adjustment = + { + adjustment: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::adjustment, + start_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::start_date, + end_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::end_date? + } + + class AddAdjustment < Orb::BaseModel + attr_accessor adjustment: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::adjustment + + attr_accessor start_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::start_date + + attr_accessor end_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::end_date? + + def initialize: + ( + adjustment: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::adjustment, + start_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::start_date, + end_date: Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::end_date? + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::add_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::add_adjustment + + type adjustment = + Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewPercentageDiscount + | Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewUsageDiscount + | Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewAmountDiscount + | Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMinimum + | Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMaximum + + class Adjustment < Orb::Union + type new_percentage_discount = + { + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + percentage_discount: Float, + is_invoice_level: bool + } + + class NewPercentageDiscount < Orb::BaseModel + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor percentage_discount: Float + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + percentage_discount: Float, + is_invoice_level: bool, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::new_percentage_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::new_percentage_discount + end + + type new_usage_discount = + { + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + usage_discount: Float, + is_invoice_level: bool + } + + class NewUsageDiscount < Orb::BaseModel + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor usage_discount: Float + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + usage_discount: Float, + is_invoice_level: bool, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::new_usage_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::new_usage_discount + end + + type new_amount_discount = + { + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool + } + + class NewAmountDiscount < Orb::BaseModel + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::new_amount_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::new_amount_discount + end + + type new_minimum = + { + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: bool + } + + class NewMinimum < Orb::BaseModel + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: bool, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::new_minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::new_minimum + end + + type new_maximum = + { + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + maximum_amount: String, + is_invoice_level: bool + } + + class NewMaximum < Orb::BaseModel + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String, + is_invoice_level: bool, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::new_maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::new_maximum + end + + private def self.variants: -> [[:percentage_discount, Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewPercentageDiscount], [:usage_discount, Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewUsageDiscount], [:amount_discount, Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewAmountDiscount], [:minimum, Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMinimum], [:maximum, Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment::Adjustment::NewMaximum]] + end + + type start_date = Time | Orb::Models::billing_cycle_relative_date + + class StartDate < Orb::Union + private def self.variants: -> [[nil, Time], [nil, Orb::Models::billing_cycle_relative_date]] + end + + type end_date = Time | Orb::Models::billing_cycle_relative_date + + class EndDate < Orb::Union + private def self.variants: -> [[nil, Time], [nil, Orb::Models::billing_cycle_relative_date]] + end + end + + type edit = + { + price_interval_id: String, + billing_cycle_day: Integer?, + end_date: Orb::Models::SubscriptionPriceIntervalsParams::Edit::end_date?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionPriceIntervalsParams::Edit::FixedFeeQuantityTransition]?, + start_date: Orb::Models::SubscriptionPriceIntervalsParams::Edit::start_date + } + + class Edit < Orb::BaseModel + attr_accessor price_interval_id: String + + attr_accessor billing_cycle_day: Integer? + + attr_accessor end_date: Orb::Models::SubscriptionPriceIntervalsParams::Edit::end_date? + + attr_accessor fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionPriceIntervalsParams::Edit::FixedFeeQuantityTransition]? + + attr_reader start_date: Orb::Models::SubscriptionPriceIntervalsParams::Edit::start_date? + + def start_date=: ( + Orb::Models::SubscriptionPriceIntervalsParams::Edit::start_date + ) -> void + + def initialize: + ( + price_interval_id: String, + billing_cycle_day: Integer?, + end_date: Orb::Models::SubscriptionPriceIntervalsParams::Edit::end_date?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionPriceIntervalsParams::Edit::FixedFeeQuantityTransition]?, + start_date: Orb::Models::SubscriptionPriceIntervalsParams::Edit::start_date + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::edit + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::edit + + type end_date = Time | Orb::Models::billing_cycle_relative_date + + class EndDate < Orb::Union + private def self.variants: -> [[nil, Time], [nil, Orb::Models::billing_cycle_relative_date]] + end + + type fixed_fee_quantity_transition = + { effective_date: Time, quantity: Integer } + + class FixedFeeQuantityTransition < Orb::BaseModel + attr_accessor effective_date: Time + + attr_accessor quantity: Integer + + def initialize: + (effective_date: Time, quantity: Integer) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::Edit::fixed_fee_quantity_transition + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::Edit::fixed_fee_quantity_transition + end + + type start_date = Time | Orb::Models::billing_cycle_relative_date + + class StartDate < Orb::Union + private def self.variants: -> [[nil, Time], [nil, Orb::Models::billing_cycle_relative_date]] + end + end + + type edit_adjustment = + { + adjustment_interval_id: String, + end_date: Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::end_date?, + start_date: Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::start_date + } + + class EditAdjustment < Orb::BaseModel + attr_accessor adjustment_interval_id: String + + attr_accessor end_date: Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::end_date? + + attr_reader start_date: Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::start_date? + + def start_date=: ( + Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::start_date + ) -> void + + def initialize: + ( + adjustment_interval_id: String, + end_date: Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::end_date?, + start_date: Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment::start_date + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsParams::edit_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsParams::edit_adjustment + + type end_date = Time | Orb::Models::billing_cycle_relative_date + + class EndDate < Orb::Union + private def self.variants: -> [[nil, Time], [nil, Orb::Models::billing_cycle_relative_date]] + end + + type start_date = Time | Orb::Models::billing_cycle_relative_date + + class StartDate < Orb::Union + private def self.variants: -> [[nil, Time], [nil, Orb::Models::billing_cycle_relative_date]] + end + end + end + end +end diff --git a/sig/orb/models/subscription_price_intervals_response.rbs b/sig/orb/models/subscription_price_intervals_response.rbs new file mode 100644 index 00000000..46e7349f --- /dev/null +++ b/sig/orb/models/subscription_price_intervals_response.rbs @@ -0,0 +1,751 @@ +module Orb + module Models + type subscription_price_intervals_response = + { + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionPriceIntervalsResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionPriceIntervalsResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionPriceIntervalsResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionPriceIntervalsResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionPriceIntervalsResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionPriceIntervalsResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionPriceIntervalsResponse::status, + trial_info: Orb::Models::SubscriptionPriceIntervalsResponse::TrialInfo + } + + class SubscriptionPriceIntervalsResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor active_plan_phase_order: Integer? + + attr_accessor adjustment_intervals: Array[Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval] + + attr_accessor auto_collection: bool? + + attr_accessor billing_cycle_anchor_configuration: Orb::Models::SubscriptionPriceIntervalsResponse::BillingCycleAnchorConfiguration + + attr_accessor billing_cycle_day: Integer + + attr_accessor created_at: Time + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor customer: Orb::Models::Customer + + attr_accessor default_invoice_memo: String? + + attr_accessor discount_intervals: Array[Orb::Models::SubscriptionPriceIntervalsResponse::discount_interval] + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionPriceIntervalsResponse::FixedFeeQuantitySchedule] + + attr_accessor invoicing_threshold: String? + + attr_accessor maximum_intervals: Array[Orb::Models::SubscriptionPriceIntervalsResponse::MaximumInterval] + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum_intervals: Array[Orb::Models::SubscriptionPriceIntervalsResponse::MinimumInterval] + + attr_accessor net_terms: Integer + + attr_accessor plan: Orb::Models::Plan + + attr_accessor price_intervals: Array[Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval] + + attr_accessor redeemed_coupon: Orb::Models::SubscriptionPriceIntervalsResponse::RedeemedCoupon? + + attr_accessor start_date: Time + + attr_accessor status: Orb::Models::SubscriptionPriceIntervalsResponse::status + + attr_accessor trial_info: Orb::Models::SubscriptionPriceIntervalsResponse::TrialInfo + + def initialize: + ( + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionPriceIntervalsResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionPriceIntervalsResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionPriceIntervalsResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionPriceIntervalsResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionPriceIntervalsResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionPriceIntervalsResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionPriceIntervalsResponse::status, + trial_info: Orb::Models::SubscriptionPriceIntervalsResponse::TrialInfo + ) -> void + | ( + ?Orb::Models::subscription_price_intervals_response + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_price_intervals_response + + type adjustment_interval = + { + id: String, + adjustment: Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + } + + class AdjustmentInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment: Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::adjustment + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + adjustment: Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::adjustment_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::adjustment_interval + + type adjustment = + Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + | Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + | Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + | Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + | Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + + class Adjustment < Orb::Union + type amount_discount_adjustment = + { + id: String, + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String? + } + + class AmountDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + end + + type percentage_discount_adjustment = + { + id: String, + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String? + } + + class PercentageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor percentage_discount: Float + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + end + + type usage_discount_adjustment = + { + id: String, + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float + } + + class UsageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + attr_accessor usage_discount: Float + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + end + + type minimum_adjustment = + { + id: String, + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MinimumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::minimum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::minimum_adjustment + end + + type maximum_adjustment = + { + id: String, + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MaximumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor maximum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::maximum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::maximum_adjustment + end + + private def self.variants: -> [[:amount_discount, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment], [:percentage_discount, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment], [:usage_discount, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment], [:minimum, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MinimumAdjustment], [:maximum, Orb::Models::SubscriptionPriceIntervalsResponse::AdjustmentInterval::Adjustment::MaximumAdjustment]] + end + end + + type billing_cycle_anchor_configuration = + { day: Integer, month: Integer?, year: Integer? } + + class BillingCycleAnchorConfiguration < Orb::BaseModel + attr_accessor day: Integer + + attr_accessor month: Integer? + + attr_accessor year: Integer? + + def initialize: + (day: Integer, month: Integer?, year: Integer?) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::billing_cycle_anchor_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::billing_cycle_anchor_configuration + end + + type discount_interval = + Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::AmountDiscountInterval + | Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::PercentageDiscountInterval + | Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::UsageDiscountInterval + + class DiscountInterval < Orb::Union + type amount_discount_interval = + { + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :amount, + end_date: Time?, + start_date: Time + } + + class AmountDiscountInterval < Orb::BaseModel + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :amount + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + discount_type: :amount + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::amount_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::amount_discount_interval + end + + type percentage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :percentage, + end_date: Time?, + percentage_discount: Float, + start_date: Time + } + + class PercentageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :percentage + + attr_accessor end_date: Time? + + attr_accessor percentage_discount: Float + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + percentage_discount: Float, + start_date: Time, + discount_type: :percentage + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::percentage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::percentage_discount_interval + end + + type usage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :usage, + end_date: Time?, + start_date: Time, + usage_discount: Float + } + + class UsageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :usage + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + attr_accessor usage_discount: Float + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + usage_discount: Float, + discount_type: :usage + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::usage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::usage_discount_interval + end + + private def self.variants: -> [[:amount, Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::AmountDiscountInterval], [:percentage, Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::PercentageDiscountInterval], [:usage, Orb::Models::SubscriptionPriceIntervalsResponse::DiscountInterval::UsageDiscountInterval]] + end + + type fixed_fee_quantity_schedule = + { end_date: Time?, price_id: String, quantity: Float, start_date: Time } + + class FixedFeeQuantitySchedule < Orb::BaseModel + attr_accessor end_date: Time? + + attr_accessor price_id: String + + attr_accessor quantity: Float + + attr_accessor start_date: Time + + def initialize: + ( + end_date: Time?, + price_id: String, + quantity: Float, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::fixed_fee_quantity_schedule + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::fixed_fee_quantity_schedule + end + + type maximum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + } + + class MaximumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor maximum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::maximum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::maximum_interval + end + + type minimum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + } + + class MinimumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor minimum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::minimum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::minimum_interval + end + + type price_interval = + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + } + + class PriceInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor billing_cycle_day: Integer + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval::FixedFeeQuantityTransition]? + + attr_accessor price: Orb::Models::price + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::price_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::price_interval + + type fixed_fee_quantity_transition = + { effective_date: Time, price_id: String, quantity: Integer } + + class FixedFeeQuantityTransition < Orb::BaseModel + attr_accessor effective_date: Time + + attr_accessor price_id: String + + attr_accessor quantity: Integer + + def initialize: + (effective_date: Time, price_id: String, quantity: Integer) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval::fixed_fee_quantity_transition + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::PriceInterval::fixed_fee_quantity_transition + end + end + + type redeemed_coupon = + { coupon_id: String, end_date: Time?, start_date: Time } + + class RedeemedCoupon < Orb::BaseModel + attr_accessor coupon_id: String + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + (coupon_id: String, end_date: Time?, start_date: Time) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::redeemed_coupon + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::redeemed_coupon + end + + type status = :active | :ended | :upcoming + + class Status < Orb::Enum + ACTIVE: :active + ENDED: :ended + UPCOMING: :upcoming + + def self.values: -> Array[Orb::Models::SubscriptionPriceIntervalsResponse::status] + end + + type trial_info = { end_date: Time? } + + class TrialInfo < Orb::BaseModel + attr_accessor end_date: Time? + + def initialize: + (end_date: Time?) -> void + | ( + ?Orb::Models::SubscriptionPriceIntervalsResponse::trial_info + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionPriceIntervalsResponse::trial_info + end + end + end +end diff --git a/sig/orb/models/subscription_schedule_plan_change_params.rbs b/sig/orb/models/subscription_schedule_plan_change_params.rbs new file mode 100644 index 00000000..b3339c8d --- /dev/null +++ b/sig/orb/models/subscription_schedule_plan_change_params.rbs @@ -0,0 +1,7356 @@ +module Orb + module Models + type subscription_schedule_plan_change_params = + { + change_option: Orb::Models::SubscriptionSchedulePlanChangeParams::change_option, + add_adjustments: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment]?, + add_prices: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice]?, + align_billing_with_plan_change_date: bool?, + auto_collection: bool?, + billing_cycle_alignment: Orb::Models::SubscriptionSchedulePlanChangeParams::billing_cycle_alignment?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAnchorConfiguration?, + change_date: Time?, + coupon_redemption_code: String?, + credits_overage_rate: Float?, + default_invoice_memo: String?, + external_plan_id: String?, + filter: String?, + initial_phase_order: Integer?, + invoicing_threshold: String?, + net_terms: Integer?, + per_credit_overage_amount: Float?, + plan_id: String?, + plan_version_number: Integer?, + price_overrides: Array[top]?, + remove_adjustments: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::RemoveAdjustment]?, + remove_prices: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::RemovePrice]?, + replace_adjustments: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment]?, + replace_prices: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice]?, + trial_duration_days: Integer? + } + & Orb::request_parameters + + class SubscriptionSchedulePlanChangeParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor change_option: Orb::Models::SubscriptionSchedulePlanChangeParams::change_option + + attr_accessor add_adjustments: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment]? + + attr_accessor add_prices: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice]? + + attr_accessor align_billing_with_plan_change_date: bool? + + attr_accessor auto_collection: bool? + + attr_accessor billing_cycle_alignment: Orb::Models::SubscriptionSchedulePlanChangeParams::billing_cycle_alignment? + + attr_accessor billing_cycle_anchor_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAnchorConfiguration? + + attr_accessor change_date: Time? + + attr_accessor coupon_redemption_code: String? + + attr_accessor credits_overage_rate: Float? + + attr_accessor default_invoice_memo: String? + + attr_accessor external_plan_id: String? + + attr_accessor filter: String? + + attr_accessor initial_phase_order: Integer? + + attr_accessor invoicing_threshold: String? + + attr_accessor net_terms: Integer? + + attr_accessor per_credit_overage_amount: Float? + + attr_accessor plan_id: String? + + attr_accessor plan_version_number: Integer? + + attr_accessor price_overrides: Array[top]? + + attr_accessor remove_adjustments: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::RemoveAdjustment]? + + attr_accessor remove_prices: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::RemovePrice]? + + attr_accessor replace_adjustments: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment]? + + attr_accessor replace_prices: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice]? + + attr_accessor trial_duration_days: Integer? + + def initialize: + ( + change_option: Orb::Models::SubscriptionSchedulePlanChangeParams::change_option, + add_adjustments: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment]?, + add_prices: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice]?, + align_billing_with_plan_change_date: bool?, + auto_collection: bool?, + billing_cycle_alignment: Orb::Models::SubscriptionSchedulePlanChangeParams::billing_cycle_alignment?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAnchorConfiguration?, + change_date: Time?, + coupon_redemption_code: String?, + credits_overage_rate: Float?, + default_invoice_memo: String?, + external_plan_id: String?, + filter: String?, + initial_phase_order: Integer?, + invoicing_threshold: String?, + net_terms: Integer?, + per_credit_overage_amount: Float?, + plan_id: String?, + plan_version_number: Integer?, + price_overrides: Array[top]?, + remove_adjustments: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::RemoveAdjustment]?, + remove_prices: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::RemovePrice]?, + replace_adjustments: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment]?, + replace_prices: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice]?, + trial_duration_days: Integer?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::subscription_schedule_plan_change_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_schedule_plan_change_params + + type change_option = + :requested_date | :end_of_subscription_term | :immediate + + class ChangeOption < Orb::Enum + REQUESTED_DATE: :requested_date + END_OF_SUBSCRIPTION_TERM: :end_of_subscription_term + IMMEDIATE: :immediate + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::change_option] + end + + type add_adjustment = + { + adjustment: Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::adjustment, + end_date: Time?, + plan_phase_order: Integer?, + start_date: Time? + } + + class AddAdjustment < Orb::BaseModel + attr_accessor adjustment: Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::adjustment + + attr_accessor end_date: Time? + + attr_accessor plan_phase_order: Integer? + + attr_accessor start_date: Time? + + def initialize: + ( + adjustment: Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::adjustment, + end_date: Time?, + plan_phase_order: Integer?, + start_date: Time? + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::add_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::add_adjustment + + type adjustment = + Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewPercentageDiscount + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewUsageDiscount + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewAmountDiscount + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMinimum + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMaximum + + class Adjustment < Orb::Union + type new_percentage_discount = + { + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + percentage_discount: Float, + is_invoice_level: bool + } + + class NewPercentageDiscount < Orb::BaseModel + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor percentage_discount: Float + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + percentage_discount: Float, + is_invoice_level: bool, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::new_percentage_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::new_percentage_discount + end + + type new_usage_discount = + { + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + usage_discount: Float, + is_invoice_level: bool + } + + class NewUsageDiscount < Orb::BaseModel + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor usage_discount: Float + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + usage_discount: Float, + is_invoice_level: bool, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::new_usage_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::new_usage_discount + end + + type new_amount_discount = + { + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool + } + + class NewAmountDiscount < Orb::BaseModel + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::new_amount_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::new_amount_discount + end + + type new_minimum = + { + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: bool + } + + class NewMinimum < Orb::BaseModel + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: bool, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::new_minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::new_minimum + end + + type new_maximum = + { + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + maximum_amount: String, + is_invoice_level: bool + } + + class NewMaximum < Orb::BaseModel + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String, + is_invoice_level: bool, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::new_maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::new_maximum + end + + private def self.variants: -> [[:percentage_discount, Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewPercentageDiscount], [:usage_discount, Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewUsageDiscount], [:amount_discount, Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewAmountDiscount], [:minimum, Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMinimum], [:maximum, Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment::Adjustment::NewMaximum]] + end + end + + type add_price = + { + discounts: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount]?, + end_date: Time?, + external_price_id: String?, + maximum_amount: String?, + minimum_amount: String?, + plan_phase_order: Integer?, + price: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::price?, + price_id: String?, + start_date: Time? + } + + class AddPrice < Orb::BaseModel + attr_accessor discounts: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount]? + + attr_accessor end_date: Time? + + attr_accessor external_price_id: String? + + attr_accessor maximum_amount: String? + + attr_accessor minimum_amount: String? + + attr_accessor plan_phase_order: Integer? + + attr_accessor price: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::price? + + attr_accessor price_id: String? + + attr_accessor start_date: Time? + + def initialize: + ( + discounts: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount]?, + end_date: Time?, + external_price_id: String?, + maximum_amount: String?, + minimum_amount: String?, + plan_phase_order: Integer?, + price: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::price?, + price_id: String?, + start_date: Time? + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::add_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::add_price + + type discount = + { + discount_type: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount::discount_type, + amount_discount: String?, + percentage_discount: Float?, + usage_discount: Float? + } + + class Discount < Orb::BaseModel + attr_accessor discount_type: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount::discount_type + + attr_accessor amount_discount: String? + + attr_accessor percentage_discount: Float? + + attr_accessor usage_discount: Float? + + def initialize: + ( + discount_type: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount::discount_type, + amount_discount: String?, + percentage_discount: Float?, + usage_discount: Float? + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::discount + + type discount_type = :percentage | :usage | :amount + + class DiscountType < Orb::Enum + PERCENTAGE: :percentage + USAGE: :usage + AMOUNT: :amount + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Discount::discount_type] + end + end + + type price = + Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice + + class Price < Orb::Union + type new_subscription_unit_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::cadence, + item_id: String, + model_type: :unit, + name: String, + unit_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionUnitPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :unit + + attr_accessor name: String + + attr_accessor unit_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::cadence, + item_id: String, + name: String, + unit_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::UnitConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_unit_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_unit_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::cadence] + end + + type unit_config = { unit_amount: String } + + class UnitConfig < Orb::BaseModel + attr_accessor unit_amount: String + + def initialize: + (unit_amount: String) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::unit_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::unit_config + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_package_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::cadence, + item_id: String, + model_type: :package, + name: String, + package_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionPackagePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :package + + attr_accessor name: String + + attr_accessor package_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::cadence, + item_id: String, + name: String, + package_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::PackageConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :package + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_package_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::cadence] + end + + type package_config = + { package_amount: String, package_size: Integer } + + class PackageConfig < Orb::BaseModel + attr_accessor package_amount: String + + attr_accessor package_size: Integer + + def initialize: + (package_amount: String, package_size: Integer) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::package_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::package_config + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_matrix_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::cadence, + item_id: String, + matrix_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + model_type: :matrix, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionMatrixPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::cadence + + attr_accessor item_id: String + + attr_accessor matrix_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig + + attr_accessor model_type: :matrix + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::cadence, + item_id: String, + matrix_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :matrix + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_matrix_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_matrix_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::cadence] + end + + type matrix_config = + { + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + } + + class MatrixConfig < Orb::BaseModel + attr_accessor default_unit_amount: String + + attr_accessor dimensions: Array[String?] + + attr_accessor matrix_values: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + + def initialize: + ( + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::matrix_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::matrix_config + + type matrix_value = + { dimension_values: Array[String?], unit_amount: String } + + class MatrixValue < Orb::BaseModel + attr_accessor dimension_values: Array[String?] + + attr_accessor unit_amount: String + + def initialize: + ( + dimension_values: Array[String?], + unit_amount: String + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::matrix_value + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::matrix_value + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tiered_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::cadence, + item_id: String, + model_type: :tiered, + name: String, + tiered_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTieredPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered + + attr_accessor name: String + + attr_accessor tiered_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::cadence, + item_id: String, + name: String, + tiered_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_tiered_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_tiered_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::cadence] + end + + type tiered_config = + { + tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + } + + class TieredConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::tiered_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::tiered_config + + type tier = + { first_unit: Float, unit_amount: String, last_unit: Float? } + + class Tier < Orb::BaseModel + attr_accessor first_unit: Float + + attr_accessor unit_amount: String + + attr_accessor last_unit: Float? + + def initialize: + ( + first_unit: Float, + unit_amount: String, + last_unit: Float? + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::TieredConfig::tier + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tiered_bps_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::cadence, + item_id: String, + model_type: :tiered_bps, + name: String, + tiered_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTieredBpsPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_bps + + attr_accessor name: String + + attr_accessor tiered_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::cadence, + item_id: String, + name: String, + tiered_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered_bps + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_tiered_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_tiered_bps_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::cadence] + end + + type tiered_bps_config = + { + tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + } + + class TieredBpsConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::tiered_bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::tiered_bps_config + + type tier = + { + bps: Float, + minimum_amount: String, + maximum_amount: String?, + per_unit_maximum: String? + } + + class Tier < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor minimum_amount: String + + attr_accessor maximum_amount: String? + + attr_accessor per_unit_maximum: String? + + def initialize: + ( + bps: Float, + minimum_amount: String, + maximum_amount: String?, + per_unit_maximum: String? + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::tier + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_bps_price = + { + bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig, + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::cadence, + item_id: String, + model_type: :bps, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionBpsPrice < Orb::BaseModel + attr_accessor bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig + + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bps + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BpsConfig, + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :bps + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_bps_price + + type bps_config = { bps: Float, per_unit_maximum: String? } + + class BpsConfig < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor per_unit_maximum: String? + + def initialize: + (bps: Float, per_unit_maximum: String?) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::bps_config + end + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_bulk_bps_price = + { + bulk_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::cadence, + item_id: String, + model_type: :bulk_bps, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionBulkBpsPrice < Orb::BaseModel + attr_accessor bulk_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig + + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bulk_bps + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + bulk_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :bulk_bps + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_bulk_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_bulk_bps_price + + type bulk_bps_config = + { + tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + } + + class BulkBpsConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::bulk_bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::bulk_bps_config + + type tier = + { + bps: Float, + maximum_amount: String?, + per_unit_maximum: String? + } + + class Tier < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor maximum_amount: String? + + attr_accessor per_unit_maximum: String? + + def initialize: + ( + bps: Float, + maximum_amount: String?, + per_unit_maximum: String? + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::tier + end + end + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_bulk_price = + { + bulk_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig, + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::cadence, + item_id: String, + model_type: :bulk, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionBulkPrice < Orb::BaseModel + attr_accessor bulk_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig + + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bulk + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + bulk_config: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig, + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :bulk + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_bulk_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_bulk_price + + type bulk_config = + { + tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + } + + class BulkConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::bulk_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::bulk_config + + type tier = { unit_amount: String, maximum_units: Float? } + + class Tier < Orb::BaseModel + attr_accessor unit_amount: String + + attr_accessor maximum_units: Float? + + def initialize: + (unit_amount: String, maximum_units: Float?) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BulkConfig::tier + end + end + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_threshold_total_amount_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::cadence, + item_id: String, + model_type: :threshold_total_amount, + name: String, + threshold_total_amount_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionThresholdTotalAmountPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :threshold_total_amount + + attr_accessor name: String + + attr_accessor threshold_total_amount_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::cadence, + item_id: String, + name: String, + threshold_total_amount_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :threshold_total_amount + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_threshold_total_amount_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_threshold_total_amount_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tiered_package_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::cadence, + item_id: String, + model_type: :tiered_package, + name: String, + tiered_package_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTieredPackagePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_package + + attr_accessor name: String + + attr_accessor tiered_package_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::cadence, + item_id: String, + name: String, + tiered_package_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered_package + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_tiered_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_tiered_package_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tiered_with_minimum_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::cadence, + item_id: String, + model_type: :tiered_with_minimum, + name: String, + tiered_with_minimum_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTieredWithMinimumPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_minimum + + attr_accessor name: String + + attr_accessor tiered_with_minimum_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::cadence, + item_id: String, + name: String, + tiered_with_minimum_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered_with_minimum + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_tiered_with_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_tiered_with_minimum_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_unit_with_percent_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::cadence, + item_id: String, + model_type: :unit_with_percent, + name: String, + unit_with_percent_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionUnitWithPercentPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :unit_with_percent + + attr_accessor name: String + + attr_accessor unit_with_percent_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::cadence, + item_id: String, + name: String, + unit_with_percent_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :unit_with_percent + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_unit_with_percent_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_unit_with_percent_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_package_with_allocation_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::cadence, + item_id: String, + model_type: :package_with_allocation, + name: String, + package_with_allocation_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionPackageWithAllocationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :package_with_allocation + + attr_accessor name: String + + attr_accessor package_with_allocation_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::cadence, + item_id: String, + name: String, + package_with_allocation_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :package_with_allocation + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_package_with_allocation_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_package_with_allocation_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tier_with_proration_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTierWithProrationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_proration + + attr_accessor name: String + + attr_accessor tiered_with_proration_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::cadence, + item_id: String, + name: String, + tiered_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered_with_proration + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_tier_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_tier_with_proration_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_unit_with_proration_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::cadence, + item_id: String, + model_type: :unit_with_proration, + name: String, + unit_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionUnitWithProrationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :unit_with_proration + + attr_accessor name: String + + attr_accessor unit_with_proration_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::cadence, + item_id: String, + name: String, + unit_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :unit_with_proration + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_unit_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_unit_with_proration_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_grouped_allocation_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::cadence, + grouped_allocation_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_allocation, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionGroupedAllocationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::cadence + + attr_accessor grouped_allocation_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_allocation + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::cadence, + grouped_allocation_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :grouped_allocation + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_grouped_allocation_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_grouped_allocation_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_grouped_with_prorated_minimum_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::cadence, + grouped_with_prorated_minimum_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_with_prorated_minimum, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionGroupedWithProratedMinimumPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::cadence + + attr_accessor grouped_with_prorated_minimum_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_prorated_minimum + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::cadence, + grouped_with_prorated_minimum_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :grouped_with_prorated_minimum + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_grouped_with_prorated_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_grouped_with_prorated_minimum_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_bulk_with_proration_price = + { + bulk_with_proration_config: Hash[Symbol, top], + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::cadence, + item_id: String, + model_type: :bulk_with_proration, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionBulkWithProrationPrice < Orb::BaseModel + attr_accessor bulk_with_proration_config: Hash[Symbol, top] + + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bulk_with_proration + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + bulk_with_proration_config: Hash[Symbol, top], + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :bulk_with_proration + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_bulk_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::new_subscription_bulk_with_proration_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + private def self.variants: -> [[:unit, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitPrice], [:package, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackagePrice], [:matrix, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionMatrixPrice], [:tiered, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPrice], [:tiered_bps, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredBpsPrice], [:bps, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBpsPrice], [:bulk_bps, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkBpsPrice], [:bulk, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkPrice], [:threshold_total_amount, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionThresholdTotalAmountPrice], [:tiered_package, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredPackagePrice], [:tiered_with_minimum, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTieredWithMinimumPrice], [:unit_with_percent, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithPercentPrice], [:package_with_allocation, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionPackageWithAllocationPrice], [:tiered_with_proration, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionTierWithProrationPrice], [:unit_with_proration, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionUnitWithProrationPrice], [:grouped_allocation, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedAllocationPrice], [:grouped_with_prorated_minimum, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice], [:bulk_with_proration, Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice::Price::NewSubscriptionBulkWithProrationPrice]] + end + end + + type billing_cycle_alignment = + :unchanged | :plan_change_date | :start_of_month + + class BillingCycleAlignment < Orb::Enum + UNCHANGED: :unchanged + PLAN_CHANGE_DATE: :plan_change_date + START_OF_MONTH: :start_of_month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::billing_cycle_alignment] + end + + type billing_cycle_anchor_configuration = + { day: Integer, month: Integer?, year: Integer? } + + class BillingCycleAnchorConfiguration < Orb::BaseModel + attr_accessor day: Integer + + attr_accessor month: Integer? + + attr_accessor year: Integer? + + def initialize: + (day: Integer, month: Integer?, year: Integer?) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::billing_cycle_anchor_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::billing_cycle_anchor_configuration + end + + type remove_adjustment = { adjustment_id: String } + + class RemoveAdjustment < Orb::BaseModel + attr_accessor adjustment_id: String + + def initialize: + (adjustment_id: String) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::remove_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::remove_adjustment + end + + type remove_price = { external_price_id: String?, price_id: String? } + + class RemovePrice < Orb::BaseModel + attr_accessor external_price_id: String? + + attr_accessor price_id: String? + + def initialize: + (external_price_id: String?, price_id: String?) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::remove_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::remove_price + end + + type replace_adjustment = + { + adjustment: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::adjustment, + replaces_adjustment_id: String + } + + class ReplaceAdjustment < Orb::BaseModel + attr_accessor adjustment: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::adjustment + + attr_accessor replaces_adjustment_id: String + + def initialize: + ( + adjustment: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::adjustment, + replaces_adjustment_id: String + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::replace_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::replace_adjustment + + type adjustment = + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewUsageDiscount + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewAmountDiscount + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMinimum + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMaximum + + class Adjustment < Orb::Union + type new_percentage_discount = + { + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + percentage_discount: Float, + is_invoice_level: bool + } + + class NewPercentageDiscount < Orb::BaseModel + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor percentage_discount: Float + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + percentage_discount: Float, + is_invoice_level: bool, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::new_percentage_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::new_percentage_discount + end + + type new_usage_discount = + { + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + usage_discount: Float, + is_invoice_level: bool + } + + class NewUsageDiscount < Orb::BaseModel + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor usage_discount: Float + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + usage_discount: Float, + is_invoice_level: bool, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::new_usage_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::new_usage_discount + end + + type new_amount_discount = + { + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool + } + + class NewAmountDiscount < Orb::BaseModel + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::new_amount_discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::new_amount_discount + end + + type new_minimum = + { + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: bool + } + + class NewMinimum < Orb::BaseModel + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + item_id: String, + minimum_amount: String, + is_invoice_level: bool, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::new_minimum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::new_minimum + end + + type new_maximum = + { + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + maximum_amount: String, + is_invoice_level: bool + } + + class NewMaximum < Orb::BaseModel + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor maximum_amount: String + + attr_reader is_invoice_level: bool? + + def is_invoice_level=: (bool) -> void + + def initialize: + ( + applies_to_price_ids: Array[String], + maximum_amount: String, + is_invoice_level: bool, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::new_maximum + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::new_maximum + end + + private def self.variants: -> [[:percentage_discount, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewPercentageDiscount], [:usage_discount, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewUsageDiscount], [:amount_discount, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewAmountDiscount], [:minimum, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMinimum], [:maximum, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment::Adjustment::NewMaximum]] + end + end + + type replace_price = + { + replaces_price_id: String, + discounts: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount]?, + external_price_id: String?, + fixed_price_quantity: Float?, + maximum_amount: String?, + minimum_amount: String?, + price: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::price?, + price_id: String? + } + + class ReplacePrice < Orb::BaseModel + attr_accessor replaces_price_id: String + + attr_accessor discounts: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount]? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor maximum_amount: String? + + attr_accessor minimum_amount: String? + + attr_accessor price: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::price? + + attr_accessor price_id: String? + + def initialize: + ( + replaces_price_id: String, + discounts: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount]?, + external_price_id: String?, + fixed_price_quantity: Float?, + maximum_amount: String?, + minimum_amount: String?, + price: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::price?, + price_id: String? + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::replace_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::replace_price + + type discount = + { + discount_type: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount::discount_type, + amount_discount: String?, + percentage_discount: Float?, + usage_discount: Float? + } + + class Discount < Orb::BaseModel + attr_accessor discount_type: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount::discount_type + + attr_accessor amount_discount: String? + + attr_accessor percentage_discount: Float? + + attr_accessor usage_discount: Float? + + def initialize: + ( + discount_type: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount::discount_type, + amount_discount: String?, + percentage_discount: Float?, + usage_discount: Float? + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::discount + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::discount + + type discount_type = :percentage | :usage | :amount + + class DiscountType < Orb::Enum + PERCENTAGE: :percentage + USAGE: :usage + AMOUNT: :amount + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Discount::discount_type] + end + end + + type price = + Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice + | Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice + + class Price < Orb::Union + type new_subscription_unit_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::cadence, + item_id: String, + model_type: :unit, + name: String, + unit_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionUnitPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :unit + + attr_accessor name: String + + attr_accessor unit_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::cadence, + item_id: String, + name: String, + unit_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::UnitConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_unit_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_unit_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::cadence] + end + + type unit_config = { unit_amount: String } + + class UnitConfig < Orb::BaseModel + attr_accessor unit_amount: String + + def initialize: + (unit_amount: String) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::unit_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::unit_config + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_package_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::cadence, + item_id: String, + model_type: :package, + name: String, + package_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionPackagePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :package + + attr_accessor name: String + + attr_accessor package_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::cadence, + item_id: String, + name: String, + package_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::PackageConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :package + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_package_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::cadence] + end + + type package_config = + { package_amount: String, package_size: Integer } + + class PackageConfig < Orb::BaseModel + attr_accessor package_amount: String + + attr_accessor package_size: Integer + + def initialize: + (package_amount: String, package_size: Integer) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::package_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::package_config + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_matrix_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::cadence, + item_id: String, + matrix_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + model_type: :matrix, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionMatrixPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::cadence + + attr_accessor item_id: String + + attr_accessor matrix_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig + + attr_accessor model_type: :matrix + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::cadence, + item_id: String, + matrix_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :matrix + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_matrix_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_matrix_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::cadence] + end + + type matrix_config = + { + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + } + + class MatrixConfig < Orb::BaseModel + attr_accessor default_unit_amount: String + + attr_accessor dimensions: Array[String?] + + attr_accessor matrix_values: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + + def initialize: + ( + default_unit_amount: String, + dimensions: Array[String?], + matrix_values: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::MatrixValue] + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::matrix_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::matrix_config + + type matrix_value = + { dimension_values: Array[String?], unit_amount: String } + + class MatrixValue < Orb::BaseModel + attr_accessor dimension_values: Array[String?] + + attr_accessor unit_amount: String + + def initialize: + ( + dimension_values: Array[String?], + unit_amount: String + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::matrix_value + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::MatrixConfig::matrix_value + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tiered_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::cadence, + item_id: String, + model_type: :tiered, + name: String, + tiered_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTieredPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered + + attr_accessor name: String + + attr_accessor tiered_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::cadence, + item_id: String, + name: String, + tiered_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_tiered_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_tiered_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::cadence] + end + + type tiered_config = + { + tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + } + + class TieredConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::tiered_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::tiered_config + + type tier = + { first_unit: Float, unit_amount: String, last_unit: Float? } + + class Tier < Orb::BaseModel + attr_accessor first_unit: Float + + attr_accessor unit_amount: String + + attr_accessor last_unit: Float? + + def initialize: + ( + first_unit: Float, + unit_amount: String, + last_unit: Float? + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::TieredConfig::tier + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tiered_bps_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::cadence, + item_id: String, + model_type: :tiered_bps, + name: String, + tiered_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTieredBpsPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_bps + + attr_accessor name: String + + attr_accessor tiered_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::cadence, + item_id: String, + name: String, + tiered_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered_bps + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_tiered_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_tiered_bps_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::cadence] + end + + type tiered_bps_config = + { + tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + } + + class TieredBpsConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::tiered_bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::tiered_bps_config + + type tier = + { + bps: Float, + minimum_amount: String, + maximum_amount: String?, + per_unit_maximum: String? + } + + class Tier < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor minimum_amount: String + + attr_accessor maximum_amount: String? + + attr_accessor per_unit_maximum: String? + + def initialize: + ( + bps: Float, + minimum_amount: String, + maximum_amount: String?, + per_unit_maximum: String? + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::TieredBpsConfig::tier + end + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_bps_price = + { + bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig, + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::cadence, + item_id: String, + model_type: :bps, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionBpsPrice < Orb::BaseModel + attr_accessor bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig + + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bps + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BpsConfig, + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :bps + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_bps_price + + type bps_config = { bps: Float, per_unit_maximum: String? } + + class BpsConfig < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor per_unit_maximum: String? + + def initialize: + (bps: Float, per_unit_maximum: String?) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::bps_config + end + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_bulk_bps_price = + { + bulk_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::cadence, + item_id: String, + model_type: :bulk_bps, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionBulkBpsPrice < Orb::BaseModel + attr_accessor bulk_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig + + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bulk_bps + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + bulk_bps_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig, + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :bulk_bps + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_bulk_bps_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_bulk_bps_price + + type bulk_bps_config = + { + tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + } + + class BulkBpsConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::bulk_bps_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::bulk_bps_config + + type tier = + { + bps: Float, + maximum_amount: String?, + per_unit_maximum: String? + } + + class Tier < Orb::BaseModel + attr_accessor bps: Float + + attr_accessor maximum_amount: String? + + attr_accessor per_unit_maximum: String? + + def initialize: + ( + bps: Float, + maximum_amount: String?, + per_unit_maximum: String? + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BulkBpsConfig::tier + end + end + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_bulk_price = + { + bulk_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig, + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::cadence, + item_id: String, + model_type: :bulk, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionBulkPrice < Orb::BaseModel + attr_accessor bulk_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig + + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bulk + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + bulk_config: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig, + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :bulk + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_bulk_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_bulk_price + + type bulk_config = + { + tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + } + + class BulkConfig < Orb::BaseModel + attr_accessor tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + + def initialize: + ( + tiers: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::Tier] + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::bulk_config + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::bulk_config + + type tier = { unit_amount: String, maximum_units: Float? } + + class Tier < Orb::BaseModel + attr_accessor unit_amount: String + + attr_accessor maximum_units: Float? + + def initialize: + (unit_amount: String, maximum_units: Float?) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::tier + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BulkConfig::tier + end + end + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_threshold_total_amount_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::cadence, + item_id: String, + model_type: :threshold_total_amount, + name: String, + threshold_total_amount_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionThresholdTotalAmountPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :threshold_total_amount + + attr_accessor name: String + + attr_accessor threshold_total_amount_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::cadence, + item_id: String, + name: String, + threshold_total_amount_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :threshold_total_amount + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_threshold_total_amount_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_threshold_total_amount_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tiered_package_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::cadence, + item_id: String, + model_type: :tiered_package, + name: String, + tiered_package_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTieredPackagePrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_package + + attr_accessor name: String + + attr_accessor tiered_package_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::cadence, + item_id: String, + name: String, + tiered_package_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered_package + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_tiered_package_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_tiered_package_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tiered_with_minimum_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::cadence, + item_id: String, + model_type: :tiered_with_minimum, + name: String, + tiered_with_minimum_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTieredWithMinimumPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_minimum + + attr_accessor name: String + + attr_accessor tiered_with_minimum_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::cadence, + item_id: String, + name: String, + tiered_with_minimum_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered_with_minimum + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_tiered_with_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_tiered_with_minimum_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_unit_with_percent_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::cadence, + item_id: String, + model_type: :unit_with_percent, + name: String, + unit_with_percent_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionUnitWithPercentPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :unit_with_percent + + attr_accessor name: String + + attr_accessor unit_with_percent_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::cadence, + item_id: String, + name: String, + unit_with_percent_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :unit_with_percent + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_unit_with_percent_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_unit_with_percent_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_package_with_allocation_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::cadence, + item_id: String, + model_type: :package_with_allocation, + name: String, + package_with_allocation_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionPackageWithAllocationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :package_with_allocation + + attr_accessor name: String + + attr_accessor package_with_allocation_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::cadence, + item_id: String, + name: String, + package_with_allocation_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :package_with_allocation + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_package_with_allocation_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_package_with_allocation_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_tier_with_proration_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::cadence, + item_id: String, + model_type: :tiered_with_proration, + name: String, + tiered_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionTierWithProrationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :tiered_with_proration + + attr_accessor name: String + + attr_accessor tiered_with_proration_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::cadence, + item_id: String, + name: String, + tiered_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :tiered_with_proration + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_tier_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_tier_with_proration_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_unit_with_proration_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::cadence, + item_id: String, + model_type: :unit_with_proration, + name: String, + unit_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionUnitWithProrationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :unit_with_proration + + attr_accessor name: String + + attr_accessor unit_with_proration_config: Hash[Symbol, top] + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::cadence, + item_id: String, + name: String, + unit_with_proration_config: Hash[Symbol, top], + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :unit_with_proration + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_unit_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_unit_with_proration_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_grouped_allocation_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::cadence, + grouped_allocation_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_allocation, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionGroupedAllocationPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::cadence + + attr_accessor grouped_allocation_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_allocation + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::cadence, + grouped_allocation_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :grouped_allocation + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_grouped_allocation_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_grouped_allocation_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_grouped_with_prorated_minimum_price = + { + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::cadence, + grouped_with_prorated_minimum_config: Hash[Symbol, top], + item_id: String, + model_type: :grouped_with_prorated_minimum, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionGroupedWithProratedMinimumPrice < Orb::BaseModel + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::cadence + + attr_accessor grouped_with_prorated_minimum_config: Hash[Symbol, top] + + attr_accessor item_id: String + + attr_accessor model_type: :grouped_with_prorated_minimum + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::cadence, + grouped_with_prorated_minimum_config: Hash[Symbol, top], + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :grouped_with_prorated_minimum + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_grouped_with_prorated_minimum_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_grouped_with_prorated_minimum_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + type new_subscription_bulk_with_proration_price = + { + bulk_with_proration_config: Hash[Symbol, top], + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::cadence, + item_id: String, + model_type: :bulk_with_proration, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String? + } + + class NewSubscriptionBulkWithProrationPrice < Orb::BaseModel + attr_accessor bulk_with_proration_config: Hash[Symbol, top] + + attr_accessor cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::cadence + + attr_accessor item_id: String + + attr_accessor model_type: :bulk_with_proration + + attr_accessor name: String + + attr_accessor billable_metric_id: String? + + attr_accessor billed_in_advance: bool? + + attr_accessor billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration? + + attr_accessor conversion_rate: Float? + + attr_accessor currency: String? + + attr_accessor external_price_id: String? + + attr_accessor fixed_price_quantity: Float? + + attr_accessor invoice_grouping_key: String? + + attr_accessor invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor reference_id: String? + + def initialize: + ( + bulk_with_proration_config: Hash[Symbol, top], + cadence: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::cadence, + item_id: String, + name: String, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration?, + conversion_rate: Float?, + currency: String?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + reference_id: String?, + model_type: :bulk_with_proration + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_bulk_with_proration_price + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::new_subscription_bulk_with_proration_price + + type cadence = + :annual + | :semi_annual + | :monthly + | :quarterly + | :one_time + | :custom + + class Cadence < Orb::Enum + ANNUAL: :annual + SEMI_ANNUAL: :semi_annual + MONTHLY: :monthly + QUARTERLY: :quarterly + ONE_TIME: :one_time + CUSTOM: :custom + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::cadence] + end + + type billing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + } + + class BillingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::billing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::billing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::BillingCycleConfiguration::duration_unit] + end + end + + type invoicing_cycle_configuration = + { + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + } + + class InvoicingCycleConfiguration < Orb::BaseModel + attr_accessor duration: Integer + + attr_accessor duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + + def initialize: + ( + duration: Integer, + duration_unit: Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::invoicing_cycle_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::invoicing_cycle_configuration + + type duration_unit = :day | :month + + class DurationUnit < Orb::Enum + DAY: :day + MONTH: :month + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice::InvoicingCycleConfiguration::duration_unit] + end + end + end + + private def self.variants: -> [[:unit, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitPrice], [:package, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackagePrice], [:matrix, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionMatrixPrice], [:tiered, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPrice], [:tiered_bps, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredBpsPrice], [:bps, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBpsPrice], [:bulk_bps, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkBpsPrice], [:bulk, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkPrice], [:threshold_total_amount, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionThresholdTotalAmountPrice], [:tiered_package, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredPackagePrice], [:tiered_with_minimum, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTieredWithMinimumPrice], [:unit_with_percent, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithPercentPrice], [:package_with_allocation, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionPackageWithAllocationPrice], [:tiered_with_proration, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionTierWithProrationPrice], [:unit_with_proration, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionUnitWithProrationPrice], [:grouped_allocation, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedAllocationPrice], [:grouped_with_prorated_minimum, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionGroupedWithProratedMinimumPrice], [:bulk_with_proration, Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice::Price::NewSubscriptionBulkWithProrationPrice]] + end + end + end + end +end diff --git a/sig/orb/models/subscription_schedule_plan_change_response.rbs b/sig/orb/models/subscription_schedule_plan_change_response.rbs new file mode 100644 index 00000000..2cdac9c6 --- /dev/null +++ b/sig/orb/models/subscription_schedule_plan_change_response.rbs @@ -0,0 +1,751 @@ +module Orb + module Models + type subscription_schedule_plan_change_response = + { + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionSchedulePlanChangeResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionSchedulePlanChangeResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionSchedulePlanChangeResponse::status, + trial_info: Orb::Models::SubscriptionSchedulePlanChangeResponse::TrialInfo + } + + class SubscriptionSchedulePlanChangeResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor active_plan_phase_order: Integer? + + attr_accessor adjustment_intervals: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval] + + attr_accessor auto_collection: bool? + + attr_accessor billing_cycle_anchor_configuration: Orb::Models::SubscriptionSchedulePlanChangeResponse::BillingCycleAnchorConfiguration + + attr_accessor billing_cycle_day: Integer + + attr_accessor created_at: Time + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor customer: Orb::Models::Customer + + attr_accessor default_invoice_memo: String? + + attr_accessor discount_intervals: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::discount_interval] + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::FixedFeeQuantitySchedule] + + attr_accessor invoicing_threshold: String? + + attr_accessor maximum_intervals: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::MaximumInterval] + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum_intervals: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::MinimumInterval] + + attr_accessor net_terms: Integer + + attr_accessor plan: Orb::Models::Plan + + attr_accessor price_intervals: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval] + + attr_accessor redeemed_coupon: Orb::Models::SubscriptionSchedulePlanChangeResponse::RedeemedCoupon? + + attr_accessor start_date: Time + + attr_accessor status: Orb::Models::SubscriptionSchedulePlanChangeResponse::status + + attr_accessor trial_info: Orb::Models::SubscriptionSchedulePlanChangeResponse::TrialInfo + + def initialize: + ( + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionSchedulePlanChangeResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionSchedulePlanChangeResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionSchedulePlanChangeResponse::status, + trial_info: Orb::Models::SubscriptionSchedulePlanChangeResponse::TrialInfo + ) -> void + | ( + ?Orb::Models::subscription_schedule_plan_change_response + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_schedule_plan_change_response + + type adjustment_interval = + { + id: String, + adjustment: Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + } + + class AdjustmentInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment: Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::adjustment + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + adjustment: Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::adjustment_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::adjustment_interval + + type adjustment = + Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + | Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + | Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + | Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + | Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + + class Adjustment < Orb::Union + type amount_discount_adjustment = + { + id: String, + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String? + } + + class AmountDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + end + + type percentage_discount_adjustment = + { + id: String, + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String? + } + + class PercentageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor percentage_discount: Float + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + end + + type usage_discount_adjustment = + { + id: String, + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float + } + + class UsageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + attr_accessor usage_discount: Float + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + end + + type minimum_adjustment = + { + id: String, + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MinimumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::minimum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::minimum_adjustment + end + + type maximum_adjustment = + { + id: String, + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MaximumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor maximum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::maximum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::maximum_adjustment + end + + private def self.variants: -> [[:amount_discount, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment], [:percentage_discount, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment], [:usage_discount, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment], [:minimum, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MinimumAdjustment], [:maximum, Orb::Models::SubscriptionSchedulePlanChangeResponse::AdjustmentInterval::Adjustment::MaximumAdjustment]] + end + end + + type billing_cycle_anchor_configuration = + { day: Integer, month: Integer?, year: Integer? } + + class BillingCycleAnchorConfiguration < Orb::BaseModel + attr_accessor day: Integer + + attr_accessor month: Integer? + + attr_accessor year: Integer? + + def initialize: + (day: Integer, month: Integer?, year: Integer?) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::billing_cycle_anchor_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::billing_cycle_anchor_configuration + end + + type discount_interval = + Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::AmountDiscountInterval + | Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::PercentageDiscountInterval + | Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::UsageDiscountInterval + + class DiscountInterval < Orb::Union + type amount_discount_interval = + { + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :amount, + end_date: Time?, + start_date: Time + } + + class AmountDiscountInterval < Orb::BaseModel + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :amount + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + discount_type: :amount + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::amount_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::amount_discount_interval + end + + type percentage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :percentage, + end_date: Time?, + percentage_discount: Float, + start_date: Time + } + + class PercentageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :percentage + + attr_accessor end_date: Time? + + attr_accessor percentage_discount: Float + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + percentage_discount: Float, + start_date: Time, + discount_type: :percentage + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::percentage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::percentage_discount_interval + end + + type usage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :usage, + end_date: Time?, + start_date: Time, + usage_discount: Float + } + + class UsageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :usage + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + attr_accessor usage_discount: Float + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + usage_discount: Float, + discount_type: :usage + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::usage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::usage_discount_interval + end + + private def self.variants: -> [[:amount, Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::AmountDiscountInterval], [:percentage, Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::PercentageDiscountInterval], [:usage, Orb::Models::SubscriptionSchedulePlanChangeResponse::DiscountInterval::UsageDiscountInterval]] + end + + type fixed_fee_quantity_schedule = + { end_date: Time?, price_id: String, quantity: Float, start_date: Time } + + class FixedFeeQuantitySchedule < Orb::BaseModel + attr_accessor end_date: Time? + + attr_accessor price_id: String + + attr_accessor quantity: Float + + attr_accessor start_date: Time + + def initialize: + ( + end_date: Time?, + price_id: String, + quantity: Float, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::fixed_fee_quantity_schedule + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::fixed_fee_quantity_schedule + end + + type maximum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + } + + class MaximumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor maximum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::maximum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::maximum_interval + end + + type minimum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + } + + class MinimumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor minimum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::minimum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::minimum_interval + end + + type price_interval = + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + } + + class PriceInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor billing_cycle_day: Integer + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval::FixedFeeQuantityTransition]? + + attr_accessor price: Orb::Models::price + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::price_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::price_interval + + type fixed_fee_quantity_transition = + { effective_date: Time, price_id: String, quantity: Integer } + + class FixedFeeQuantityTransition < Orb::BaseModel + attr_accessor effective_date: Time + + attr_accessor price_id: String + + attr_accessor quantity: Integer + + def initialize: + (effective_date: Time, price_id: String, quantity: Integer) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval::fixed_fee_quantity_transition + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::PriceInterval::fixed_fee_quantity_transition + end + end + + type redeemed_coupon = + { coupon_id: String, end_date: Time?, start_date: Time } + + class RedeemedCoupon < Orb::BaseModel + attr_accessor coupon_id: String + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + (coupon_id: String, end_date: Time?, start_date: Time) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::redeemed_coupon + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::redeemed_coupon + end + + type status = :active | :ended | :upcoming + + class Status < Orb::Enum + ACTIVE: :active + ENDED: :ended + UPCOMING: :upcoming + + def self.values: -> Array[Orb::Models::SubscriptionSchedulePlanChangeResponse::status] + end + + type trial_info = { end_date: Time? } + + class TrialInfo < Orb::BaseModel + attr_accessor end_date: Time? + + def initialize: + (end_date: Time?) -> void + | ( + ?Orb::Models::SubscriptionSchedulePlanChangeResponse::trial_info + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionSchedulePlanChangeResponse::trial_info + end + end + end +end diff --git a/sig/orb/models/subscription_trigger_phase_params.rbs b/sig/orb/models/subscription_trigger_phase_params.rbs new file mode 100644 index 00000000..ca960143 --- /dev/null +++ b/sig/orb/models/subscription_trigger_phase_params.rbs @@ -0,0 +1,21 @@ +module Orb + module Models + type subscription_trigger_phase_params = + { effective_date: Date? } & Orb::request_parameters + + class SubscriptionTriggerPhaseParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor effective_date: Date? + + def initialize: + (effective_date: Date?, request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::subscription_trigger_phase_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_trigger_phase_params + end + end +end diff --git a/sig/orb/models/subscription_trigger_phase_response.rbs b/sig/orb/models/subscription_trigger_phase_response.rbs new file mode 100644 index 00000000..c6ae69ce --- /dev/null +++ b/sig/orb/models/subscription_trigger_phase_response.rbs @@ -0,0 +1,751 @@ +module Orb + module Models + type subscription_trigger_phase_response = + { + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionTriggerPhaseResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionTriggerPhaseResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionTriggerPhaseResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionTriggerPhaseResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionTriggerPhaseResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionTriggerPhaseResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionTriggerPhaseResponse::status, + trial_info: Orb::Models::SubscriptionTriggerPhaseResponse::TrialInfo + } + + class SubscriptionTriggerPhaseResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor active_plan_phase_order: Integer? + + attr_accessor adjustment_intervals: Array[Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval] + + attr_accessor auto_collection: bool? + + attr_accessor billing_cycle_anchor_configuration: Orb::Models::SubscriptionTriggerPhaseResponse::BillingCycleAnchorConfiguration + + attr_accessor billing_cycle_day: Integer + + attr_accessor created_at: Time + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor customer: Orb::Models::Customer + + attr_accessor default_invoice_memo: String? + + attr_accessor discount_intervals: Array[Orb::Models::SubscriptionTriggerPhaseResponse::discount_interval] + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionTriggerPhaseResponse::FixedFeeQuantitySchedule] + + attr_accessor invoicing_threshold: String? + + attr_accessor maximum_intervals: Array[Orb::Models::SubscriptionTriggerPhaseResponse::MaximumInterval] + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum_intervals: Array[Orb::Models::SubscriptionTriggerPhaseResponse::MinimumInterval] + + attr_accessor net_terms: Integer + + attr_accessor plan: Orb::Models::Plan + + attr_accessor price_intervals: Array[Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval] + + attr_accessor redeemed_coupon: Orb::Models::SubscriptionTriggerPhaseResponse::RedeemedCoupon? + + attr_accessor start_date: Time + + attr_accessor status: Orb::Models::SubscriptionTriggerPhaseResponse::status + + attr_accessor trial_info: Orb::Models::SubscriptionTriggerPhaseResponse::TrialInfo + + def initialize: + ( + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionTriggerPhaseResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionTriggerPhaseResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionTriggerPhaseResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionTriggerPhaseResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionTriggerPhaseResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionTriggerPhaseResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionTriggerPhaseResponse::status, + trial_info: Orb::Models::SubscriptionTriggerPhaseResponse::TrialInfo + ) -> void + | ( + ?Orb::Models::subscription_trigger_phase_response + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_trigger_phase_response + + type adjustment_interval = + { + id: String, + adjustment: Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + } + + class AdjustmentInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment: Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::adjustment + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + adjustment: Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::adjustment_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::adjustment_interval + + type adjustment = + Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + | Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + | Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + | Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + | Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + + class Adjustment < Orb::Union + type amount_discount_adjustment = + { + id: String, + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String? + } + + class AmountDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + end + + type percentage_discount_adjustment = + { + id: String, + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String? + } + + class PercentageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor percentage_discount: Float + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + end + + type usage_discount_adjustment = + { + id: String, + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float + } + + class UsageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + attr_accessor usage_discount: Float + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + end + + type minimum_adjustment = + { + id: String, + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MinimumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::minimum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::minimum_adjustment + end + + type maximum_adjustment = + { + id: String, + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MaximumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor maximum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::maximum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::maximum_adjustment + end + + private def self.variants: -> [[:amount_discount, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment], [:percentage_discount, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment], [:usage_discount, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment], [:minimum, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MinimumAdjustment], [:maximum, Orb::Models::SubscriptionTriggerPhaseResponse::AdjustmentInterval::Adjustment::MaximumAdjustment]] + end + end + + type billing_cycle_anchor_configuration = + { day: Integer, month: Integer?, year: Integer? } + + class BillingCycleAnchorConfiguration < Orb::BaseModel + attr_accessor day: Integer + + attr_accessor month: Integer? + + attr_accessor year: Integer? + + def initialize: + (day: Integer, month: Integer?, year: Integer?) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::billing_cycle_anchor_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::billing_cycle_anchor_configuration + end + + type discount_interval = + Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::AmountDiscountInterval + | Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::PercentageDiscountInterval + | Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::UsageDiscountInterval + + class DiscountInterval < Orb::Union + type amount_discount_interval = + { + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :amount, + end_date: Time?, + start_date: Time + } + + class AmountDiscountInterval < Orb::BaseModel + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :amount + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + discount_type: :amount + ) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::amount_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::amount_discount_interval + end + + type percentage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :percentage, + end_date: Time?, + percentage_discount: Float, + start_date: Time + } + + class PercentageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :percentage + + attr_accessor end_date: Time? + + attr_accessor percentage_discount: Float + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + percentage_discount: Float, + start_date: Time, + discount_type: :percentage + ) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::percentage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::percentage_discount_interval + end + + type usage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :usage, + end_date: Time?, + start_date: Time, + usage_discount: Float + } + + class UsageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :usage + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + attr_accessor usage_discount: Float + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + usage_discount: Float, + discount_type: :usage + ) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::usage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::usage_discount_interval + end + + private def self.variants: -> [[:amount, Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::AmountDiscountInterval], [:percentage, Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::PercentageDiscountInterval], [:usage, Orb::Models::SubscriptionTriggerPhaseResponse::DiscountInterval::UsageDiscountInterval]] + end + + type fixed_fee_quantity_schedule = + { end_date: Time?, price_id: String, quantity: Float, start_date: Time } + + class FixedFeeQuantitySchedule < Orb::BaseModel + attr_accessor end_date: Time? + + attr_accessor price_id: String + + attr_accessor quantity: Float + + attr_accessor start_date: Time + + def initialize: + ( + end_date: Time?, + price_id: String, + quantity: Float, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::fixed_fee_quantity_schedule + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::fixed_fee_quantity_schedule + end + + type maximum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + } + + class MaximumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor maximum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::maximum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::maximum_interval + end + + type minimum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + } + + class MinimumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor minimum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::minimum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::minimum_interval + end + + type price_interval = + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + } + + class PriceInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor billing_cycle_day: Integer + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval::FixedFeeQuantityTransition]? + + attr_accessor price: Orb::Models::price + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::price_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::price_interval + + type fixed_fee_quantity_transition = + { effective_date: Time, price_id: String, quantity: Integer } + + class FixedFeeQuantityTransition < Orb::BaseModel + attr_accessor effective_date: Time + + attr_accessor price_id: String + + attr_accessor quantity: Integer + + def initialize: + (effective_date: Time, price_id: String, quantity: Integer) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval::fixed_fee_quantity_transition + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::PriceInterval::fixed_fee_quantity_transition + end + end + + type redeemed_coupon = + { coupon_id: String, end_date: Time?, start_date: Time } + + class RedeemedCoupon < Orb::BaseModel + attr_accessor coupon_id: String + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + (coupon_id: String, end_date: Time?, start_date: Time) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::redeemed_coupon + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::redeemed_coupon + end + + type status = :active | :ended | :upcoming + + class Status < Orb::Enum + ACTIVE: :active + ENDED: :ended + UPCOMING: :upcoming + + def self.values: -> Array[Orb::Models::SubscriptionTriggerPhaseResponse::status] + end + + type trial_info = { end_date: Time? } + + class TrialInfo < Orb::BaseModel + attr_accessor end_date: Time? + + def initialize: + (end_date: Time?) -> void + | ( + ?Orb::Models::SubscriptionTriggerPhaseResponse::trial_info + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionTriggerPhaseResponse::trial_info + end + end + end +end diff --git a/sig/orb/models/subscription_unschedule_cancellation_params.rbs b/sig/orb/models/subscription_unschedule_cancellation_params.rbs new file mode 100644 index 00000000..a6f22d87 --- /dev/null +++ b/sig/orb/models/subscription_unschedule_cancellation_params.rbs @@ -0,0 +1,20 @@ +module Orb + module Models + type subscription_unschedule_cancellation_params = + { } & Orb::request_parameters + + class SubscriptionUnscheduleCancellationParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::subscription_unschedule_cancellation_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_unschedule_cancellation_params + end + end +end diff --git a/sig/orb/models/subscription_unschedule_cancellation_response.rbs b/sig/orb/models/subscription_unschedule_cancellation_response.rbs new file mode 100644 index 00000000..c03493ac --- /dev/null +++ b/sig/orb/models/subscription_unschedule_cancellation_response.rbs @@ -0,0 +1,751 @@ +module Orb + module Models + type subscription_unschedule_cancellation_response = + { + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnscheduleCancellationResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionUnscheduleCancellationResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionUnscheduleCancellationResponse::status, + trial_info: Orb::Models::SubscriptionUnscheduleCancellationResponse::TrialInfo + } + + class SubscriptionUnscheduleCancellationResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor active_plan_phase_order: Integer? + + attr_accessor adjustment_intervals: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval] + + attr_accessor auto_collection: bool? + + attr_accessor billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnscheduleCancellationResponse::BillingCycleAnchorConfiguration + + attr_accessor billing_cycle_day: Integer + + attr_accessor created_at: Time + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor customer: Orb::Models::Customer + + attr_accessor default_invoice_memo: String? + + attr_accessor discount_intervals: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::discount_interval] + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::FixedFeeQuantitySchedule] + + attr_accessor invoicing_threshold: String? + + attr_accessor maximum_intervals: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::MaximumInterval] + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum_intervals: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::MinimumInterval] + + attr_accessor net_terms: Integer + + attr_accessor plan: Orb::Models::Plan + + attr_accessor price_intervals: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval] + + attr_accessor redeemed_coupon: Orb::Models::SubscriptionUnscheduleCancellationResponse::RedeemedCoupon? + + attr_accessor start_date: Time + + attr_accessor status: Orb::Models::SubscriptionUnscheduleCancellationResponse::status + + attr_accessor trial_info: Orb::Models::SubscriptionUnscheduleCancellationResponse::TrialInfo + + def initialize: + ( + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnscheduleCancellationResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionUnscheduleCancellationResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionUnscheduleCancellationResponse::status, + trial_info: Orb::Models::SubscriptionUnscheduleCancellationResponse::TrialInfo + ) -> void + | ( + ?Orb::Models::subscription_unschedule_cancellation_response + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_unschedule_cancellation_response + + type adjustment_interval = + { + id: String, + adjustment: Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + } + + class AdjustmentInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment: Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::adjustment + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + adjustment: Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::adjustment_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::adjustment_interval + + type adjustment = + Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + | Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + | Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + | Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + | Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + + class Adjustment < Orb::Union + type amount_discount_adjustment = + { + id: String, + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String? + } + + class AmountDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + end + + type percentage_discount_adjustment = + { + id: String, + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String? + } + + class PercentageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor percentage_discount: Float + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + end + + type usage_discount_adjustment = + { + id: String, + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float + } + + class UsageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + attr_accessor usage_discount: Float + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + end + + type minimum_adjustment = + { + id: String, + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MinimumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::minimum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::minimum_adjustment + end + + type maximum_adjustment = + { + id: String, + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MaximumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor maximum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::maximum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::maximum_adjustment + end + + private def self.variants: -> [[:amount_discount, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment], [:percentage_discount, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment], [:usage_discount, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment], [:minimum, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MinimumAdjustment], [:maximum, Orb::Models::SubscriptionUnscheduleCancellationResponse::AdjustmentInterval::Adjustment::MaximumAdjustment]] + end + end + + type billing_cycle_anchor_configuration = + { day: Integer, month: Integer?, year: Integer? } + + class BillingCycleAnchorConfiguration < Orb::BaseModel + attr_accessor day: Integer + + attr_accessor month: Integer? + + attr_accessor year: Integer? + + def initialize: + (day: Integer, month: Integer?, year: Integer?) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::billing_cycle_anchor_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::billing_cycle_anchor_configuration + end + + type discount_interval = + Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::AmountDiscountInterval + | Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::PercentageDiscountInterval + | Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::UsageDiscountInterval + + class DiscountInterval < Orb::Union + type amount_discount_interval = + { + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :amount, + end_date: Time?, + start_date: Time + } + + class AmountDiscountInterval < Orb::BaseModel + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :amount + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + discount_type: :amount + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::amount_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::amount_discount_interval + end + + type percentage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :percentage, + end_date: Time?, + percentage_discount: Float, + start_date: Time + } + + class PercentageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :percentage + + attr_accessor end_date: Time? + + attr_accessor percentage_discount: Float + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + percentage_discount: Float, + start_date: Time, + discount_type: :percentage + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::percentage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::percentage_discount_interval + end + + type usage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :usage, + end_date: Time?, + start_date: Time, + usage_discount: Float + } + + class UsageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :usage + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + attr_accessor usage_discount: Float + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + usage_discount: Float, + discount_type: :usage + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::usage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::usage_discount_interval + end + + private def self.variants: -> [[:amount, Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::AmountDiscountInterval], [:percentage, Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::PercentageDiscountInterval], [:usage, Orb::Models::SubscriptionUnscheduleCancellationResponse::DiscountInterval::UsageDiscountInterval]] + end + + type fixed_fee_quantity_schedule = + { end_date: Time?, price_id: String, quantity: Float, start_date: Time } + + class FixedFeeQuantitySchedule < Orb::BaseModel + attr_accessor end_date: Time? + + attr_accessor price_id: String + + attr_accessor quantity: Float + + attr_accessor start_date: Time + + def initialize: + ( + end_date: Time?, + price_id: String, + quantity: Float, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::fixed_fee_quantity_schedule + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::fixed_fee_quantity_schedule + end + + type maximum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + } + + class MaximumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor maximum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::maximum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::maximum_interval + end + + type minimum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + } + + class MinimumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor minimum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::minimum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::minimum_interval + end + + type price_interval = + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + } + + class PriceInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor billing_cycle_day: Integer + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval::FixedFeeQuantityTransition]? + + attr_accessor price: Orb::Models::price + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::price_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::price_interval + + type fixed_fee_quantity_transition = + { effective_date: Time, price_id: String, quantity: Integer } + + class FixedFeeQuantityTransition < Orb::BaseModel + attr_accessor effective_date: Time + + attr_accessor price_id: String + + attr_accessor quantity: Integer + + def initialize: + (effective_date: Time, price_id: String, quantity: Integer) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval::fixed_fee_quantity_transition + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::PriceInterval::fixed_fee_quantity_transition + end + end + + type redeemed_coupon = + { coupon_id: String, end_date: Time?, start_date: Time } + + class RedeemedCoupon < Orb::BaseModel + attr_accessor coupon_id: String + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + (coupon_id: String, end_date: Time?, start_date: Time) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::redeemed_coupon + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::redeemed_coupon + end + + type status = :active | :ended | :upcoming + + class Status < Orb::Enum + ACTIVE: :active + ENDED: :ended + UPCOMING: :upcoming + + def self.values: -> Array[Orb::Models::SubscriptionUnscheduleCancellationResponse::status] + end + + type trial_info = { end_date: Time? } + + class TrialInfo < Orb::BaseModel + attr_accessor end_date: Time? + + def initialize: + (end_date: Time?) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleCancellationResponse::trial_info + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleCancellationResponse::trial_info + end + end + end +end diff --git a/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbs b/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbs new file mode 100644 index 00000000..aed0fecb --- /dev/null +++ b/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbs @@ -0,0 +1,22 @@ +module Orb + module Models + type subscription_unschedule_fixed_fee_quantity_updates_params = + { price_id: String } & Orb::request_parameters + + class SubscriptionUnscheduleFixedFeeQuantityUpdatesParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor price_id: String + + def initialize: + (price_id: String, request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::subscription_unschedule_fixed_fee_quantity_updates_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_unschedule_fixed_fee_quantity_updates_params + end + end +end diff --git a/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbs b/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbs new file mode 100644 index 00000000..39d69359 --- /dev/null +++ b/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbs @@ -0,0 +1,751 @@ +module Orb + module Models + type subscription_unschedule_fixed_fee_quantity_updates_response = + { + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::status, + trial_info: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::TrialInfo + } + + class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor active_plan_phase_order: Integer? + + attr_accessor adjustment_intervals: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval] + + attr_accessor auto_collection: bool? + + attr_accessor billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::BillingCycleAnchorConfiguration + + attr_accessor billing_cycle_day: Integer + + attr_accessor created_at: Time + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor customer: Orb::Models::Customer + + attr_accessor default_invoice_memo: String? + + attr_accessor discount_intervals: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::discount_interval] + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::FixedFeeQuantitySchedule] + + attr_accessor invoicing_threshold: String? + + attr_accessor maximum_intervals: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::MaximumInterval] + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum_intervals: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::MinimumInterval] + + attr_accessor net_terms: Integer + + attr_accessor plan: Orb::Models::Plan + + attr_accessor price_intervals: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval] + + attr_accessor redeemed_coupon: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::RedeemedCoupon? + + attr_accessor start_date: Time + + attr_accessor status: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::status + + attr_accessor trial_info: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::TrialInfo + + def initialize: + ( + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::status, + trial_info: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::TrialInfo + ) -> void + | ( + ?Orb::Models::subscription_unschedule_fixed_fee_quantity_updates_response + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_unschedule_fixed_fee_quantity_updates_response + + type adjustment_interval = + { + id: String, + adjustment: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + } + + class AdjustmentInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::adjustment + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + adjustment: Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::adjustment_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::adjustment_interval + + type adjustment = + Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + | Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + | Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + | Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + | Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + + class Adjustment < Orb::Union + type amount_discount_adjustment = + { + id: String, + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String? + } + + class AmountDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + end + + type percentage_discount_adjustment = + { + id: String, + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String? + } + + class PercentageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor percentage_discount: Float + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + end + + type usage_discount_adjustment = + { + id: String, + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float + } + + class UsageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + attr_accessor usage_discount: Float + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + end + + type minimum_adjustment = + { + id: String, + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MinimumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::minimum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::minimum_adjustment + end + + type maximum_adjustment = + { + id: String, + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MaximumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor maximum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::maximum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::maximum_adjustment + end + + private def self.variants: -> [[:amount_discount, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment], [:percentage_discount, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment], [:usage_discount, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment], [:minimum, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment], [:maximum, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment]] + end + end + + type billing_cycle_anchor_configuration = + { day: Integer, month: Integer?, year: Integer? } + + class BillingCycleAnchorConfiguration < Orb::BaseModel + attr_accessor day: Integer + + attr_accessor month: Integer? + + attr_accessor year: Integer? + + def initialize: + (day: Integer, month: Integer?, year: Integer?) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::billing_cycle_anchor_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::billing_cycle_anchor_configuration + end + + type discount_interval = + Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::AmountDiscountInterval + | Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::PercentageDiscountInterval + | Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::UsageDiscountInterval + + class DiscountInterval < Orb::Union + type amount_discount_interval = + { + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :amount, + end_date: Time?, + start_date: Time + } + + class AmountDiscountInterval < Orb::BaseModel + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :amount + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + discount_type: :amount + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::amount_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::amount_discount_interval + end + + type percentage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :percentage, + end_date: Time?, + percentage_discount: Float, + start_date: Time + } + + class PercentageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :percentage + + attr_accessor end_date: Time? + + attr_accessor percentage_discount: Float + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + percentage_discount: Float, + start_date: Time, + discount_type: :percentage + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::percentage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::percentage_discount_interval + end + + type usage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :usage, + end_date: Time?, + start_date: Time, + usage_discount: Float + } + + class UsageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :usage + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + attr_accessor usage_discount: Float + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + usage_discount: Float, + discount_type: :usage + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::usage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::usage_discount_interval + end + + private def self.variants: -> [[:amount, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::AmountDiscountInterval], [:percentage, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::PercentageDiscountInterval], [:usage, Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::DiscountInterval::UsageDiscountInterval]] + end + + type fixed_fee_quantity_schedule = + { end_date: Time?, price_id: String, quantity: Float, start_date: Time } + + class FixedFeeQuantitySchedule < Orb::BaseModel + attr_accessor end_date: Time? + + attr_accessor price_id: String + + attr_accessor quantity: Float + + attr_accessor start_date: Time + + def initialize: + ( + end_date: Time?, + price_id: String, + quantity: Float, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::fixed_fee_quantity_schedule + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::fixed_fee_quantity_schedule + end + + type maximum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + } + + class MaximumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor maximum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::maximum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::maximum_interval + end + + type minimum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + } + + class MinimumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor minimum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::minimum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::minimum_interval + end + + type price_interval = + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + } + + class PriceInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor billing_cycle_day: Integer + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval::FixedFeeQuantityTransition]? + + attr_accessor price: Orb::Models::price + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::price_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::price_interval + + type fixed_fee_quantity_transition = + { effective_date: Time, price_id: String, quantity: Integer } + + class FixedFeeQuantityTransition < Orb::BaseModel + attr_accessor effective_date: Time + + attr_accessor price_id: String + + attr_accessor quantity: Integer + + def initialize: + (effective_date: Time, price_id: String, quantity: Integer) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval::fixed_fee_quantity_transition + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::PriceInterval::fixed_fee_quantity_transition + end + end + + type redeemed_coupon = + { coupon_id: String, end_date: Time?, start_date: Time } + + class RedeemedCoupon < Orb::BaseModel + attr_accessor coupon_id: String + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + (coupon_id: String, end_date: Time?, start_date: Time) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::redeemed_coupon + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::redeemed_coupon + end + + type status = :active | :ended | :upcoming + + class Status < Orb::Enum + ACTIVE: :active + ENDED: :ended + UPCOMING: :upcoming + + def self.values: -> Array[Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::status] + end + + type trial_info = { end_date: Time? } + + class TrialInfo < Orb::BaseModel + attr_accessor end_date: Time? + + def initialize: + (end_date: Time?) -> void + | ( + ?Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::trial_info + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse::trial_info + end + end + end +end diff --git a/sig/orb/models/subscription_unschedule_pending_plan_changes_params.rbs b/sig/orb/models/subscription_unschedule_pending_plan_changes_params.rbs new file mode 100644 index 00000000..c1f04150 --- /dev/null +++ b/sig/orb/models/subscription_unschedule_pending_plan_changes_params.rbs @@ -0,0 +1,20 @@ +module Orb + module Models + type subscription_unschedule_pending_plan_changes_params = + { } & Orb::request_parameters + + class SubscriptionUnschedulePendingPlanChangesParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | ( + ?Orb::Models::subscription_unschedule_pending_plan_changes_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_unschedule_pending_plan_changes_params + end + end +end diff --git a/sig/orb/models/subscription_unschedule_pending_plan_changes_response.rbs b/sig/orb/models/subscription_unschedule_pending_plan_changes_response.rbs new file mode 100644 index 00000000..7fa64424 --- /dev/null +++ b/sig/orb/models/subscription_unschedule_pending_plan_changes_response.rbs @@ -0,0 +1,751 @@ +module Orb + module Models + type subscription_unschedule_pending_plan_changes_response = + { + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::status, + trial_info: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::TrialInfo + } + + class SubscriptionUnschedulePendingPlanChangesResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor active_plan_phase_order: Integer? + + attr_accessor adjustment_intervals: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval] + + attr_accessor auto_collection: bool? + + attr_accessor billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::BillingCycleAnchorConfiguration + + attr_accessor billing_cycle_day: Integer + + attr_accessor created_at: Time + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor customer: Orb::Models::Customer + + attr_accessor default_invoice_memo: String? + + attr_accessor discount_intervals: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::discount_interval] + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::FixedFeeQuantitySchedule] + + attr_accessor invoicing_threshold: String? + + attr_accessor maximum_intervals: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::MaximumInterval] + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum_intervals: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::MinimumInterval] + + attr_accessor net_terms: Integer + + attr_accessor plan: Orb::Models::Plan + + attr_accessor price_intervals: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval] + + attr_accessor redeemed_coupon: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::RedeemedCoupon? + + attr_accessor start_date: Time + + attr_accessor status: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::status + + attr_accessor trial_info: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::TrialInfo + + def initialize: + ( + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::status, + trial_info: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::TrialInfo + ) -> void + | ( + ?Orb::Models::subscription_unschedule_pending_plan_changes_response + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_unschedule_pending_plan_changes_response + + type adjustment_interval = + { + id: String, + adjustment: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + } + + class AdjustmentInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::adjustment + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + adjustment: Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::adjustment_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::adjustment_interval + + type adjustment = + Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + | Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + | Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + | Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + | Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + + class Adjustment < Orb::Union + type amount_discount_adjustment = + { + id: String, + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String? + } + + class AmountDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + end + + type percentage_discount_adjustment = + { + id: String, + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String? + } + + class PercentageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor percentage_discount: Float + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + end + + type usage_discount_adjustment = + { + id: String, + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float + } + + class UsageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + attr_accessor usage_discount: Float + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + end + + type minimum_adjustment = + { + id: String, + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MinimumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::minimum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::minimum_adjustment + end + + type maximum_adjustment = + { + id: String, + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MaximumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor maximum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::maximum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::maximum_adjustment + end + + private def self.variants: -> [[:amount_discount, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment], [:percentage_discount, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment], [:usage_discount, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment], [:minimum, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MinimumAdjustment], [:maximum, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::AdjustmentInterval::Adjustment::MaximumAdjustment]] + end + end + + type billing_cycle_anchor_configuration = + { day: Integer, month: Integer?, year: Integer? } + + class BillingCycleAnchorConfiguration < Orb::BaseModel + attr_accessor day: Integer + + attr_accessor month: Integer? + + attr_accessor year: Integer? + + def initialize: + (day: Integer, month: Integer?, year: Integer?) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::billing_cycle_anchor_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::billing_cycle_anchor_configuration + end + + type discount_interval = + Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::AmountDiscountInterval + | Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::PercentageDiscountInterval + | Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::UsageDiscountInterval + + class DiscountInterval < Orb::Union + type amount_discount_interval = + { + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :amount, + end_date: Time?, + start_date: Time + } + + class AmountDiscountInterval < Orb::BaseModel + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :amount + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + discount_type: :amount + ) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::amount_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::amount_discount_interval + end + + type percentage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :percentage, + end_date: Time?, + percentage_discount: Float, + start_date: Time + } + + class PercentageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :percentage + + attr_accessor end_date: Time? + + attr_accessor percentage_discount: Float + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + percentage_discount: Float, + start_date: Time, + discount_type: :percentage + ) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::percentage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::percentage_discount_interval + end + + type usage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :usage, + end_date: Time?, + start_date: Time, + usage_discount: Float + } + + class UsageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :usage + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + attr_accessor usage_discount: Float + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + usage_discount: Float, + discount_type: :usage + ) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::usage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::usage_discount_interval + end + + private def self.variants: -> [[:amount, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::AmountDiscountInterval], [:percentage, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::PercentageDiscountInterval], [:usage, Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::DiscountInterval::UsageDiscountInterval]] + end + + type fixed_fee_quantity_schedule = + { end_date: Time?, price_id: String, quantity: Float, start_date: Time } + + class FixedFeeQuantitySchedule < Orb::BaseModel + attr_accessor end_date: Time? + + attr_accessor price_id: String + + attr_accessor quantity: Float + + attr_accessor start_date: Time + + def initialize: + ( + end_date: Time?, + price_id: String, + quantity: Float, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::fixed_fee_quantity_schedule + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::fixed_fee_quantity_schedule + end + + type maximum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + } + + class MaximumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor maximum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::maximum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::maximum_interval + end + + type minimum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + } + + class MinimumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor minimum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::minimum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::minimum_interval + end + + type price_interval = + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + } + + class PriceInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor billing_cycle_day: Integer + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval::FixedFeeQuantityTransition]? + + attr_accessor price: Orb::Models::price + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::price_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::price_interval + + type fixed_fee_quantity_transition = + { effective_date: Time, price_id: String, quantity: Integer } + + class FixedFeeQuantityTransition < Orb::BaseModel + attr_accessor effective_date: Time + + attr_accessor price_id: String + + attr_accessor quantity: Integer + + def initialize: + (effective_date: Time, price_id: String, quantity: Integer) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval::fixed_fee_quantity_transition + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::PriceInterval::fixed_fee_quantity_transition + end + end + + type redeemed_coupon = + { coupon_id: String, end_date: Time?, start_date: Time } + + class RedeemedCoupon < Orb::BaseModel + attr_accessor coupon_id: String + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + (coupon_id: String, end_date: Time?, start_date: Time) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::redeemed_coupon + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::redeemed_coupon + end + + type status = :active | :ended | :upcoming + + class Status < Orb::Enum + ACTIVE: :active + ENDED: :ended + UPCOMING: :upcoming + + def self.values: -> Array[Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::status] + end + + type trial_info = { end_date: Time? } + + class TrialInfo < Orb::BaseModel + attr_accessor end_date: Time? + + def initialize: + (end_date: Time?) -> void + | ( + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::trial_info + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse::trial_info + end + end + end +end diff --git a/sig/orb/models/subscription_update_fixed_fee_quantity_params.rbs b/sig/orb/models/subscription_update_fixed_fee_quantity_params.rbs new file mode 100644 index 00000000..d28bab1e --- /dev/null +++ b/sig/orb/models/subscription_update_fixed_fee_quantity_params.rbs @@ -0,0 +1,54 @@ +module Orb + module Models + type subscription_update_fixed_fee_quantity_params = + { + price_id: String, + quantity: Float, + change_option: Orb::Models::SubscriptionUpdateFixedFeeQuantityParams::change_option, + effective_date: Date? + } + & Orb::request_parameters + + class SubscriptionUpdateFixedFeeQuantityParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor price_id: String + + attr_accessor quantity: Float + + attr_reader change_option: Orb::Models::SubscriptionUpdateFixedFeeQuantityParams::change_option? + + def change_option=: ( + Orb::Models::SubscriptionUpdateFixedFeeQuantityParams::change_option + ) -> void + + attr_accessor effective_date: Date? + + def initialize: + ( + price_id: String, + quantity: Float, + change_option: Orb::Models::SubscriptionUpdateFixedFeeQuantityParams::change_option, + effective_date: Date?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::subscription_update_fixed_fee_quantity_params + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_update_fixed_fee_quantity_params + + type change_option = :immediate | :upcoming_invoice | :effective_date + + class ChangeOption < Orb::Enum + IMMEDIATE: :immediate + UPCOMING_INVOICE: :upcoming_invoice + EFFECTIVE_DATE: :effective_date + + def self.values: -> Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityParams::change_option] + end + end + end +end diff --git a/sig/orb/models/subscription_update_fixed_fee_quantity_response.rbs b/sig/orb/models/subscription_update_fixed_fee_quantity_response.rbs new file mode 100644 index 00000000..43cbc8e2 --- /dev/null +++ b/sig/orb/models/subscription_update_fixed_fee_quantity_response.rbs @@ -0,0 +1,751 @@ +module Orb + module Models + type subscription_update_fixed_fee_quantity_response = + { + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::status, + trial_info: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::TrialInfo + } + + class SubscriptionUpdateFixedFeeQuantityResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor active_plan_phase_order: Integer? + + attr_accessor adjustment_intervals: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval] + + attr_accessor auto_collection: bool? + + attr_accessor billing_cycle_anchor_configuration: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::BillingCycleAnchorConfiguration + + attr_accessor billing_cycle_day: Integer + + attr_accessor created_at: Time + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor customer: Orb::Models::Customer + + attr_accessor default_invoice_memo: String? + + attr_accessor discount_intervals: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::discount_interval] + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::FixedFeeQuantitySchedule] + + attr_accessor invoicing_threshold: String? + + attr_accessor maximum_intervals: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::MaximumInterval] + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum_intervals: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::MinimumInterval] + + attr_accessor net_terms: Integer + + attr_accessor plan: Orb::Models::Plan + + attr_accessor price_intervals: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval] + + attr_accessor redeemed_coupon: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::RedeemedCoupon? + + attr_accessor start_date: Time + + attr_accessor status: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::status + + attr_accessor trial_info: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::TrialInfo + + def initialize: + ( + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::status, + trial_info: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::TrialInfo + ) -> void + | ( + ?Orb::Models::subscription_update_fixed_fee_quantity_response + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_update_fixed_fee_quantity_response + + type adjustment_interval = + { + id: String, + adjustment: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + } + + class AdjustmentInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::adjustment + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + adjustment: Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::adjustment_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::adjustment_interval + + type adjustment = + Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + | Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + | Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + | Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + | Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + + class Adjustment < Orb::Union + type amount_discount_adjustment = + { + id: String, + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String? + } + + class AmountDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + end + + type percentage_discount_adjustment = + { + id: String, + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String? + } + + class PercentageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor percentage_discount: Float + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + end + + type usage_discount_adjustment = + { + id: String, + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float + } + + class UsageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + attr_accessor usage_discount: Float + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + end + + type minimum_adjustment = + { + id: String, + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MinimumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::minimum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::minimum_adjustment + end + + type maximum_adjustment = + { + id: String, + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MaximumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor maximum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::maximum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::maximum_adjustment + end + + private def self.variants: -> [[:amount_discount, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment], [:percentage_discount, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment], [:usage_discount, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment], [:minimum, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MinimumAdjustment], [:maximum, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::AdjustmentInterval::Adjustment::MaximumAdjustment]] + end + end + + type billing_cycle_anchor_configuration = + { day: Integer, month: Integer?, year: Integer? } + + class BillingCycleAnchorConfiguration < Orb::BaseModel + attr_accessor day: Integer + + attr_accessor month: Integer? + + attr_accessor year: Integer? + + def initialize: + (day: Integer, month: Integer?, year: Integer?) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::billing_cycle_anchor_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::billing_cycle_anchor_configuration + end + + type discount_interval = + Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::AmountDiscountInterval + | Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::PercentageDiscountInterval + | Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::UsageDiscountInterval + + class DiscountInterval < Orb::Union + type amount_discount_interval = + { + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :amount, + end_date: Time?, + start_date: Time + } + + class AmountDiscountInterval < Orb::BaseModel + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :amount + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + discount_type: :amount + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::amount_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::amount_discount_interval + end + + type percentage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :percentage, + end_date: Time?, + percentage_discount: Float, + start_date: Time + } + + class PercentageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :percentage + + attr_accessor end_date: Time? + + attr_accessor percentage_discount: Float + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + percentage_discount: Float, + start_date: Time, + discount_type: :percentage + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::percentage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::percentage_discount_interval + end + + type usage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :usage, + end_date: Time?, + start_date: Time, + usage_discount: Float + } + + class UsageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :usage + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + attr_accessor usage_discount: Float + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + usage_discount: Float, + discount_type: :usage + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::usage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::usage_discount_interval + end + + private def self.variants: -> [[:amount, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::AmountDiscountInterval], [:percentage, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::PercentageDiscountInterval], [:usage, Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::DiscountInterval::UsageDiscountInterval]] + end + + type fixed_fee_quantity_schedule = + { end_date: Time?, price_id: String, quantity: Float, start_date: Time } + + class FixedFeeQuantitySchedule < Orb::BaseModel + attr_accessor end_date: Time? + + attr_accessor price_id: String + + attr_accessor quantity: Float + + attr_accessor start_date: Time + + def initialize: + ( + end_date: Time?, + price_id: String, + quantity: Float, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::fixed_fee_quantity_schedule + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::fixed_fee_quantity_schedule + end + + type maximum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + } + + class MaximumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor maximum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::maximum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::maximum_interval + end + + type minimum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + } + + class MinimumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor minimum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::minimum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::minimum_interval + end + + type price_interval = + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + } + + class PriceInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor billing_cycle_day: Integer + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval::FixedFeeQuantityTransition]? + + attr_accessor price: Orb::Models::price + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::price_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::price_interval + + type fixed_fee_quantity_transition = + { effective_date: Time, price_id: String, quantity: Integer } + + class FixedFeeQuantityTransition < Orb::BaseModel + attr_accessor effective_date: Time + + attr_accessor price_id: String + + attr_accessor quantity: Integer + + def initialize: + (effective_date: Time, price_id: String, quantity: Integer) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval::fixed_fee_quantity_transition + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::PriceInterval::fixed_fee_quantity_transition + end + end + + type redeemed_coupon = + { coupon_id: String, end_date: Time?, start_date: Time } + + class RedeemedCoupon < Orb::BaseModel + attr_accessor coupon_id: String + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + (coupon_id: String, end_date: Time?, start_date: Time) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::redeemed_coupon + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::redeemed_coupon + end + + type status = :active | :ended | :upcoming + + class Status < Orb::Enum + ACTIVE: :active + ENDED: :ended + UPCOMING: :upcoming + + def self.values: -> Array[Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::status] + end + + type trial_info = { end_date: Time? } + + class TrialInfo < Orb::BaseModel + attr_accessor end_date: Time? + + def initialize: + (end_date: Time?) -> void + | ( + ?Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::trial_info + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse::trial_info + end + end + end +end diff --git a/sig/orb/models/subscription_update_params.rbs b/sig/orb/models/subscription_update_params.rbs new file mode 100644 index 00000000..7b539a8c --- /dev/null +++ b/sig/orb/models/subscription_update_params.rbs @@ -0,0 +1,43 @@ +module Orb + module Models + type subscription_update_params = + { + auto_collection: bool?, + default_invoice_memo: String?, + invoicing_threshold: String?, + metadata: Hash[Symbol, String?]?, + net_terms: Integer? + } + & Orb::request_parameters + + class SubscriptionUpdateParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor auto_collection: bool? + + attr_accessor default_invoice_memo: String? + + attr_accessor invoicing_threshold: String? + + attr_accessor metadata: Hash[Symbol, String?]? + + attr_accessor net_terms: Integer? + + def initialize: + ( + auto_collection: bool?, + default_invoice_memo: String?, + invoicing_threshold: String?, + metadata: Hash[Symbol, String?]?, + net_terms: Integer?, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::subscription_update_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_update_params + end + end +end diff --git a/sig/orb/models/subscription_update_trial_params.rbs b/sig/orb/models/subscription_update_trial_params.rbs new file mode 100644 index 00000000..c551cb70 --- /dev/null +++ b/sig/orb/models/subscription_update_trial_params.rbs @@ -0,0 +1,49 @@ +module Orb + module Models + type subscription_update_trial_params = + { + trial_end_date: Orb::Models::SubscriptionUpdateTrialParams::trial_end_date, + shift: bool + } + & Orb::request_parameters + + class SubscriptionUpdateTrialParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + attr_accessor trial_end_date: Orb::Models::SubscriptionUpdateTrialParams::trial_end_date + + attr_reader shift: bool? + + def shift=: (bool) -> void + + def initialize: + ( + trial_end_date: Orb::Models::SubscriptionUpdateTrialParams::trial_end_date, + shift: bool, + request_options: Orb::request_opts + ) -> void + | ( + ?Orb::Models::subscription_update_trial_params | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_update_trial_params + + type trial_end_date = + Time + | Orb::Models::SubscriptionUpdateTrialParams::TrialEndDate::union_member1 + + class TrialEndDate < Orb::Union + type union_member1 = :immediate + + class UnionMember1 < Orb::Enum + IMMEDIATE: :immediate + + def self.values: -> Array[Orb::Models::SubscriptionUpdateTrialParams::TrialEndDate::union_member1] + end + + private def self.variants: -> [[nil, Time], [nil, Orb::Models::SubscriptionUpdateTrialParams::TrialEndDate::union_member1]] + end + end + end +end diff --git a/sig/orb/models/subscription_update_trial_response.rbs b/sig/orb/models/subscription_update_trial_response.rbs new file mode 100644 index 00000000..ee16aa5a --- /dev/null +++ b/sig/orb/models/subscription_update_trial_response.rbs @@ -0,0 +1,750 @@ +module Orb + module Models + type subscription_update_trial_response = + { + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUpdateTrialResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionUpdateTrialResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionUpdateTrialResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionUpdateTrialResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionUpdateTrialResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionUpdateTrialResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionUpdateTrialResponse::status, + trial_info: Orb::Models::SubscriptionUpdateTrialResponse::TrialInfo + } + + class SubscriptionUpdateTrialResponse < Orb::BaseModel + attr_accessor id: String + + attr_accessor active_plan_phase_order: Integer? + + attr_accessor adjustment_intervals: Array[Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval] + + attr_accessor auto_collection: bool? + + attr_accessor billing_cycle_anchor_configuration: Orb::Models::SubscriptionUpdateTrialResponse::BillingCycleAnchorConfiguration + + attr_accessor billing_cycle_day: Integer + + attr_accessor created_at: Time + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor customer: Orb::Models::Customer + + attr_accessor default_invoice_memo: String? + + attr_accessor discount_intervals: Array[Orb::Models::SubscriptionUpdateTrialResponse::discount_interval] + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionUpdateTrialResponse::FixedFeeQuantitySchedule] + + attr_accessor invoicing_threshold: String? + + attr_accessor maximum_intervals: Array[Orb::Models::SubscriptionUpdateTrialResponse::MaximumInterval] + + attr_accessor metadata: Hash[Symbol, String] + + attr_accessor minimum_intervals: Array[Orb::Models::SubscriptionUpdateTrialResponse::MinimumInterval] + + attr_accessor net_terms: Integer + + attr_accessor plan: Orb::Models::Plan + + attr_accessor price_intervals: Array[Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval] + + attr_accessor redeemed_coupon: Orb::Models::SubscriptionUpdateTrialResponse::RedeemedCoupon? + + attr_accessor start_date: Time + + attr_accessor status: Orb::Models::SubscriptionUpdateTrialResponse::status + + attr_accessor trial_info: Orb::Models::SubscriptionUpdateTrialResponse::TrialInfo + + def initialize: + ( + id: String, + active_plan_phase_order: Integer?, + adjustment_intervals: Array[Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval], + auto_collection: bool?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionUpdateTrialResponse::BillingCycleAnchorConfiguration, + billing_cycle_day: Integer, + created_at: Time, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + customer: Orb::Models::Customer, + default_invoice_memo: String?, + discount_intervals: Array[Orb::Models::SubscriptionUpdateTrialResponse::discount_interval], + end_date: Time?, + fixed_fee_quantity_schedule: Array[Orb::Models::SubscriptionUpdateTrialResponse::FixedFeeQuantitySchedule], + invoicing_threshold: String?, + maximum_intervals: Array[Orb::Models::SubscriptionUpdateTrialResponse::MaximumInterval], + metadata: Hash[Symbol, String], + minimum_intervals: Array[Orb::Models::SubscriptionUpdateTrialResponse::MinimumInterval], + net_terms: Integer, + plan: Orb::Models::Plan, + price_intervals: Array[Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval], + redeemed_coupon: Orb::Models::SubscriptionUpdateTrialResponse::RedeemedCoupon?, + start_date: Time, + status: Orb::Models::SubscriptionUpdateTrialResponse::status, + trial_info: Orb::Models::SubscriptionUpdateTrialResponse::TrialInfo + ) -> void + | ( + ?Orb::Models::subscription_update_trial_response | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::subscription_update_trial_response + + type adjustment_interval = + { + id: String, + adjustment: Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + } + + class AdjustmentInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment: Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::adjustment + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + adjustment: Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::adjustment, + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::adjustment_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::adjustment_interval + + type adjustment = + Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment + | Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment + | Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment + | Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MinimumAdjustment + | Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MaximumAdjustment + + class Adjustment < Orb::Union + type amount_discount_adjustment = + { + id: String, + adjustment_type: :amount_discount, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String? + } + + class AmountDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :amount_discount + + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + amount_discount: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :amount_discount + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::amount_discount_adjustment + end + + type percentage_discount_adjustment = + { + id: String, + adjustment_type: :percentage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String? + } + + class PercentageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :percentage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor percentage_discount: Float + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + percentage_discount: Float, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :percentage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::percentage_discount_adjustment + end + + type usage_discount_adjustment = + { + id: String, + adjustment_type: :usage_discount, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float + } + + class UsageDiscountAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :usage_discount + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + attr_accessor usage_discount: Float + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + plan_phase_order: Integer?, + reason: String?, + usage_discount: Float, + adjustment_type: :usage_discount + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::usage_discount_adjustment + end + + type minimum_adjustment = + { + id: String, + adjustment_type: :minimum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MinimumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :minimum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor item_id: String + + attr_accessor minimum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + item_id: String, + minimum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :minimum + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::minimum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::minimum_adjustment + end + + type maximum_adjustment = + { + id: String, + adjustment_type: :maximum, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String? + } + + class MaximumAdjustment < Orb::BaseModel + attr_accessor id: String + + attr_accessor adjustment_type: :maximum + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor is_invoice_level: bool + + attr_accessor maximum_amount: String + + attr_accessor plan_phase_order: Integer? + + attr_accessor reason: String? + + def initialize: + ( + id: String, + applies_to_price_ids: Array[String], + is_invoice_level: bool, + maximum_amount: String, + plan_phase_order: Integer?, + reason: String?, + adjustment_type: :maximum + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::maximum_adjustment + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::maximum_adjustment + end + + private def self.variants: -> [[:amount_discount, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::AmountDiscountAdjustment], [:percentage_discount, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::PercentageDiscountAdjustment], [:usage_discount, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::UsageDiscountAdjustment], [:minimum, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MinimumAdjustment], [:maximum, Orb::Models::SubscriptionUpdateTrialResponse::AdjustmentInterval::Adjustment::MaximumAdjustment]] + end + end + + type billing_cycle_anchor_configuration = + { day: Integer, month: Integer?, year: Integer? } + + class BillingCycleAnchorConfiguration < Orb::BaseModel + attr_accessor day: Integer + + attr_accessor month: Integer? + + attr_accessor year: Integer? + + def initialize: + (day: Integer, month: Integer?, year: Integer?) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::billing_cycle_anchor_configuration + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::billing_cycle_anchor_configuration + end + + type discount_interval = + Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::AmountDiscountInterval + | Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::PercentageDiscountInterval + | Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::UsageDiscountInterval + + class DiscountInterval < Orb::Union + type amount_discount_interval = + { + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :amount, + end_date: Time?, + start_date: Time + } + + class AmountDiscountInterval < Orb::BaseModel + attr_accessor amount_discount: String + + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :amount + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + ( + amount_discount: String, + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + discount_type: :amount + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::amount_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::amount_discount_interval + end + + type percentage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :percentage, + end_date: Time?, + percentage_discount: Float, + start_date: Time + } + + class PercentageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :percentage + + attr_accessor end_date: Time? + + attr_accessor percentage_discount: Float + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + percentage_discount: Float, + start_date: Time, + discount_type: :percentage + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::percentage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::percentage_discount_interval + end + + type usage_discount_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + discount_type: :usage, + end_date: Time?, + start_date: Time, + usage_discount: Float + } + + class UsageDiscountInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor discount_type: :usage + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + attr_accessor usage_discount: Float + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + start_date: Time, + usage_discount: Float, + discount_type: :usage + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::usage_discount_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::usage_discount_interval + end + + private def self.variants: -> [[:amount, Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::AmountDiscountInterval], [:percentage, Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::PercentageDiscountInterval], [:usage, Orb::Models::SubscriptionUpdateTrialResponse::DiscountInterval::UsageDiscountInterval]] + end + + type fixed_fee_quantity_schedule = + { end_date: Time?, price_id: String, quantity: Float, start_date: Time } + + class FixedFeeQuantitySchedule < Orb::BaseModel + attr_accessor end_date: Time? + + attr_accessor price_id: String + + attr_accessor quantity: Float + + attr_accessor start_date: Time + + def initialize: + ( + end_date: Time?, + price_id: String, + quantity: Float, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::fixed_fee_quantity_schedule + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::fixed_fee_quantity_schedule + end + + type maximum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + } + + class MaximumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor maximum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + maximum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::maximum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::maximum_interval + end + + type minimum_interval = + { + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + } + + class MinimumInterval < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor applies_to_price_interval_ids: Array[String] + + attr_accessor end_date: Time? + + attr_accessor minimum_amount: String + + attr_accessor start_date: Time + + def initialize: + ( + applies_to_price_ids: Array[String], + applies_to_price_interval_ids: Array[String], + end_date: Time?, + minimum_amount: String, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::minimum_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::minimum_interval + end + + type price_interval = + { + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + } + + class PriceInterval < Orb::BaseModel + attr_accessor id: String + + attr_accessor billing_cycle_day: Integer + + attr_accessor current_billing_period_end_date: Time? + + attr_accessor current_billing_period_start_date: Time? + + attr_accessor end_date: Time? + + attr_accessor fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval::FixedFeeQuantityTransition]? + + attr_accessor price: Orb::Models::price + + attr_accessor start_date: Time + + def initialize: + ( + id: String, + billing_cycle_day: Integer, + current_billing_period_end_date: Time?, + current_billing_period_start_date: Time?, + end_date: Time?, + fixed_fee_quantity_transitions: Array[Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval::FixedFeeQuantityTransition]?, + price: Orb::Models::price, + start_date: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::price_interval + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::price_interval + + type fixed_fee_quantity_transition = + { effective_date: Time, price_id: String, quantity: Integer } + + class FixedFeeQuantityTransition < Orb::BaseModel + attr_accessor effective_date: Time + + attr_accessor price_id: String + + attr_accessor quantity: Integer + + def initialize: + (effective_date: Time, price_id: String, quantity: Integer) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval::fixed_fee_quantity_transition + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::PriceInterval::fixed_fee_quantity_transition + end + end + + type redeemed_coupon = + { coupon_id: String, end_date: Time?, start_date: Time } + + class RedeemedCoupon < Orb::BaseModel + attr_accessor coupon_id: String + + attr_accessor end_date: Time? + + attr_accessor start_date: Time + + def initialize: + (coupon_id: String, end_date: Time?, start_date: Time) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::redeemed_coupon + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::redeemed_coupon + end + + type status = :active | :ended | :upcoming + + class Status < Orb::Enum + ACTIVE: :active + ENDED: :ended + UPCOMING: :upcoming + + def self.values: -> Array[Orb::Models::SubscriptionUpdateTrialResponse::status] + end + + type trial_info = { end_date: Time? } + + class TrialInfo < Orb::BaseModel + attr_accessor end_date: Time? + + def initialize: + (end_date: Time?) -> void + | ( + ?Orb::Models::SubscriptionUpdateTrialResponse::trial_info + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUpdateTrialResponse::trial_info + end + end + end +end diff --git a/sig/orb/models/subscription_usage.rbs b/sig/orb/models/subscription_usage.rbs new file mode 100644 index 00000000..2a60449c --- /dev/null +++ b/sig/orb/models/subscription_usage.rbs @@ -0,0 +1,232 @@ +module Orb + module Models + type subscription_usage = + Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage + | Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage + + class SubscriptionUsage < Orb::Union + type ungrouped_subscription_usage = + { + data: Array[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data] + } + + class UngroupedSubscriptionUsage < Orb::BaseModel + attr_accessor data: Array[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data] + + def initialize: + ( + data: Array[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data] + ) -> void + | ( + ?Orb::Models::SubscriptionUsage::ungrouped_subscription_usage + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUsage::ungrouped_subscription_usage + + type data = + { + billable_metric: Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::BillableMetric, + usage: Array[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::Usage], + view_mode: Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::view_mode + } + + class Data < Orb::BaseModel + attr_accessor billable_metric: Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::BillableMetric + + attr_accessor usage: Array[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::Usage] + + attr_accessor view_mode: Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::view_mode + + def initialize: + ( + billable_metric: Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::BillableMetric, + usage: Array[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::Usage], + view_mode: Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::view_mode + ) -> void + | ( + ?Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::data + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::data + + type billable_metric = { id: String, name: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::billable_metric + end + + type usage = + { quantity: Float, timeframe_end: Time, timeframe_start: Time } + + class Usage < Orb::BaseModel + attr_accessor quantity: Float + + attr_accessor timeframe_end: Time + + attr_accessor timeframe_start: Time + + def initialize: + ( + quantity: Float, + timeframe_end: Time, + timeframe_start: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::usage + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::usage + end + + type view_mode = :periodic | :cumulative + + class ViewMode < Orb::Enum + PERIODIC: :periodic + CUMULATIVE: :cumulative + + def self.values: -> Array[Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage::Data::view_mode] + end + end + end + + type grouped_subscription_usage = + { + data: Array[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data], + pagination_metadata: Orb::Models::PaginationMetadata? + } + + class GroupedSubscriptionUsage < Orb::BaseModel + attr_accessor data: Array[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data] + + attr_accessor pagination_metadata: Orb::Models::PaginationMetadata? + + def initialize: + ( + data: Array[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data], + pagination_metadata: Orb::Models::PaginationMetadata? + ) -> void + | ( + ?Orb::Models::SubscriptionUsage::grouped_subscription_usage + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUsage::grouped_subscription_usage + + type data = + { + billable_metric: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric, + metric_group: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup, + usage: Array[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::Usage], + view_mode: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::view_mode + } + + class Data < Orb::BaseModel + attr_accessor billable_metric: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric + + attr_accessor metric_group: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup + + attr_accessor usage: Array[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::Usage] + + attr_accessor view_mode: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::view_mode + + def initialize: + ( + billable_metric: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::BillableMetric, + metric_group: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::MetricGroup, + usage: Array[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::Usage], + view_mode: Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::view_mode + ) -> void + | ( + ?Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::data + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::data + + type billable_metric = { id: String, name: String } + + class BillableMetric < Orb::BaseModel + attr_accessor id: String + + attr_accessor name: String + + def initialize: + (id: String, name: String) -> void + | ( + ?Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::billable_metric + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::billable_metric + end + + type metric_group = { property_key: String, property_value: String } + + class MetricGroup < Orb::BaseModel + attr_accessor property_key: String + + attr_accessor property_value: String + + def initialize: + (property_key: String, property_value: String) -> void + | ( + ?Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::metric_group + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::metric_group + end + + type usage = + { quantity: Float, timeframe_end: Time, timeframe_start: Time } + + class Usage < Orb::BaseModel + attr_accessor quantity: Float + + attr_accessor timeframe_end: Time + + attr_accessor timeframe_start: Time + + def initialize: + ( + quantity: Float, + timeframe_end: Time, + timeframe_start: Time + ) -> void + | ( + ?Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::usage + | Orb::BaseModel data + ) -> void + + def to_h: -> Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::usage + end + + type view_mode = :periodic | :cumulative + + class ViewMode < Orb::Enum + PERIODIC: :periodic + CUMULATIVE: :cumulative + + def self.values: -> Array[Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage::Data::view_mode] + end + end + end + + private def self.variants: -> [[nil, Orb::Models::SubscriptionUsage::UngroupedSubscriptionUsage], [nil, Orb::Models::SubscriptionUsage::GroupedSubscriptionUsage]] + end + end +end diff --git a/sig/orb/models/subscriptions.rbs b/sig/orb/models/subscriptions.rbs new file mode 100644 index 00000000..b79a5064 --- /dev/null +++ b/sig/orb/models/subscriptions.rbs @@ -0,0 +1,24 @@ +module Orb + module Models + type subscriptions_api = + { + data: Array[Orb::Models::Subscription], + pagination_metadata: Orb::Models::PaginationMetadata + } + + class SubscriptionsAPI < Orb::BaseModel + attr_accessor data: Array[Orb::Models::Subscription] + + attr_accessor pagination_metadata: Orb::Models::PaginationMetadata + + def initialize: + ( + data: Array[Orb::Models::Subscription], + pagination_metadata: Orb::Models::PaginationMetadata + ) -> void + | (?Orb::Models::subscriptions_api | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::subscriptions_api + end + end +end diff --git a/sig/orb/models/top_level_ping_params.rbs b/sig/orb/models/top_level_ping_params.rbs new file mode 100644 index 00000000..87cd898c --- /dev/null +++ b/sig/orb/models/top_level_ping_params.rbs @@ -0,0 +1,16 @@ +module Orb + module Models + type top_level_ping_params = { } & Orb::request_parameters + + class TopLevelPingParams < Orb::BaseModel + extend Orb::RequestParameters::Converter + include Orb::RequestParameters + + def initialize: + (request_options: Orb::request_opts) -> void + | (?Orb::Models::top_level_ping_params | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::top_level_ping_params + end + end +end diff --git a/sig/orb/models/top_level_ping_response.rbs b/sig/orb/models/top_level_ping_response.rbs new file mode 100644 index 00000000..7bfdbeea --- /dev/null +++ b/sig/orb/models/top_level_ping_response.rbs @@ -0,0 +1,15 @@ +module Orb + module Models + type top_level_ping_response = { response: String } + + class TopLevelPingResponse < Orb::BaseModel + attr_accessor response: String + + def initialize: + (response: String) -> void + | (?Orb::Models::top_level_ping_response | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::top_level_ping_response + end + end +end diff --git a/sig/orb/models/trial_discount.rbs b/sig/orb/models/trial_discount.rbs new file mode 100644 index 00000000..e72d03a0 --- /dev/null +++ b/sig/orb/models/trial_discount.rbs @@ -0,0 +1,44 @@ +module Orb + module Models + type trial_discount = + { + applies_to_price_ids: Array[String], + discount_type: Orb::Models::TrialDiscount::discount_type, + reason: String?, + trial_amount_discount: String?, + trial_percentage_discount: Float? + } + + class TrialDiscount < Orb::BaseModel + attr_accessor applies_to_price_ids: Array[String] + + attr_accessor discount_type: Orb::Models::TrialDiscount::discount_type + + attr_accessor reason: String? + + attr_accessor trial_amount_discount: String? + + attr_accessor trial_percentage_discount: Float? + + def initialize: + ( + applies_to_price_ids: Array[String], + discount_type: Orb::Models::TrialDiscount::discount_type, + reason: String?, + trial_amount_discount: String?, + trial_percentage_discount: Float? + ) -> void + | (?Orb::Models::trial_discount | Orb::BaseModel data) -> void + + def to_h: -> Orb::Models::trial_discount + + type discount_type = :trial + + class DiscountType < Orb::Enum + TRIAL: :trial + + def self.values: -> Array[Orb::Models::TrialDiscount::discount_type] + end + end + end +end diff --git a/sig/orb/page.rbs b/sig/orb/page.rbs new file mode 100644 index 00000000..300f59f3 --- /dev/null +++ b/sig/orb/page.rbs @@ -0,0 +1,29 @@ +module Orb + class Page[Elem] + include Orb::BasePage[Elem] + + attr_accessor data: Array[Elem] + + attr_accessor pagination_metadata: PaginationMetadata + + def initialize: ( + client: Orb::BaseClient, + req: Orb::BaseClient::request, + headers: Hash[String, String], + unwrapped: Hash[Symbol, top] + ) -> void + + type pagination_metadata = { has_more: bool, next_cursor: String? } + class PaginationMetadata < Orb::BaseModel + attr_accessor has_more: bool + + attr_accessor next_cursor: String? + + def initialize: + (has_more: bool, next_cursor: String?) -> void + | (?pagination_metadata | Orb::BaseModel data) -> void + + def to_h: -> pagination_metadata + end + end +end diff --git a/sig/orb/request_options.rbs b/sig/orb/request_options.rbs new file mode 100644 index 00000000..3ad742fc --- /dev/null +++ b/sig/orb/request_options.rbs @@ -0,0 +1,40 @@ +module Orb + type request_opts = + Orb::RequestOptions | Orb::request_options | Hash[Symbol, top] + + type request_parameters = { request_options: Orb::request_opts } + + module RequestParameters + attr_accessor request_options: Orb::request_opts + + module Converter + def dump_request: (top params) -> [top, Hash[Symbol, top]] + end + end + + type request_options = + { + idempotency_key: String?, + extra_query: Hash[String, (Array[String] | String)?]?, + extra_headers: Hash[String, String?]?, + extra_body: Hash[Symbol, top]?, + max_retries: Integer?, + timeout: Float? + } + + class RequestOptions < Orb::BaseModel + def self.validate!: (self | Hash[Symbol, top] opts) -> void + + attr_accessor idempotency_key: String? + + attr_accessor extra_query: Hash[String, (Array[String] | String)?]? + + attr_accessor extra_headers: Hash[String, String?]? + + attr_accessor extra_body: Hash[Symbol, top]? + + attr_accessor max_retries: Integer? + + attr_accessor timeout: Float? + end +end diff --git a/sig/orb/resources/alerts.rbs b/sig/orb/resources/alerts.rbs new file mode 100644 index 00000000..9de2eb82 --- /dev/null +++ b/sig/orb/resources/alerts.rbs @@ -0,0 +1,108 @@ +module Orb + module Resources + class Alerts + def retrieve: + ( + String alert_id, + ?Orb::Models::AlertRetrieveParams | Hash[Symbol, top] params + ) -> Orb::Models::Alert + | ( + String alert_id, + request_options: Orb::request_opts + ) -> Orb::Models::Alert + + def update: + ( + String alert_configuration_id, + Orb::Models::AlertUpdateParams | Hash[Symbol, top] params + ) -> Orb::Models::Alert + | ( + String alert_configuration_id, + thresholds: Array[Orb::Models::AlertUpdateParams::Threshold], + request_options: Orb::request_opts + ) -> Orb::Models::Alert + + def list: + ( + ?Orb::Models::AlertListParams | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::Alert] + | ( + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + cursor: String?, + customer_id: String?, + external_customer_id: String?, + limit: Integer, + subscription_id: String?, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::Alert] + + def create_for_customer: + ( + String customer_id, + Orb::Models::AlertCreateForCustomerParams | Hash[Symbol, top] params + ) -> Orb::Models::Alert + | ( + String customer_id, + currency: String, + type: Orb::Models::AlertCreateForCustomerParams::type_, + thresholds: Array[Orb::Models::AlertCreateForCustomerParams::Threshold]?, + request_options: Orb::request_opts + ) -> Orb::Models::Alert + + def create_for_external_customer: + ( + String external_customer_id, + Orb::Models::AlertCreateForExternalCustomerParams + | Hash[Symbol, top] params + ) -> Orb::Models::Alert + | ( + String external_customer_id, + currency: String, + type: Orb::Models::AlertCreateForExternalCustomerParams::type_, + thresholds: Array[Orb::Models::AlertCreateForExternalCustomerParams::Threshold]?, + request_options: Orb::request_opts + ) -> Orb::Models::Alert + + def create_for_subscription: + ( + String subscription_id, + Orb::Models::AlertCreateForSubscriptionParams + | Hash[Symbol, top] params + ) -> Orb::Models::Alert + | ( + String subscription_id, + thresholds: Array[Orb::Models::AlertCreateForSubscriptionParams::Threshold], + type: Orb::Models::AlertCreateForSubscriptionParams::type_, + metric_id: String?, + request_options: Orb::request_opts + ) -> Orb::Models::Alert + + def disable: + ( + String alert_configuration_id, + ?Orb::Models::AlertDisableParams | Hash[Symbol, top] params + ) -> Orb::Models::Alert + | ( + String alert_configuration_id, + subscription_id: String?, + request_options: Orb::request_opts + ) -> Orb::Models::Alert + + def enable: + ( + String alert_configuration_id, + ?Orb::Models::AlertEnableParams | Hash[Symbol, top] params + ) -> Orb::Models::Alert + | ( + String alert_configuration_id, + subscription_id: String?, + request_options: Orb::request_opts + ) -> Orb::Models::Alert + + def initialize: (client: Orb::Client) -> void + end + end +end diff --git a/sig/orb/resources/coupons.rbs b/sig/orb/resources/coupons.rbs new file mode 100644 index 00000000..a4611abf --- /dev/null +++ b/sig/orb/resources/coupons.rbs @@ -0,0 +1,53 @@ +module Orb + module Resources + class Coupons + attr_reader subscriptions: Orb::Resources::Coupons::Subscriptions + + def create: + ( + Orb::Models::CouponCreateParams | Hash[Symbol, top] params + ) -> Orb::Models::Coupon + | ( + discount: Orb::Models::CouponCreateParams::discount, + redemption_code: String, + duration_in_months: Integer?, + max_redemptions: Integer?, + request_options: Orb::request_opts + ) -> Orb::Models::Coupon + + def list: + ( + ?Orb::Models::CouponListParams | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::Coupon] + | ( + cursor: String?, + limit: Integer, + redemption_code: String?, + show_archived: bool?, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::Coupon] + + def archive: + ( + String coupon_id, + ?Orb::Models::CouponArchiveParams | Hash[Symbol, top] params + ) -> Orb::Models::Coupon + | ( + String coupon_id, + request_options: Orb::request_opts + ) -> Orb::Models::Coupon + + def fetch: + ( + String coupon_id, + ?Orb::Models::CouponFetchParams | Hash[Symbol, top] params + ) -> Orb::Models::Coupon + | ( + String coupon_id, + request_options: Orb::request_opts + ) -> Orb::Models::Coupon + + def initialize: (client: Orb::Client) -> void + end + end +end diff --git a/sig/orb/resources/coupons/subscriptions.rbs b/sig/orb/resources/coupons/subscriptions.rbs new file mode 100644 index 00000000..0ffe226a --- /dev/null +++ b/sig/orb/resources/coupons/subscriptions.rbs @@ -0,0 +1,22 @@ +module Orb + module Resources + class Coupons + class Subscriptions + def list: + ( + String coupon_id, + ?Orb::Models::Coupons::SubscriptionListParams + | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::Subscription] + | ( + String coupon_id, + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::Subscription] + + def initialize: (client: Orb::Client) -> void + end + end + end +end diff --git a/sig/orb/resources/credit_notes.rbs b/sig/orb/resources/credit_notes.rbs new file mode 100644 index 00000000..2d3b459d --- /dev/null +++ b/sig/orb/resources/credit_notes.rbs @@ -0,0 +1,38 @@ +module Orb + module Resources + class CreditNotes + def create: + ( + Orb::Models::CreditNoteCreateParams | Hash[Symbol, top] params + ) -> Orb::Models::CreditNote + | ( + line_items: Array[Orb::Models::CreditNoteCreateParams::LineItem], + memo: String?, + reason: Orb::Models::CreditNoteCreateParams::reason?, + request_options: Orb::request_opts + ) -> Orb::Models::CreditNote + + def list: + ( + ?Orb::Models::CreditNoteListParams | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::CreditNote] + | ( + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::CreditNote] + + def fetch: + ( + String credit_note_id, + ?Orb::Models::CreditNoteFetchParams | Hash[Symbol, top] params + ) -> Orb::Models::CreditNote + | ( + String credit_note_id, + request_options: Orb::request_opts + ) -> Orb::Models::CreditNote + + def initialize: (client: Orb::Client) -> void + end + end +end diff --git a/sig/orb/resources/customers.rbs b/sig/orb/resources/customers.rbs new file mode 100644 index 00000000..e0b592b6 --- /dev/null +++ b/sig/orb/resources/customers.rbs @@ -0,0 +1,152 @@ +module Orb + module Resources + class Customers + attr_reader costs: Orb::Resources::Customers::Costs + + attr_reader credits: Orb::Resources::Customers::Credits + + attr_reader balance_transactions: Orb::Resources::Customers::BalanceTransactions + + def create: + ( + Orb::Models::CustomerCreateParams | Hash[Symbol, top] params + ) -> Orb::Models::Customer + | ( + email: String, + name: String, + accounting_sync_configuration: Orb::Models::CustomerCreateParams::AccountingSyncConfiguration?, + additional_emails: Array[String]?, + auto_collection: bool?, + billing_address: Orb::Models::CustomerCreateParams::BillingAddress?, + currency: String?, + email_delivery: bool?, + external_customer_id: String?, + metadata: Hash[Symbol, String?]?, + payment_provider: Orb::Models::CustomerCreateParams::payment_provider?, + payment_provider_id: String?, + reporting_configuration: Orb::Models::CustomerCreateParams::ReportingConfiguration?, + shipping_address: Orb::Models::CustomerCreateParams::ShippingAddress?, + tax_configuration: Orb::Models::CustomerCreateParams::tax_configuration?, + tax_id: Orb::Models::CustomerCreateParams::TaxID?, + timezone: String?, + request_options: Orb::request_opts + ) -> Orb::Models::Customer + + def update: + ( + String customer_id, + ?Orb::Models::CustomerUpdateParams | Hash[Symbol, top] params + ) -> Orb::Models::Customer + | ( + String customer_id, + accounting_sync_configuration: Orb::Models::CustomerUpdateParams::AccountingSyncConfiguration?, + additional_emails: Array[String]?, + auto_collection: bool?, + billing_address: Orb::Models::CustomerUpdateParams::BillingAddress?, + currency: String?, + email: String?, + email_delivery: bool?, + external_customer_id: String?, + metadata: Hash[Symbol, String?]?, + name: String?, + payment_provider: Orb::Models::CustomerUpdateParams::payment_provider?, + payment_provider_id: String?, + reporting_configuration: Orb::Models::CustomerUpdateParams::ReportingConfiguration?, + shipping_address: Orb::Models::CustomerUpdateParams::ShippingAddress?, + tax_configuration: Orb::Models::CustomerUpdateParams::tax_configuration?, + tax_id: Orb::Models::CustomerUpdateParams::TaxID?, + request_options: Orb::request_opts + ) -> Orb::Models::Customer + + def list: + ( + ?Orb::Models::CustomerListParams | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::Customer] + | ( + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::Customer] + + def delete: + ( + String customer_id, + ?Orb::Models::CustomerDeleteParams | Hash[Symbol, top] params + ) -> nil + | (String customer_id, request_options: Orb::request_opts) -> nil + + def fetch: + ( + String customer_id, + ?Orb::Models::CustomerFetchParams | Hash[Symbol, top] params + ) -> Orb::Models::Customer + | ( + String customer_id, + request_options: Orb::request_opts + ) -> Orb::Models::Customer + + def fetch_by_external_id: + ( + String external_customer_id, + ?Orb::Models::CustomerFetchByExternalIDParams + | Hash[Symbol, top] params + ) -> Orb::Models::Customer + | ( + String external_customer_id, + request_options: Orb::request_opts + ) -> Orb::Models::Customer + + def sync_payment_methods_from_gateway: + ( + String external_customer_id, + ?Orb::Models::CustomerSyncPaymentMethodsFromGatewayParams + | Hash[Symbol, top] params + ) -> nil + | ( + String external_customer_id, + request_options: Orb::request_opts + ) -> nil + + def sync_payment_methods_from_gateway_by_external_customer_id: + ( + String customer_id, + ?Orb::Models::CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIDParams + | Hash[Symbol, top] params + ) -> nil + | (String customer_id, request_options: Orb::request_opts) -> nil + + def update_by_external_id: + ( + String id, + ?Orb::Models::CustomerUpdateByExternalIDParams + | Hash[Symbol, top] params + ) -> Orb::Models::Customer + | ( + String id, + accounting_sync_configuration: Orb::Models::CustomerUpdateByExternalIDParams::AccountingSyncConfiguration?, + additional_emails: Array[String]?, + auto_collection: bool?, + billing_address: Orb::Models::CustomerUpdateByExternalIDParams::BillingAddress?, + currency: String?, + email: String?, + email_delivery: bool?, + external_customer_id: String?, + metadata: Hash[Symbol, String?]?, + name: String?, + payment_provider: Orb::Models::CustomerUpdateByExternalIDParams::payment_provider?, + payment_provider_id: String?, + reporting_configuration: Orb::Models::CustomerUpdateByExternalIDParams::ReportingConfiguration?, + shipping_address: Orb::Models::CustomerUpdateByExternalIDParams::ShippingAddress?, + tax_configuration: Orb::Models::CustomerUpdateByExternalIDParams::tax_configuration?, + tax_id: Orb::Models::CustomerUpdateByExternalIDParams::TaxID?, + request_options: Orb::request_opts + ) -> Orb::Models::Customer + + def initialize: (client: Orb::Client) -> void + end + end +end diff --git a/sig/orb/resources/customers/balance_transactions.rbs b/sig/orb/resources/customers/balance_transactions.rbs new file mode 100644 index 00000000..15bbe83a --- /dev/null +++ b/sig/orb/resources/customers/balance_transactions.rbs @@ -0,0 +1,40 @@ +module Orb + module Resources + class Customers + class BalanceTransactions + def create: + ( + String customer_id, + Orb::Models::Customers::BalanceTransactionCreateParams + | Hash[Symbol, top] params + ) -> Orb::Models::Customers::BalanceTransactionCreateResponse + | ( + String customer_id, + amount: String, + type: Orb::Models::Customers::BalanceTransactionCreateParams::type_, + description: String?, + request_options: Orb::request_opts + ) -> Orb::Models::Customers::BalanceTransactionCreateResponse + + def list: + ( + String customer_id, + ?Orb::Models::Customers::BalanceTransactionListParams + | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::Customers::BalanceTransactionListResponse] + | ( + String customer_id, + cursor: String?, + limit: Integer, + operation_time_gt: Time?, + operation_time_gte: Time?, + operation_time_lt: Time?, + operation_time_lte: Time?, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::Customers::BalanceTransactionListResponse] + + def initialize: (client: Orb::Client) -> void + end + end + end +end diff --git a/sig/orb/resources/customers/costs.rbs b/sig/orb/resources/customers/costs.rbs new file mode 100644 index 00000000..62f813ac --- /dev/null +++ b/sig/orb/resources/customers/costs.rbs @@ -0,0 +1,38 @@ +module Orb + module Resources + class Customers + class Costs + def list: + ( + String customer_id, + ?Orb::Models::Customers::CostListParams | Hash[Symbol, top] params + ) -> Orb::Models::Customers::CostListResponse + | ( + String customer_id, + currency: String?, + timeframe_end: Time?, + timeframe_start: Time?, + view_mode: Orb::Models::Customers::CostListParams::view_mode?, + request_options: Orb::request_opts + ) -> Orb::Models::Customers::CostListResponse + + def list_by_external_id: + ( + String external_customer_id, + ?Orb::Models::Customers::CostListByExternalIDParams + | Hash[Symbol, top] params + ) -> Orb::Models::Customers::CostListByExternalIDResponse + | ( + String external_customer_id, + currency: String?, + timeframe_end: Time?, + timeframe_start: Time?, + view_mode: Orb::Models::Customers::CostListByExternalIDParams::view_mode?, + request_options: Orb::request_opts + ) -> Orb::Models::Customers::CostListByExternalIDResponse + + def initialize: (client: Orb::Client) -> void + end + end + end +end diff --git a/sig/orb/resources/customers/credits.rbs b/sig/orb/resources/customers/credits.rbs new file mode 100644 index 00000000..ed1c5b06 --- /dev/null +++ b/sig/orb/resources/customers/credits.rbs @@ -0,0 +1,42 @@ +module Orb + module Resources + class Customers + class Credits + attr_reader ledger: Orb::Resources::Customers::Credits::Ledger + + attr_reader top_ups: Orb::Resources::Customers::Credits::TopUps + + def list: + ( + String customer_id, + ?Orb::Models::Customers::CreditListParams | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::Customers::CreditListResponse] + | ( + String customer_id, + currency: String?, + cursor: String?, + include_all_blocks: bool, + limit: Integer, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::Customers::CreditListResponse] + + def list_by_external_id: + ( + String external_customer_id, + ?Orb::Models::Customers::CreditListByExternalIDParams + | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::Customers::CreditListByExternalIDResponse] + | ( + String external_customer_id, + currency: String?, + cursor: String?, + include_all_blocks: bool, + limit: Integer, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::Customers::CreditListByExternalIDResponse] + + def initialize: (client: Orb::Client) -> void + end + end + end +end diff --git a/sig/orb/resources/customers/credits/ledger.rbs b/sig/orb/resources/customers/credits/ledger.rbs new file mode 100644 index 00000000..50fc2c24 --- /dev/null +++ b/sig/orb/resources/customers/credits/ledger.rbs @@ -0,0 +1,99 @@ +module Orb + module Resources + class Customers + class Credits + class Ledger + def list: + ( + String customer_id, + ?Orb::Models::Customers::Credits::LedgerListParams + | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::Customers::Credits::ledger_list_response] + | ( + String customer_id, + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + currency: String?, + cursor: String?, + entry_status: Orb::Models::Customers::Credits::LedgerListParams::entry_status?, + entry_type: Orb::Models::Customers::Credits::LedgerListParams::entry_type?, + limit: Integer, + minimum_amount: String?, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::Customers::Credits::ledger_list_response] + + def create_entry: + ( + String customer_id, + Orb::Models::Customers::Credits::LedgerCreateEntryParams + | Hash[Symbol, top] params + ) -> Orb::Models::Customers::Credits::ledger_create_entry_response + | ( + String customer_id, + amount: Float, + entry_type: Orb::Models::Customers::Credits::LedgerCreateEntryParams::entry_type, + currency: String?, + description: String?, + effective_date: Time?, + expiry_date: Time?, + invoice_settings: Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings?, + metadata: Hash[Symbol, String?]?, + per_unit_cost_basis: String?, + target_expiry_date: Date, + block_id: String, + void_reason: Orb::Models::Customers::Credits::LedgerCreateEntryParams::void_reason?, + request_options: Orb::request_opts + ) -> Orb::Models::Customers::Credits::ledger_create_entry_response + + def create_entry_by_external_id: + ( + String external_customer_id, + Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams + | Hash[Symbol, top] params + ) -> Orb::Models::Customers::Credits::ledger_create_entry_by_external_id_response + | ( + String external_customer_id, + amount: Float, + entry_type: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::entry_type, + currency: String?, + description: String?, + effective_date: Time?, + expiry_date: Time?, + invoice_settings: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings?, + metadata: Hash[Symbol, String?]?, + per_unit_cost_basis: String?, + target_expiry_date: Date, + block_id: String, + void_reason: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::void_reason?, + request_options: Orb::request_opts + ) -> Orb::Models::Customers::Credits::ledger_create_entry_by_external_id_response + + def list_by_external_id: + ( + String external_customer_id, + ?Orb::Models::Customers::Credits::LedgerListByExternalIDParams + | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::Customers::Credits::ledger_list_by_external_id_response] + | ( + String external_customer_id, + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + currency: String?, + cursor: String?, + entry_status: Orb::Models::Customers::Credits::LedgerListByExternalIDParams::entry_status?, + entry_type: Orb::Models::Customers::Credits::LedgerListByExternalIDParams::entry_type?, + limit: Integer, + minimum_amount: String?, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::Customers::Credits::ledger_list_by_external_id_response] + + def initialize: (client: Orb::Client) -> void + end + end + end + end +end diff --git a/sig/orb/resources/customers/credits/top_ups.rbs b/sig/orb/resources/customers/credits/top_ups.rbs new file mode 100644 index 00000000..9ce30d68 --- /dev/null +++ b/sig/orb/resources/customers/credits/top_ups.rbs @@ -0,0 +1,97 @@ +module Orb + module Resources + class Customers + class Credits + class TopUps + def create: + ( + String customer_id, + Orb::Models::Customers::Credits::TopUpCreateParams + | Hash[Symbol, top] params + ) -> Orb::Models::Customers::Credits::TopUpCreateResponse + | ( + String customer_id, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateParams::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: Integer?, + expires_after_unit: Orb::Models::Customers::Credits::TopUpCreateParams::expires_after_unit?, + request_options: Orb::request_opts + ) -> Orb::Models::Customers::Credits::TopUpCreateResponse + + def list: + ( + String customer_id, + ?Orb::Models::Customers::Credits::TopUpListParams + | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::Customers::Credits::TopUpListResponse] + | ( + String customer_id, + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::Customers::Credits::TopUpListResponse] + + def delete: + ( + String top_up_id, + Orb::Models::Customers::Credits::TopUpDeleteParams + | Hash[Symbol, top] params + ) -> nil + | ( + String top_up_id, + customer_id: String, + request_options: Orb::request_opts + ) -> nil + + def create_by_external_id: + ( + String external_customer_id, + Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams + | Hash[Symbol, top] params + ) -> Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse + | ( + String external_customer_id, + amount: String, + currency: String, + invoice_settings: Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::InvoiceSettings, + per_unit_cost_basis: String, + threshold: String, + expires_after: Integer?, + expires_after_unit: Orb::Models::Customers::Credits::TopUpCreateByExternalIDParams::expires_after_unit?, + request_options: Orb::request_opts + ) -> Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse + + def delete_by_external_id: + ( + String top_up_id, + Orb::Models::Customers::Credits::TopUpDeleteByExternalIDParams + | Hash[Symbol, top] params + ) -> nil + | ( + String top_up_id, + external_customer_id: String, + request_options: Orb::request_opts + ) -> nil + + def list_by_external_id: + ( + String external_customer_id, + ?Orb::Models::Customers::Credits::TopUpListByExternalIDParams + | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::Customers::Credits::TopUpListByExternalIDResponse] + | ( + String external_customer_id, + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::Customers::Credits::TopUpListByExternalIDResponse] + + def initialize: (client: Orb::Client) -> void + end + end + end + end +end diff --git a/sig/orb/resources/dimensional_price_groups.rbs b/sig/orb/resources/dimensional_price_groups.rbs new file mode 100644 index 00000000..7be70a80 --- /dev/null +++ b/sig/orb/resources/dimensional_price_groups.rbs @@ -0,0 +1,45 @@ +module Orb + module Resources + class DimensionalPriceGroups + attr_reader external_dimensional_price_group_id: Orb::Resources::DimensionalPriceGroups::ExternalDimensionalPriceGroupID + + def create: + ( + Orb::Models::DimensionalPriceGroupCreateParams + | Hash[Symbol, top] params + ) -> Orb::Models::DimensionalPriceGroup + | ( + billable_metric_id: String, + dimensions: Array[String], + name: String, + external_dimensional_price_group_id: String?, + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> Orb::Models::DimensionalPriceGroup + + def retrieve: + ( + String dimensional_price_group_id, + ?Orb::Models::DimensionalPriceGroupRetrieveParams + | Hash[Symbol, top] params + ) -> Orb::Models::DimensionalPriceGroup + | ( + String dimensional_price_group_id, + request_options: Orb::request_opts + ) -> Orb::Models::DimensionalPriceGroup + + def list: + ( + ?Orb::Models::DimensionalPriceGroupListParams + | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::DimensionalPriceGroup] + | ( + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::DimensionalPriceGroup] + + def initialize: (client: Orb::Client) -> void + end + end +end diff --git a/sig/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rbs b/sig/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rbs new file mode 100644 index 00000000..310bef43 --- /dev/null +++ b/sig/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.rbs @@ -0,0 +1,20 @@ +module Orb + module Resources + class DimensionalPriceGroups + class ExternalDimensionalPriceGroupID + def retrieve: + ( + String external_dimensional_price_group_id, + ?Orb::Models::DimensionalPriceGroups::ExternalDimensionalPriceGroupIDRetrieveParams + | Hash[Symbol, top] params + ) -> Orb::Models::DimensionalPriceGroup + | ( + String external_dimensional_price_group_id, + request_options: Orb::request_opts + ) -> Orb::Models::DimensionalPriceGroup + + def initialize: (client: Orb::Client) -> void + end + end + end +end diff --git a/sig/orb/resources/events.rbs b/sig/orb/resources/events.rbs new file mode 100644 index 00000000..ffcb433d --- /dev/null +++ b/sig/orb/resources/events.rbs @@ -0,0 +1,58 @@ +module Orb + module Resources + class Events + attr_reader backfills: Orb::Resources::Events::Backfills + + attr_reader volume: Orb::Resources::Events::Volume + + def update: + ( + String event_id, + Orb::Models::EventUpdateParams | Hash[Symbol, top] params + ) -> Orb::Models::EventUpdateResponse + | ( + String event_id, + event_name: String, + properties: top, + timestamp: Time, + customer_id: String?, + external_customer_id: String?, + request_options: Orb::request_opts + ) -> Orb::Models::EventUpdateResponse + + def deprecate: + ( + String event_id, + ?Orb::Models::EventDeprecateParams | Hash[Symbol, top] params + ) -> Orb::Models::EventDeprecateResponse + | ( + String event_id, + request_options: Orb::request_opts + ) -> Orb::Models::EventDeprecateResponse + + def ingest: + ( + Orb::Models::EventIngestParams | Hash[Symbol, top] params + ) -> Orb::Models::EventIngestResponse + | ( + events: Array[Orb::Models::EventIngestParams::Event], + backfill_id: String?, + debug: bool, + request_options: Orb::request_opts + ) -> Orb::Models::EventIngestResponse + + def search: + ( + Orb::Models::EventSearchParams | Hash[Symbol, top] params + ) -> Orb::Models::EventSearchResponse + | ( + event_ids: Array[String], + timeframe_end: Time?, + timeframe_start: Time?, + request_options: Orb::request_opts + ) -> Orb::Models::EventSearchResponse + + def initialize: (client: Orb::Client) -> void + end + end +end diff --git a/sig/orb/resources/events/backfills.rbs b/sig/orb/resources/events/backfills.rbs new file mode 100644 index 00000000..47a774f4 --- /dev/null +++ b/sig/orb/resources/events/backfills.rbs @@ -0,0 +1,65 @@ +module Orb + module Resources + class Events + class Backfills + def create: + ( + Orb::Models::Events::BackfillCreateParams | Hash[Symbol, top] params + ) -> Orb::Models::Events::BackfillCreateResponse + | ( + timeframe_end: Time, + timeframe_start: Time, + close_time: Time?, + customer_id: String?, + deprecation_filter: String?, + external_customer_id: String?, + replace_existing_events: bool, + request_options: Orb::request_opts + ) -> Orb::Models::Events::BackfillCreateResponse + + def list: + ( + ?Orb::Models::Events::BackfillListParams | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::Events::BackfillListResponse] + | ( + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::Events::BackfillListResponse] + + def close: + ( + String backfill_id, + ?Orb::Models::Events::BackfillCloseParams | Hash[Symbol, top] params + ) -> Orb::Models::Events::BackfillCloseResponse + | ( + String backfill_id, + request_options: Orb::request_opts + ) -> Orb::Models::Events::BackfillCloseResponse + + def fetch: + ( + String backfill_id, + ?Orb::Models::Events::BackfillFetchParams | Hash[Symbol, top] params + ) -> Orb::Models::Events::BackfillFetchResponse + | ( + String backfill_id, + request_options: Orb::request_opts + ) -> Orb::Models::Events::BackfillFetchResponse + + def revert: + ( + String backfill_id, + ?Orb::Models::Events::BackfillRevertParams + | Hash[Symbol, top] params + ) -> Orb::Models::Events::BackfillRevertResponse + | ( + String backfill_id, + request_options: Orb::request_opts + ) -> Orb::Models::Events::BackfillRevertResponse + + def initialize: (client: Orb::Client) -> void + end + end + end +end diff --git a/sig/orb/resources/events/volume.rbs b/sig/orb/resources/events/volume.rbs new file mode 100644 index 00000000..ffba2743 --- /dev/null +++ b/sig/orb/resources/events/volume.rbs @@ -0,0 +1,21 @@ +module Orb + module Resources + class Events + class Volume + def list: + ( + Orb::Models::Events::VolumeListParams | Hash[Symbol, top] params + ) -> Orb::Models::Events::EventVolumes + | ( + timeframe_start: Time, + cursor: String?, + limit: Integer, + timeframe_end: Time, + request_options: Orb::request_opts + ) -> Orb::Models::Events::EventVolumes + + def initialize: (client: Orb::Client) -> void + end + end + end +end diff --git a/sig/orb/resources/invoice_line_items.rbs b/sig/orb/resources/invoice_line_items.rbs new file mode 100644 index 00000000..724b8182 --- /dev/null +++ b/sig/orb/resources/invoice_line_items.rbs @@ -0,0 +1,21 @@ +module Orb + module Resources + class InvoiceLineItems + def create: + ( + Orb::Models::InvoiceLineItemCreateParams | Hash[Symbol, top] params + ) -> Orb::Models::InvoiceLineItemCreateResponse + | ( + amount: String, + end_date: Date, + invoice_id: String, + name: String, + quantity: Float, + start_date: Date, + request_options: Orb::request_opts + ) -> Orb::Models::InvoiceLineItemCreateResponse + + def initialize: (client: Orb::Client) -> void + end + end +end diff --git a/sig/orb/resources/invoices.rbs b/sig/orb/resources/invoices.rbs new file mode 100644 index 00000000..c67cf40b --- /dev/null +++ b/sig/orb/resources/invoices.rbs @@ -0,0 +1,126 @@ +module Orb + module Resources + class Invoices + def create: + ( + Orb::Models::InvoiceCreateParams | Hash[Symbol, top] params + ) -> Orb::Models::Invoice + | ( + currency: String, + invoice_date: Time, + line_items: Array[Orb::Models::InvoiceCreateParams::LineItem], + net_terms: Integer, + customer_id: String?, + discount: Orb::Models::discount?, + external_customer_id: String?, + memo: String?, + metadata: Hash[Symbol, String?]?, + will_auto_issue: bool, + request_options: Orb::request_opts + ) -> Orb::Models::Invoice + + def update: + ( + String invoice_id, + ?Orb::Models::InvoiceUpdateParams | Hash[Symbol, top] params + ) -> Orb::Models::Invoice + | ( + String invoice_id, + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> Orb::Models::Invoice + + def list: + ( + ?Orb::Models::InvoiceListParams | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::Invoice] + | ( + amount: String?, + amount_gt: String?, + amount_lt: String?, + cursor: String?, + customer_id: String?, + date_type: Orb::Models::InvoiceListParams::date_type?, + due_date: Date?, + due_date_window: String?, + due_date_gt: Date?, + due_date_lt: Date?, + external_customer_id: String?, + invoice_date_gt: Time?, + invoice_date_gte: Time?, + invoice_date_lt: Time?, + invoice_date_lte: Time?, + is_recurring: bool?, + limit: Integer, + status: Array[Orb::Models::InvoiceListParams::status]?, + subscription_id: String?, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::Invoice] + + def fetch: + ( + String invoice_id, + ?Orb::Models::InvoiceFetchParams | Hash[Symbol, top] params + ) -> Orb::Models::Invoice + | ( + String invoice_id, + request_options: Orb::request_opts + ) -> Orb::Models::Invoice + + def fetch_upcoming: + ( + Orb::Models::InvoiceFetchUpcomingParams | Hash[Symbol, top] params + ) -> Orb::Models::InvoiceFetchUpcomingResponse + | ( + subscription_id: String, + request_options: Orb::request_opts + ) -> Orb::Models::InvoiceFetchUpcomingResponse + + def issue: + ( + String invoice_id, + ?Orb::Models::InvoiceIssueParams | Hash[Symbol, top] params + ) -> Orb::Models::Invoice + | ( + String invoice_id, + synchronous: bool, + request_options: Orb::request_opts + ) -> Orb::Models::Invoice + + def mark_paid: + ( + String invoice_id, + Orb::Models::InvoiceMarkPaidParams | Hash[Symbol, top] params + ) -> Orb::Models::Invoice + | ( + String invoice_id, + payment_received_date: Date, + external_id: String?, + notes: String?, + request_options: Orb::request_opts + ) -> Orb::Models::Invoice + + def pay: + ( + String invoice_id, + ?Orb::Models::InvoicePayParams | Hash[Symbol, top] params + ) -> Orb::Models::Invoice + | ( + String invoice_id, + request_options: Orb::request_opts + ) -> Orb::Models::Invoice + + def `void`: + ( + String invoice_id, + ?Orb::Models::InvoiceVoidParams | Hash[Symbol, top] params + ) -> Orb::Models::Invoice + | ( + String invoice_id, + request_options: Orb::request_opts + ) -> Orb::Models::Invoice + + def initialize: (client: Orb::Client) -> void + end + end +end diff --git a/sig/orb/resources/items.rbs b/sig/orb/resources/items.rbs new file mode 100644 index 00000000..f84c2851 --- /dev/null +++ b/sig/orb/resources/items.rbs @@ -0,0 +1,48 @@ +module Orb + module Resources + class Items + def create: + ( + Orb::Models::ItemCreateParams | Hash[Symbol, top] params + ) -> Orb::Models::Item + | ( + name: String, + request_options: Orb::request_opts + ) -> Orb::Models::Item + + def update: + ( + String item_id, + ?Orb::Models::ItemUpdateParams | Hash[Symbol, top] params + ) -> Orb::Models::Item + | ( + String item_id, + external_connections: Array[Orb::Models::ItemUpdateParams::ExternalConnection]?, + name: String?, + request_options: Orb::request_opts + ) -> Orb::Models::Item + + def list: + ( + ?Orb::Models::ItemListParams | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::Item] + | ( + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::Item] + + def fetch: + ( + String item_id, + ?Orb::Models::ItemFetchParams | Hash[Symbol, top] params + ) -> Orb::Models::Item + | ( + String item_id, + request_options: Orb::request_opts + ) -> Orb::Models::Item + + def initialize: (client: Orb::Client) -> void + end + end +end diff --git a/sig/orb/resources/metrics.rbs b/sig/orb/resources/metrics.rbs new file mode 100644 index 00000000..6854849d --- /dev/null +++ b/sig/orb/resources/metrics.rbs @@ -0,0 +1,55 @@ +module Orb + module Resources + class Metrics + def create: + ( + Orb::Models::MetricCreateParams | Hash[Symbol, top] params + ) -> Orb::Models::BillableMetric + | ( + description: String?, + item_id: String, + name: String, + sql: String, + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> Orb::Models::BillableMetric + + def update: + ( + String metric_id, + ?Orb::Models::MetricUpdateParams | Hash[Symbol, top] params + ) -> Orb::Models::BillableMetric + | ( + String metric_id, + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> Orb::Models::BillableMetric + + def list: + ( + ?Orb::Models::MetricListParams | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::BillableMetric] + | ( + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::BillableMetric] + + def fetch: + ( + String metric_id, + ?Orb::Models::MetricFetchParams | Hash[Symbol, top] params + ) -> Orb::Models::BillableMetric + | ( + String metric_id, + request_options: Orb::request_opts + ) -> Orb::Models::BillableMetric + + def initialize: (client: Orb::Client) -> void + end + end +end diff --git a/sig/orb/resources/plans.rbs b/sig/orb/resources/plans.rbs new file mode 100644 index 00000000..0701d874 --- /dev/null +++ b/sig/orb/resources/plans.rbs @@ -0,0 +1,62 @@ +module Orb + module Resources + class Plans + attr_reader external_plan_id: Orb::Resources::Plans::ExternalPlanID + + def create: + ( + Orb::Models::PlanCreateParams | Hash[Symbol, top] params + ) -> Orb::Models::Plan + | ( + currency: String, + name: String, + prices: Array[Orb::Models::PlanCreateParams::price], + default_invoice_memo: String?, + external_plan_id: String?, + metadata: Hash[Symbol, String?]?, + net_terms: Integer?, + status: Orb::Models::PlanCreateParams::status, + request_options: Orb::request_opts + ) -> Orb::Models::Plan + + def update: + ( + String plan_id, + ?Orb::Models::PlanUpdateParams | Hash[Symbol, top] params + ) -> Orb::Models::Plan + | ( + String plan_id, + external_plan_id: String?, + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> Orb::Models::Plan + + def list: + ( + ?Orb::Models::PlanListParams | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::Plan] + | ( + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + cursor: String?, + limit: Integer, + status: Orb::Models::PlanListParams::status, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::Plan] + + def fetch: + ( + String plan_id, + ?Orb::Models::PlanFetchParams | Hash[Symbol, top] params + ) -> Orb::Models::Plan + | ( + String plan_id, + request_options: Orb::request_opts + ) -> Orb::Models::Plan + + def initialize: (client: Orb::Client) -> void + end + end +end diff --git a/sig/orb/resources/plans/external_plan_id.rbs b/sig/orb/resources/plans/external_plan_id.rbs new file mode 100644 index 00000000..f6a65576 --- /dev/null +++ b/sig/orb/resources/plans/external_plan_id.rbs @@ -0,0 +1,33 @@ +module Orb + module Resources + class Plans + class ExternalPlanID + def update: + ( + String other_external_plan_id, + ?Orb::Models::Plans::ExternalPlanIDUpdateParams + | Hash[Symbol, top] params + ) -> Orb::Models::Plan + | ( + String other_external_plan_id, + external_plan_id: String?, + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> Orb::Models::Plan + + def fetch: + ( + String external_plan_id, + ?Orb::Models::Plans::ExternalPlanIDFetchParams + | Hash[Symbol, top] params + ) -> Orb::Models::Plan + | ( + String external_plan_id, + request_options: Orb::request_opts + ) -> Orb::Models::Plan + + def initialize: (client: Orb::Client) -> void + end + end + end +end diff --git a/sig/orb/resources/prices.rbs b/sig/orb/resources/prices.rbs new file mode 100644 index 00000000..948071eb --- /dev/null +++ b/sig/orb/resources/prices.rbs @@ -0,0 +1,105 @@ +module Orb + module Resources + class Prices + attr_reader external_price_id: Orb::Resources::Prices::ExternalPriceID + + def create: + ( + Orb::Models::PriceCreateParams | Hash[Symbol, top] params + ) -> Orb::Models::price + | ( + cadence: Orb::Models::PriceCreateParams::cadence, + currency: String, + item_id: String, + model_type: Orb::Models::PriceCreateParams::model_type, + name: String, + unit_config: Orb::Models::PriceCreateParams::UnitConfig, + billable_metric_id: String?, + billed_in_advance: bool?, + billing_cycle_configuration: Orb::Models::PriceCreateParams::BillingCycleConfiguration?, + conversion_rate: Float?, + external_price_id: String?, + fixed_price_quantity: Float?, + invoice_grouping_key: String?, + invoicing_cycle_configuration: Orb::Models::PriceCreateParams::InvoicingCycleConfiguration?, + metadata: Hash[Symbol, String?]?, + package_config: Orb::Models::PriceCreateParams::PackageConfig, + matrix_config: Orb::Models::PriceCreateParams::MatrixConfig, + matrix_with_allocation_config: Orb::Models::PriceCreateParams::MatrixWithAllocationConfig, + tiered_config: Orb::Models::PriceCreateParams::TieredConfig, + tiered_bps_config: Orb::Models::PriceCreateParams::TieredBpsConfig, + bps_config: Orb::Models::PriceCreateParams::BpsConfig, + bulk_bps_config: Orb::Models::PriceCreateParams::BulkBpsConfig, + bulk_config: Orb::Models::PriceCreateParams::BulkConfig, + threshold_total_amount_config: Hash[Symbol, top], + tiered_package_config: Hash[Symbol, top], + grouped_tiered_config: Hash[Symbol, top], + max_group_tiered_package_config: Hash[Symbol, top], + tiered_with_minimum_config: Hash[Symbol, top], + package_with_allocation_config: Hash[Symbol, top], + tiered_package_with_minimum_config: Hash[Symbol, top], + unit_with_percent_config: Hash[Symbol, top], + tiered_with_proration_config: Hash[Symbol, top], + unit_with_proration_config: Hash[Symbol, top], + grouped_allocation_config: Hash[Symbol, top], + grouped_with_prorated_minimum_config: Hash[Symbol, top], + grouped_with_metered_minimum_config: Hash[Symbol, top], + matrix_with_display_name_config: Hash[Symbol, top], + bulk_with_proration_config: Hash[Symbol, top], + grouped_tiered_package_config: Hash[Symbol, top], + scalable_matrix_with_unit_pricing_config: Hash[Symbol, top], + scalable_matrix_with_tiered_pricing_config: Hash[Symbol, top], + request_options: Orb::request_opts + ) -> Orb::Models::price + + def update: + ( + String price_id, + ?Orb::Models::PriceUpdateParams | Hash[Symbol, top] params + ) -> Orb::Models::price + | ( + String price_id, + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> Orb::Models::price + + def list: + ( + ?Orb::Models::PriceListParams | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::price] + | ( + cursor: String?, + limit: Integer, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::price] + + def evaluate: + ( + String price_id, + Orb::Models::PriceEvaluateParams | Hash[Symbol, top] params + ) -> Orb::Models::PriceEvaluateResponse + | ( + String price_id, + timeframe_end: Time, + timeframe_start: Time, + customer_id: String?, + external_customer_id: String?, + filter: String?, + grouping_keys: Array[String], + request_options: Orb::request_opts + ) -> Orb::Models::PriceEvaluateResponse + + def fetch: + ( + String price_id, + ?Orb::Models::PriceFetchParams | Hash[Symbol, top] params + ) -> Orb::Models::price + | ( + String price_id, + request_options: Orb::request_opts + ) -> Orb::Models::price + + def initialize: (client: Orb::Client) -> void + end + end +end diff --git a/sig/orb/resources/prices/external_price_id.rbs b/sig/orb/resources/prices/external_price_id.rbs new file mode 100644 index 00000000..24eeaff7 --- /dev/null +++ b/sig/orb/resources/prices/external_price_id.rbs @@ -0,0 +1,32 @@ +module Orb + module Resources + class Prices + class ExternalPriceID + def update: + ( + String external_price_id, + ?Orb::Models::Prices::ExternalPriceIDUpdateParams + | Hash[Symbol, top] params + ) -> Orb::Models::price + | ( + String external_price_id, + metadata: Hash[Symbol, String?]?, + request_options: Orb::request_opts + ) -> Orb::Models::price + + def fetch: + ( + String external_price_id, + ?Orb::Models::Prices::ExternalPriceIDFetchParams + | Hash[Symbol, top] params + ) -> Orb::Models::price + | ( + String external_price_id, + request_options: Orb::request_opts + ) -> Orb::Models::price + + def initialize: (client: Orb::Client) -> void + end + end + end +end diff --git a/sig/orb/resources/subscriptions.rbs b/sig/orb/resources/subscriptions.rbs new file mode 100644 index 00000000..e30c1333 --- /dev/null +++ b/sig/orb/resources/subscriptions.rbs @@ -0,0 +1,274 @@ +module Orb + module Resources + class Subscriptions + def create: + ( + ?Orb::Models::SubscriptionCreateParams | Hash[Symbol, top] params + ) -> Orb::Models::SubscriptionCreateResponse + | ( + add_adjustments: Array[Orb::Models::SubscriptionCreateParams::AddAdjustment]?, + add_prices: Array[Orb::Models::SubscriptionCreateParams::AddPrice]?, + align_billing_with_subscription_start_date: bool, + auto_collection: bool?, + aws_region: String?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionCreateParams::BillingCycleAnchorConfiguration?, + coupon_redemption_code: String?, + credits_overage_rate: Float?, + customer_id: String?, + default_invoice_memo: String?, + end_date: Time?, + external_customer_id: String?, + external_marketplace: Orb::Models::SubscriptionCreateParams::external_marketplace?, + external_marketplace_reporting_id: String?, + external_plan_id: String?, + filter: String?, + initial_phase_order: Integer?, + invoicing_threshold: String?, + metadata: Hash[Symbol, String?]?, + net_terms: Integer?, + per_credit_overage_amount: Float?, + plan_id: String?, + plan_version_number: Integer?, + price_overrides: Array[top]?, + remove_adjustments: Array[Orb::Models::SubscriptionCreateParams::RemoveAdjustment]?, + remove_prices: Array[Orb::Models::SubscriptionCreateParams::RemovePrice]?, + replace_adjustments: Array[Orb::Models::SubscriptionCreateParams::ReplaceAdjustment]?, + replace_prices: Array[Orb::Models::SubscriptionCreateParams::ReplacePrice]?, + start_date: Time?, + trial_duration_days: Integer?, + request_options: Orb::request_opts + ) -> Orb::Models::SubscriptionCreateResponse + + def update: + ( + String subscription_id, + ?Orb::Models::SubscriptionUpdateParams | Hash[Symbol, top] params + ) -> Orb::Models::Subscription + | ( + String subscription_id, + auto_collection: bool?, + default_invoice_memo: String?, + invoicing_threshold: String?, + metadata: Hash[Symbol, String?]?, + net_terms: Integer?, + request_options: Orb::request_opts + ) -> Orb::Models::Subscription + + def list: + ( + ?Orb::Models::SubscriptionListParams | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::Subscription] + | ( + created_at_gt: Time?, + created_at_gte: Time?, + created_at_lt: Time?, + created_at_lte: Time?, + cursor: String?, + customer_id: Array[String]?, + external_customer_id: String?, + limit: Integer, + status: Orb::Models::SubscriptionListParams::status?, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::Subscription] + + def cancel: + ( + String subscription_id, + Orb::Models::SubscriptionCancelParams | Hash[Symbol, top] params + ) -> Orb::Models::SubscriptionCancelResponse + | ( + String subscription_id, + cancel_option: Orb::Models::SubscriptionCancelParams::cancel_option, + cancellation_date: Time?, + request_options: Orb::request_opts + ) -> Orb::Models::SubscriptionCancelResponse + + def fetch: + ( + String subscription_id, + ?Orb::Models::SubscriptionFetchParams | Hash[Symbol, top] params + ) -> Orb::Models::Subscription + | ( + String subscription_id, + request_options: Orb::request_opts + ) -> Orb::Models::Subscription + + def fetch_costs: + ( + String subscription_id, + ?Orb::Models::SubscriptionFetchCostsParams | Hash[Symbol, top] params + ) -> Orb::Models::SubscriptionFetchCostsResponse + | ( + String subscription_id, + currency: String?, + timeframe_end: Time?, + timeframe_start: Time?, + view_mode: Orb::Models::SubscriptionFetchCostsParams::view_mode?, + request_options: Orb::request_opts + ) -> Orb::Models::SubscriptionFetchCostsResponse + + def fetch_schedule: + ( + String subscription_id, + ?Orb::Models::SubscriptionFetchScheduleParams + | Hash[Symbol, top] params + ) -> Orb::Page[Orb::Models::SubscriptionFetchScheduleResponse] + | ( + String subscription_id, + cursor: String?, + limit: Integer, + start_date_gt: Time?, + start_date_gte: Time?, + start_date_lt: Time?, + start_date_lte: Time?, + request_options: Orb::request_opts + ) -> Orb::Page[Orb::Models::SubscriptionFetchScheduleResponse] + + def fetch_usage: + ( + String subscription_id, + ?Orb::Models::SubscriptionFetchUsageParams | Hash[Symbol, top] params + ) -> Orb::Models::subscription_usage + | ( + String subscription_id, + billable_metric_id: String?, + first_dimension_key: String?, + first_dimension_value: String?, + granularity: Orb::Models::SubscriptionFetchUsageParams::granularity?, + group_by: String?, + second_dimension_key: String?, + second_dimension_value: String?, + timeframe_end: Time?, + timeframe_start: Time?, + view_mode: Orb::Models::SubscriptionFetchUsageParams::view_mode?, + request_options: Orb::request_opts + ) -> Orb::Models::subscription_usage + + def price_intervals: + ( + String subscription_id, + ?Orb::Models::SubscriptionPriceIntervalsParams + | Hash[Symbol, top] params + ) -> Orb::Models::SubscriptionPriceIntervalsResponse + | ( + String subscription_id, + add: Array[Orb::Models::SubscriptionPriceIntervalsParams::Add], + add_adjustments: Array[Orb::Models::SubscriptionPriceIntervalsParams::AddAdjustment], + edit: Array[Orb::Models::SubscriptionPriceIntervalsParams::Edit], + edit_adjustments: Array[Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment], + request_options: Orb::request_opts + ) -> Orb::Models::SubscriptionPriceIntervalsResponse + + def schedule_plan_change: + ( + String subscription_id, + Orb::Models::SubscriptionSchedulePlanChangeParams + | Hash[Symbol, top] params + ) -> Orb::Models::SubscriptionSchedulePlanChangeResponse + | ( + String subscription_id, + change_option: Orb::Models::SubscriptionSchedulePlanChangeParams::change_option, + add_adjustments: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddAdjustment]?, + add_prices: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::AddPrice]?, + align_billing_with_plan_change_date: bool?, + auto_collection: bool?, + billing_cycle_alignment: Orb::Models::SubscriptionSchedulePlanChangeParams::billing_cycle_alignment?, + billing_cycle_anchor_configuration: Orb::Models::SubscriptionSchedulePlanChangeParams::BillingCycleAnchorConfiguration?, + change_date: Time?, + coupon_redemption_code: String?, + credits_overage_rate: Float?, + default_invoice_memo: String?, + external_plan_id: String?, + filter: String?, + initial_phase_order: Integer?, + invoicing_threshold: String?, + net_terms: Integer?, + per_credit_overage_amount: Float?, + plan_id: String?, + plan_version_number: Integer?, + price_overrides: Array[top]?, + remove_adjustments: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::RemoveAdjustment]?, + remove_prices: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::RemovePrice]?, + replace_adjustments: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment]?, + replace_prices: Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice]?, + trial_duration_days: Integer?, + request_options: Orb::request_opts + ) -> Orb::Models::SubscriptionSchedulePlanChangeResponse + + def trigger_phase: + ( + String subscription_id, + ?Orb::Models::SubscriptionTriggerPhaseParams + | Hash[Symbol, top] params + ) -> Orb::Models::SubscriptionTriggerPhaseResponse + | ( + String subscription_id, + effective_date: Date?, + request_options: Orb::request_opts + ) -> Orb::Models::SubscriptionTriggerPhaseResponse + + def unschedule_cancellation: + ( + String subscription_id, + ?Orb::Models::SubscriptionUnscheduleCancellationParams + | Hash[Symbol, top] params + ) -> Orb::Models::SubscriptionUnscheduleCancellationResponse + | ( + String subscription_id, + request_options: Orb::request_opts + ) -> Orb::Models::SubscriptionUnscheduleCancellationResponse + + def unschedule_fixed_fee_quantity_updates: + ( + String subscription_id, + Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesParams + | Hash[Symbol, top] params + ) -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse + | ( + String subscription_id, + price_id: String, + request_options: Orb::request_opts + ) -> Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse + + def unschedule_pending_plan_changes: + ( + String subscription_id, + ?Orb::Models::SubscriptionUnschedulePendingPlanChangesParams + | Hash[Symbol, top] params + ) -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse + | ( + String subscription_id, + request_options: Orb::request_opts + ) -> Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse + + def update_fixed_fee_quantity: + ( + String subscription_id, + Orb::Models::SubscriptionUpdateFixedFeeQuantityParams + | Hash[Symbol, top] params + ) -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse + | ( + String subscription_id, + price_id: String, + quantity: Float, + change_option: Orb::Models::SubscriptionUpdateFixedFeeQuantityParams::change_option, + effective_date: Date?, + request_options: Orb::request_opts + ) -> Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse + + def update_trial: + ( + String subscription_id, + Orb::Models::SubscriptionUpdateTrialParams | Hash[Symbol, top] params + ) -> Orb::Models::SubscriptionUpdateTrialResponse + | ( + String subscription_id, + trial_end_date: Orb::Models::SubscriptionUpdateTrialParams::trial_end_date, + shift: bool, + request_options: Orb::request_opts + ) -> Orb::Models::SubscriptionUpdateTrialResponse + + def initialize: (client: Orb::Client) -> void + end + end +end diff --git a/sig/orb/resources/top_level.rbs b/sig/orb/resources/top_level.rbs new file mode 100644 index 00000000..d37c9025 --- /dev/null +++ b/sig/orb/resources/top_level.rbs @@ -0,0 +1,15 @@ +module Orb + module Resources + class TopLevel + def ping: + ( + ?Orb::Models::TopLevelPingParams | Hash[Symbol, top] params + ) -> Orb::Models::TopLevelPingResponse + | ( + request_options: Orb::request_opts + ) -> Orb::Models::TopLevelPingResponse + + def initialize: (client: Orb::Client) -> void + end + end +end diff --git a/sig/orb/util.rbs b/sig/orb/util.rbs new file mode 100644 index 00000000..fd04457b --- /dev/null +++ b/sig/orb/util.rbs @@ -0,0 +1,81 @@ +module Orb + module Util + def self?.primitive?: (top input) -> (bool | top) + + def self?.coerce_boolean: (top input) -> (bool | top) + + def self?.coerce_boolean!: (top input) -> bool? + + def self?.coerce_integer: (top input) -> (Integer | top) + + def self?.coerce_float: (top input) -> (Float | top) + + def self?.coerce_hash: (top input) -> (Hash[top, top] | top) + + def self?.suppress: ( + *Array[Exception] exceptions, + sentinel: top? + ) { + -> top? + } -> top? + + OMIT: top + + def self?.deep_merge: ( + *Array[top] values, + sentinel: top?, + concat: bool + ) -> top + + def self?.dig: ( + Hash[Symbol, top] | Array[top] | top data, + (Symbol | Integer | Array[(Symbol | Integer)])? pick, + ?top? sentinel + ) { + -> top? + } -> top? + + def self?.uri_origin: (URI::Generic uri) -> String + + def self?.interpolate_path: (String | Array[String] path) -> String + + type parsed_uri = + { + scheme: String?, + host: String?, + port: Integer?, + path: String?, + query: Hash[String, Array[String]] + } + + def self?.parse_uri: (URI::Generic | String url) -> Orb::Util::parsed_uri + + def self?.unparse_uri: (Orb::Util::parsed_uri parsed) -> URI::Generic + + def self?.join_parsed_uri: ( + Orb::Util::parsed_uri lhs, + Orb::Util::parsed_uri rhs + ) -> URI::Generic + + def self?.decode_query: (String? query) -> Hash[String, Array[String]] + + def self?.encode_query: ( + Hash[String, (Array[String] | String)?] query + ) -> String? + + def self?.normalized_headers: ( + *Array[Hash[String, (String | Integer)?]] headers + ) -> Hash[String, String] + + def self?.encode_content: (Hash[String, String] headers, top body) -> top + + def self?.decode_content: (top response, suppress_error: bool) -> top + + def self?.encode_multipart_formdata: ( + StringIO io, + boundary: String, + key: Symbol | String, + val: top + ) -> void + end +end diff --git a/sig/orb/version.rbs b/sig/orb/version.rbs new file mode 100644 index 00000000..522ee877 --- /dev/null +++ b/sig/orb/version.rbs @@ -0,0 +1,3 @@ +module Orb + VERSION: "0.0.1-alpha.0" +end diff --git a/test/orb/base_model_test.rb b/test/orb/base_model_test.rb new file mode 100644 index 00000000..3e883728 --- /dev/null +++ b/test/orb/base_model_test.rb @@ -0,0 +1,341 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +class Orb::Test::BaseModelTest < Minitest::Test + class E1 < Orb::Enum + A = :a + B = :b + end + + A1 = Orb::ArrayOf[-> { Integer }] + A2 = Orb::ArrayOf[enum: -> { E1 }] + + def test_basic + assert(E1.is_a?(Orb::Converter)) + assert(A1.is_a?(Orb::Converter)) + end + + def test_basic_coerce + assert_pattern do + Orb::Converter.coerce(A1, [1.0, 2.0, 3.0]) => [1, 2, 3] + end + + assert_pattern do + Orb::Converter.coerce(A2, %w[a b c]) => [:a, :b, :c] + end + end + + def test_basic_dump + assert_pattern do + Orb::Converter.dump(A1, [1.0, 2.0, 3.0]) => [1, 2, 3] + end + + assert_pattern do + Orb::Converter.dump(A2, %w[a b c]) => %w[a b c] + end + end + + def test_primitive_try_strict_coerce + d_now = Date.today + t_now = Time.now + + cases = { + [NilClass, :a] => [true, nil, 0], + [NilClass, nil] => [true, nil, 1], + [Integer, 1.0] => [true, 1, 1], + [Float, 1] => [true, 1.0, 1], + [Date, d_now] => [true, d_now, 1], + [Time, t_now] => [true, t_now, 1] + } + + cases.each do |test, expect| + type, input = test + assert_pattern do + Orb::Converter.try_strict_coerce(type, input) => ^expect + end + end + end + + def test_basic_enum_try_strict_coerce + cases = { + :a => [true, :a, 1], + "a" => [true, :a, 1], + :c => [false, true, 0], + 1 => [false, false, 0] + } + + cases.each do |input, expect| + assert_pattern do + Orb::Converter.try_strict_coerce(E1, input) => ^expect + end + end + end + + def test_basic_array_try_strict_coerce + cases = { + [] => [true, [], 0], + nil => [false, false, 0], + [1, 2, 3] => [true, [1, 2, 3], 3], + [1.0, 2.0, 3.0] => [true, [1, 2, 3], 3], + [1, nil, 3] => [true, [1, nil, 3], 2], + [1, nil, nil] => [true, [1, nil, nil], 1], + [1, "two", 3] => [false, true, 2] + } + + cases.each do |input, expect| + assert_pattern do + Orb::Converter.try_strict_coerce(A1, input) => ^expect + end + end + end + + def test_nested_array_try_strict_coerce + cases = { + %w[a b] => [true, [:a, :b], 2], + %w[a b c] => [false, true, 2] + } + + cases.each do |input, expect| + assert_pattern do + Orb::Converter.try_strict_coerce(A2, input) => ^expect + end + end + end + + class M1 < Orb::BaseModel + required :a, Time + optional :b, E1, api_name: :renamed + required :c, A1 + + request_only do + required :w, Integer + optional :x, String + end + + response_only do + required :y, Integer + optional :z, String + end + end + + class M2 < M1 + required :c, M1 + end + + def test_model_accessors + now = Time.now.round(0) + model = M2.new(a: now.to_s, b: "b", renamed: "a", c: [1.0, 2.0, 3.0], w: 1, y: 1) + + cases = [ + [model.a, now], + [model.b, :a], + [model.c, [1, 2, 3]], + [model.w, 1], + [model.y, 1] + ] + + cases.each do |input, expect| + assert_pattern do + input => ^expect + end + end + end + + def test_model_conversion_accessor + model = M2.new(c: {}) + assert_pattern do + model.c => M1 + end + end + + def test_model_equality + now = Time.now + model1 = M2.new(a: now, b: "b", renamed: "a", c: M1.new, w: 1, y: 1) + model2 = M2.new(a: now, b: "b", renamed: "a", c: M1.new, w: 1, y: 1) + + assert_pattern do + model2 => ^model1 + end + end + + def test_basic_model_coerce + cases = { + {} => M2.new, + {a: nil, b: :a, c: [1.0, 2.0, 3.0], w: 1} => M2.new(a: nil, b: :a, c: [1.0, 2.0, 3.0], w: 1) + } + + cases.each do |input, expect| + assert_pattern do + Orb::Converter.coerce(M2, input) => ^expect + end + end + end + + def test_basic_model_dump + cases = { + nil => nil, + {} => {}, + {w: 1, x: "x", y: 1, z: "z"} => {w: 1, x: "x"}, + [1, 2, 3] => [1, 2, 3] + } + + cases.each do |input, expect| + assert_pattern do + Orb::Converter.dump(M2, input) => ^expect + end + end + end + + def test_basic_model_try_strict_coerce + raw = {a: Time.now, c: [2], y: 1} + addn = {x: "x", n: "n"} + expect_exact = M1.new(raw) + expect_addn = M1.new(**raw, **addn) + + cases = { + {} => [false, true, 0], + raw => [true, expect_exact, 3], + {**raw, **addn} => [true, expect_addn, 4] + } + + cases.each do |input, expect| + assert_pattern do + Orb::Converter.try_strict_coerce(M1, input) => ^expect + end + end + end + + def test_nested_model_dump + now = Time.now + models = [M1, M2] + inputs = [ + M1.new(a: now, b: "a", c: [1.0, 2.0, 3.0], y: 1), + {a: now, b: "a", c: [1.0, 2.0, 3.0], y: 1}, + {"a" => now, b: "", "b" => "a", "c" => [], :c => [1.0, 2.0, 3.0], "y" => 1} + ] + + models.product(inputs).each do |model, input| + assert_pattern do + Orb::Converter.dump(model, input) => {a: now, renamed: "a", c: [1, 2, 3]} + end + end + end + + A3 = Orb::ArrayOf[A1] + + class M3 < M1 + optional :b, E1, api_name: :renamed_again + end + + class U1 < Orb::Union + discriminator :type + variant :a, M1 + variant :b, M3 + end + + class U2 < Orb::Union + variant A1 + variant A3 + end + + def test_basic_union + assert(U1.is_a?(Orb::Converter)) + + assert_pattern do + M1.new => U1 + M3.new => U1 + end + end + + def test_basic_discriminated_union_coerce + common = {a: Time.now, c: [], w: 1} + cases = { + nil => nil, + {type: "a", **common} => M1.new(type: "a", **common), + {type: :b, **common} => M3.new(type: :b, **common), + {type: :c, xyz: 1} => {type: :c, xyz: 1} + } + + cases.each do |input, expect| + assert_pattern do + Orb::Converter.coerce(U1, input) => ^expect + end + end + end + + def test_basic_discriminated_union_dump + now = Time.now + cases = { + nil => nil, + M1.new(a: now, b: :a, c: [1.0, 2.0, 3.0], y: 1) => {a: now, renamed: :a, c: [1, 2, 3]}, + M3.new(b: "a", y: 1) => {renamed_again: "a"}, + {type: :a, b: "a", y: 1} => {type: :a, renamed: "a"}, + {type: "b", b: "a", y: 1} => {type: "b", renamed_again: "a"}, + {type: :c, xyz: 1} => {type: :c, xyz: 1} + } + + cases.each do |input, expect| + assert_pattern do + Orb::Converter.dump(U1, input) => ^expect + end + end + end + + def test_basic_undifferentiated_union_try_strict_coerce + cases = { + [] => [true, [], 0], + [[]] => [true, [[]], 0], + # [nil] => [false, true, 0], + [1, 2, 3] => [true, [1, 2, 3], 3], + [[1, 2, 3], [4, 5, 6]] => [true, [[1, 2, 3], [4, 5, 6]], 6] + } + + cases.each do |input, expect| + assert_pattern do + Orb::Converter.try_strict_coerce(U2, input) => ^expect + end + end + end + + class C1 < Orb::BaseModel + required :a, const: :a + required :b, const: :b, nil?: true + optional :c, const: :c + end + + def test_basic_const + assert_pattern do + C1.dump(C1.new) => {a: :a} + C1.new => {a: :a} + C1.new(a: "a") => {a: :a} + C1.new(b: 2) => {b: 2} + C1.new.a => :a + C1.new.b => nil + C1.new.c => nil + end + end + + class E2 < Orb::Enum + A = :a + B = :b + end + + class U3 < Orb::Union + discriminator :type + variant :a, M1 + variant :b, M3 + end + + def test_basic_eql + assert_equal(Orb::Unknown, Orb::Unknown) + refute_equal(Orb::Unknown, Orb::BooleanModel) + assert_equal(Orb::BooleanModel, Orb::BooleanModel) + + assert_equal(E1, E2) + assert_equal(E1, E2) + + refute_equal(U1, U2) + assert_equal(U1, U3) + end +end diff --git a/test/orb/client_test.rb b/test/orb/client_test.rb new file mode 100644 index 00000000..887f5557 --- /dev/null +++ b/test/orb/client_test.rb @@ -0,0 +1,340 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +class OrbTest < Minitest::Test + def setup + Thread.current.thread_variable_set(:mock_sleep, []) + end + + def teardown + Thread.current.thread_variable_set(:mock_sleep, nil) + end + + def test_raises_on_missing_non_nullable_opts + e = assert_raises(ArgumentError) do + Orb::Client.new + end + assert_match(/is required/, e.message) + end + + class MockResponse + # @return [Integer] + attr_accessor :code + + # @return [String] + attr_accessor :content_type + + # @return [String] + attr_accessor :body + + # @param code [Integer] + # @param headers [Hash{String=>String}] + # @param data [Object] + # + def initialize(code, headers, data) + @code = code + @headers = headers + @content_type = "application/json" + @body = JSON.generate(data) + end + + # @param header [String] + # + # @return [String, nil] + # + def [](header) + @headers[header] + end + + # @param header [String] + # + # @return [Boolean] + # + def key?(header) + @headers.key?(header) + end + end + + class MockRequester + # @return [Integer] + attr_accessor :response_code + + # @return [Hash{String=>String}] + attr_accessor :response_headers + + # @return [Object] + attr_accessor :response_data + + # @return [ArrayObject}>] + attr_accessor :attempts + + # @param response_code [Integer] + # @param response_headers [Hash{String=>String}] + # @param response_data [Object] + # + def initialize(response_code, response_headers, response_data) + @response_code = response_code + @response_headers = response_headers + @response_data = response_data + @attempts = [] + end + + # @param req [Hash{Symbol=>Object}] + # + def execute(req) + # Deep copy the request because it is mutated on each retry. + attempts.push(Marshal.load(Marshal.dump(req))) + MockResponse.new(response_code, response_headers, response_data) + end + end + + def test_client_default_request_default_retry_attempts + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") + requester = MockRequester.new(500, {}, {}) + orb.requester = requester + + assert_raises(Orb::InternalServerError) do + orb.customers.create(email: "dev@stainlessapi.com", name: "x") + end + + assert_equal(3, requester.attempts.length) + end + + def test_client_given_request_default_retry_attempts + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key", max_retries: 3) + requester = MockRequester.new(500, {}, {}) + orb.requester = requester + + assert_raises(Orb::InternalServerError) do + orb.customers.create(email: "dev@stainlessapi.com", name: "x") + end + + assert_equal(4, requester.attempts.length) + end + + def test_client_default_request_given_retry_attempts + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") + requester = MockRequester.new(500, {}, {}) + orb.requester = requester + + assert_raises(Orb::InternalServerError) do + orb.customers.create(email: "dev@stainlessapi.com", name: "x", request_options: {max_retries: 3}) + end + + assert_equal(4, requester.attempts.length) + end + + def test_client_given_request_given_retry_attempts + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key", max_retries: 3) + requester = MockRequester.new(500, {}, {}) + orb.requester = requester + + assert_raises(Orb::InternalServerError) do + orb.customers.create(email: "dev@stainlessapi.com", name: "x", request_options: {max_retries: 4}) + end + + assert_equal(5, requester.attempts.length) + end + + def test_client_retry_after_seconds + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key", max_retries: 1) + requester = MockRequester.new(500, {"retry-after" => "1.3"}, {}) + orb.requester = requester + + assert_raises(Orb::InternalServerError) do + orb.customers.create(email: "dev@stainlessapi.com", name: "x") + end + + assert_equal(2, requester.attempts.length) + assert_equal(1.3, Thread.current.thread_variable_get(:mock_sleep).last) + end + + def test_client_retry_after_date + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key", max_retries: 1) + requester = MockRequester.new(500, {"retry-after" => (Time.now + 10).httpdate}, {}) + orb.requester = requester + + assert_raises(Orb::InternalServerError) do + Thread.current.thread_variable_set(:time_now, Time.now) + orb.customers.create(email: "dev@stainlessapi.com", name: "x") + Thread.current.thread_variable_set(:time_now, nil) + end + + assert_equal(2, requester.attempts.length) + assert_in_delta(10, Thread.current.thread_variable_get(:mock_sleep).last, 1.0) + end + + def test_client_retry_after_ms + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key", max_retries: 1) + requester = MockRequester.new(500, {"retry-after-ms" => "1300"}, {}) + orb.requester = requester + + assert_raises(Orb::InternalServerError) do + orb.customers.create(email: "dev@stainlessapi.com", name: "x") + end + + assert_equal(2, requester.attempts.length) + assert_equal(1.3, Thread.current.thread_variable_get(:mock_sleep).last) + end + + def test_retry_count_header + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") + requester = MockRequester.new(500, {}, {}) + orb.requester = requester + + assert_raises(Orb::InternalServerError) do + orb.customers.create(email: "dev@stainlessapi.com", name: "x") + end + + retry_count_headers = requester.attempts.map { |a| a[:headers]["x-stainless-retry-count"] } + assert_equal(%w[0 1 2], retry_count_headers) + end + + def test_omit_retry_count_header + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") + requester = MockRequester.new(500, {}, {}) + orb.requester = requester + + assert_raises(Orb::InternalServerError) do + orb.customers.create( + email: "dev@stainlessapi.com", + name: "x", + request_options: {extra_headers: {"x-stainless-retry-count" => nil}} + ) + end + + retry_count_headers = requester.attempts.map { |a| a[:headers]["x-stainless-retry-count"] } + assert_equal([nil, nil, nil], retry_count_headers) + end + + def test_overwrite_retry_count_header + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") + requester = MockRequester.new(500, {}, {}) + orb.requester = requester + + assert_raises(Orb::InternalServerError) do + orb.customers.create( + email: "dev@stainlessapi.com", + name: "x", + request_options: {extra_headers: {"x-stainless-retry-count" => "42"}} + ) + end + + retry_count_headers = requester.attempts.map { |a| a[:headers]["x-stainless-retry-count"] } + assert_equal(%w[42 42 42], retry_count_headers) + end + + def test_client_redirect_307 + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") + requester = MockRequester.new(307, {"location" => "/redirected"}, {}) + orb.requester = requester + + assert_raises(Orb::APIConnectionError) do + orb.customers.create(email: "dev@stainlessapi.com", name: "x", request_options: {extra_headers: {}}) + end + + assert_equal("/redirected", requester.attempts.last[:url].path) + assert_equal(requester.attempts.first[:method], requester.attempts.last[:method]) + assert_equal(requester.attempts.first[:body], requester.attempts.last[:body]) + assert_equal( + requester.attempts.first[:headers]["content-type"], + requester.attempts.last[:headers]["content-type"] + ) + end + + def test_client_redirect_303 + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") + requester = MockRequester.new(303, {"location" => "/redirected"}, {}) + orb.requester = requester + + assert_raises(Orb::APIConnectionError) do + orb.customers.create(email: "dev@stainlessapi.com", name: "x", request_options: {extra_headers: {}}) + end + + assert_equal("/redirected", requester.attempts.last[:url].path) + assert_equal(:get, requester.attempts.last[:method]) + assert_nil(requester.attempts.last[:body]) + assert_nil(requester.attempts.last[:headers]["Content-Type"]) + end + + def test_client_redirect_auth_keep_same_origin + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") + requester = MockRequester.new(307, {"location" => "/redirected"}, {}) + orb.requester = requester + + assert_raises(Orb::APIConnectionError) do + orb.customers.create( + email: "dev@stainlessapi.com", + name: "x", + request_options: {extra_headers: {"Authorization" => "Bearer xyz"}} + ) + end + + assert_equal( + requester.attempts.first[:headers]["authorization"], + requester.attempts.last[:headers]["authorization"] + ) + end + + def test_client_redirect_auth_strip_cross_origin + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") + requester = MockRequester.new(307, {"location" => "https://example.com/redirected"}, {}) + orb.requester = requester + + assert_raises(Orb::APIConnectionError) do + orb.customers.create( + email: "dev@stainlessapi.com", + name: "x", + request_options: {extra_headers: {"Authorization" => "Bearer xyz"}} + ) + end + + assert_nil(requester.attempts.last[:headers]["Authorization"]) + end + + def test_client_default_idempotency_key_on_writes + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") + requester = MockRequester.new(500, {}, {}) + orb.requester = requester + + assert_raises(Orb::InternalServerError) do + orb.customers.create(email: "dev@stainlessapi.com", name: "x", request_options: {max_retries: 1}) + end + + idempotency_headers = requester.attempts.map { |a| a[:headers]["Idempotency-Key".downcase] } + + assert_kind_of(String, idempotency_headers.first) + refute_empty(idempotency_headers.first) + assert_equal(idempotency_headers.first, idempotency_headers.last) + end + + def test_request_option_idempotency_key_on_writes + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") + requester = MockRequester.new(500, {}, {}) + orb.requester = requester + + assert_raises(Orb::InternalServerError) do + orb.customers.create( + email: "dev@stainlessapi.com", + name: "x", + request_options: {max_retries: 1, idempotency_key: "user-supplied-key"} + ) + end + + requester.attempts.each { |a| assert_equal("user-supplied-key", a[:headers]["Idempotency-Key".downcase]) } + end + + def test_default_headers + orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") + requester = MockRequester.new(200, {}, {}) + orb.requester = requester + orb.customers.create(email: "dev@stainlessapi.com", name: "x") + headers = requester.attempts.first[:headers] + + refute_empty(headers["x-stainless-lang"]) + refute_empty(headers["x-stainless-package-version"]) + refute_empty(headers["x-stainless-runtime"]) + refute_empty(headers["x-stainless-runtime-version"]) + end +end diff --git a/test/orb/coupons_test.rb b/test/orb/coupons_test.rb deleted file mode 100644 index d1fe44e5..00000000 --- a/test/orb/coupons_test.rb +++ /dev/null @@ -1,28 +0,0 @@ -require 'orb/model' -require 'orb/models/coupon' -require 'orb/orb' -require 'test/unit' - -class CouponsResourceTest < Test::Unit::TestCase - - def setup - @orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - end - def test_create_required_params - response = @orb.coupons.create(discount: {"discount_type" => "percentage", "applies_to_price_ids" => ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], "percentage_discount" => 0.15, }, redemption_code: "HALFOFF") - assert(Orb::Converter.same_type?(Orb::Models::Coupon, response), response.class.to_s) - end - def test_list - response = @orb.coupons.list() - assert(Orb::Converter.same_type?(Orb::Resources::CouponPage, response), response.class.to_s) - end - def test_archive - response = @orb.coupons.archive("string") - assert(Orb::Converter.same_type?(Orb::Models::Coupon, response), response.class.to_s) - end - def test_fetch - response = @orb.coupons.fetch("string") - assert(Orb::Converter.same_type?(Orb::Models::Coupon, response), response.class.to_s) - end - -end \ No newline at end of file diff --git a/test/orb/credit_notes_test.rb b/test/orb/credit_notes_test.rb deleted file mode 100644 index c10bbd79..00000000 --- a/test/orb/credit_notes_test.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'orb/model' -require 'orb/models/credit_note' -require 'orb/orb' -require 'test/unit' - -class CreditNotesResourceTest < Test::Unit::TestCase - - def setup - @orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - end - def test_list - response = @orb.credit_notes.list() - assert(Orb::Converter.same_type?(Orb::Resources::CreditNotePage, response), response.class.to_s) - end - def test_fetch - response = @orb.credit_notes.fetch("string") - assert(Orb::Converter.same_type?(Orb::Models::CreditNote, response), response.class.to_s) - end - -end \ No newline at end of file diff --git a/test/orb/customers_test.rb b/test/orb/customers_test.rb deleted file mode 100644 index a4553e39..00000000 --- a/test/orb/customers_test.rb +++ /dev/null @@ -1,40 +0,0 @@ -require 'orb/model' -require 'orb/models/customer' -require 'orb/orb' -require 'test/unit' - -class CustomersResourceTest < Test::Unit::TestCase - - def setup - @orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - end - def test_create_required_params - response = @orb.customers.create(email: "string", name: "string") - assert(Orb::Converter.same_type?(Orb::Models::Customer, response), response.class.to_s) - end - def test_update - response = @orb.customers.update("string") - assert(Orb::Converter.same_type?(Orb::Models::Customer, response), response.class.to_s) - end - def test_list - response = @orb.customers.list() - assert(Orb::Converter.same_type?(Orb::Resources::CustomerPage, response), response.class.to_s) - end - def test_delete - response = @orb.customers.delete("string") - assert(Orb::Converter.same_type?(NilClass, response), response.class.to_s) - end - def test_fetch - response = @orb.customers.fetch("string") - assert(Orb::Converter.same_type?(Orb::Models::Customer, response), response.class.to_s) - end - def test_fetch_by_external_id - response = @orb.customers.fetch_by_external_id("string") - assert(Orb::Converter.same_type?(Orb::Models::Customer, response), response.class.to_s) - end - def test_update_by_external_id - response = @orb.customers.update_by_external_id("string") - assert(Orb::Converter.same_type?(Orb::Models::Customer, response), response.class.to_s) - end - -end \ No newline at end of file diff --git a/test/orb/events_test.rb b/test/orb/events_test.rb deleted file mode 100644 index 10faef1a..00000000 --- a/test/orb/events_test.rb +++ /dev/null @@ -1,31 +0,0 @@ -require 'orb/model' -require 'orb/models/event_deprecate_response' -require 'orb/models/event_ingest_response' -require 'orb/models/event_search_response' -require 'orb/models/event_update_response' -require 'orb/orb' -require 'test/unit' - -class EventsResourceTest < Test::Unit::TestCase - - def setup - @orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - end - def test_update_required_params - response = @orb.events.update("string", event_name: "string", properties: {}, timestamp: "2020-12-09T16:09:53Z") - assert(Orb::Converter.same_type?(Orb::Models::EventUpdateResponse, response), response.class.to_s) - end - def test_deprecate - response = @orb.events.deprecate("string") - assert(Orb::Converter.same_type?(Orb::Models::EventDeprecateResponse, response), response.class.to_s) - end - def test_ingest_required_params - response = @orb.events.ingest(events: [{"event_name" => "string", "timestamp" => "2020-12-09T16:09:53Z", "properties" => {}, "idempotency_key" => "string", }, {"event_name" => "string", "timestamp" => "2020-12-09T16:09:53Z", "properties" => {}, "idempotency_key" => "string", }, {"event_name" => "string", "timestamp" => "2020-12-09T16:09:53Z", "properties" => {}, "idempotency_key" => "string", }]) - assert(Orb::Converter.same_type?(Orb::Models::EventIngestResponse, response), response.class.to_s) - end - def test_search_required_params - response = @orb.events.search(event_ids: ["string", "string", "string"]) - assert(Orb::Converter.same_type?(Orb::Models::EventSearchResponse, response), response.class.to_s) - end - -end \ No newline at end of file diff --git a/test/orb/invoice_line_items_test.rb b/test/orb/invoice_line_items_test.rb deleted file mode 100644 index 151af7f4..00000000 --- a/test/orb/invoice_line_items_test.rb +++ /dev/null @@ -1,16 +0,0 @@ -require 'orb/model' -require 'orb/models/invoice_line_item_create_response' -require 'orb/orb' -require 'test/unit' - -class InvoiceLineItemsResourceTest < Test::Unit::TestCase - - def setup - @orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - end - def test_create_required_params - response = @orb.invoice_line_items.create(amount: "12.00", end_date: "2023-09-22", invoice_id: "4khy3nwzktxv7", name: "Item Name", quantity: 1, start_date: "2023-09-22") - assert(Orb::Converter.same_type?(Orb::Models::InvoiceLineItemCreateResponse, response), response.class.to_s) - end - -end \ No newline at end of file diff --git a/test/orb/invoices_test.rb b/test/orb/invoices_test.rb deleted file mode 100644 index 036da39a..00000000 --- a/test/orb/invoices_test.rb +++ /dev/null @@ -1,41 +0,0 @@ -require 'orb/model' -require 'orb/models/invoice' -require 'orb/models/invoice_fetch_upcoming_response' -require 'orb/orb' -require 'test/unit' - -class InvoicesResourceTest < Test::Unit::TestCase - - def setup - @orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - end - def test_create_required_params - response = @orb.invoices.create(currency: "USD", invoice_date: "2019-12-27T18:11:19.117Z", line_items: [{"start_date" => "2023-09-22", "end_date" => "2023-09-22", "quantity" => 1, "name" => "Line Item Name", "item_id" => "4khy3nwzktxv7", "model_type" => "unit", "unit_config" => {"unit_amount" => "string", }, }, {"start_date" => "2023-09-22", "end_date" => "2023-09-22", "quantity" => 1, "name" => "Line Item Name", "item_id" => "4khy3nwzktxv7", "model_type" => "unit", "unit_config" => {"unit_amount" => "string", }, }, {"start_date" => "2023-09-22", "end_date" => "2023-09-22", "quantity" => 1, "name" => "Line Item Name", "item_id" => "4khy3nwzktxv7", "model_type" => "unit", "unit_config" => {"unit_amount" => "string", }, }], net_terms: 0) - assert(Orb::Converter.same_type?(Orb::Models::Invoice, response), response.class.to_s) - end - def test_list - response = @orb.invoices.list() - assert(Orb::Converter.same_type?(Orb::Resources::InvoicePage, response), response.class.to_s) - end - def test_fetch - response = @orb.invoices.fetch("string") - assert(Orb::Converter.same_type?(Orb::Models::Invoice, response), response.class.to_s) - end - def test_fetch_upcoming - response = @orb.invoices.fetch_upcoming() - assert(Orb::Converter.same_type?(Orb::Models::InvoiceFetchUpcomingResponse, response), response.class.to_s) - end - def test_issue - response = @orb.invoices.issue("string") - assert(Orb::Converter.same_type?(Orb::Models::Invoice, response), response.class.to_s) - end - def test_mark_paid_required_params - response = @orb.invoices.mark_paid("string", external_id: "external_payment_id_123", notes: "string", payment_received_date: "2023-09-22") - assert(Orb::Converter.same_type?(Orb::Models::Invoice, response), response.class.to_s) - end - def test_void - response = @orb.invoices.void("string") - assert(Orb::Converter.same_type?(Orb::Models::Invoice, response), response.class.to_s) - end - -end \ No newline at end of file diff --git a/test/orb/items_test.rb b/test/orb/items_test.rb deleted file mode 100644 index fb27a177..00000000 --- a/test/orb/items_test.rb +++ /dev/null @@ -1,24 +0,0 @@ -require 'orb/model' -require 'orb/models/item' -require 'orb/orb' -require 'test/unit' - -class ItemsResourceTest < Test::Unit::TestCase - - def setup - @orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - end - def test_create_required_params - response = @orb.items.create(name: "API requests") - assert(Orb::Converter.same_type?(Orb::Models::Item, response), response.class.to_s) - end - def test_list - response = @orb.items.list() - assert(Orb::Converter.same_type?(Orb::Resources::ItemPage, response), response.class.to_s) - end - def test_fetch - response = @orb.items.fetch("string") - assert(Orb::Converter.same_type?(Orb::Models::Item, response), response.class.to_s) - end - -end \ No newline at end of file diff --git a/test/orb/metrics_test.rb b/test/orb/metrics_test.rb deleted file mode 100644 index 81d75b6f..00000000 --- a/test/orb/metrics_test.rb +++ /dev/null @@ -1,25 +0,0 @@ -require 'orb/model' -require 'orb/models/metric_create_response' -require 'orb/models/metric_fetch_response' -require 'orb/orb' -require 'test/unit' - -class MetricsResourceTest < Test::Unit::TestCase - - def setup - @orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - end - def test_create_required_params - response = @orb.metrics.create(description: "Sum of bytes downloaded in fast mode", item_id: "string", name: "Bytes downloaded", sql: "SELECT sum(bytes_downloaded) FROM events WHERE download_speed = 'fast'") - assert(Orb::Converter.same_type?(Orb::Models::MetricCreateResponse, response), response.class.to_s) - end - def test_list - response = @orb.metrics.list() - assert(Orb::Converter.same_type?(Orb::Resources::MetricListResponsePage, response), response.class.to_s) - end - def test_fetch - response = @orb.metrics.fetch("string") - assert(Orb::Converter.same_type?(Orb::Models::MetricFetchResponse, response), response.class.to_s) - end - -end \ No newline at end of file diff --git a/test/orb/plans_test.rb b/test/orb/plans_test.rb deleted file mode 100644 index d173565c..00000000 --- a/test/orb/plans_test.rb +++ /dev/null @@ -1,28 +0,0 @@ -require 'orb/model' -require 'orb/models/plan' -require 'orb/orb' -require 'test/unit' - -class PlansResourceTest < Test::Unit::TestCase - - def setup - @orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - end - def test_create_required_params - response = @orb.plans.create(currency: "string", name: "string", prices: [{"name" => "Annual fee", "item_id" => "string", "cadence" => "annual", "model_type" => "unit", "unit_config" => {"unit_amount" => "string", }, }]) - assert(Orb::Converter.same_type?(Orb::Models::Plan, response), response.class.to_s) - end - def test_update - response = @orb.plans.update("string") - assert(Orb::Converter.same_type?(Orb::Models::Plan, response), response.class.to_s) - end - def test_list - response = @orb.plans.list() - assert(Orb::Converter.same_type?(Orb::Resources::PlanPage, response), response.class.to_s) - end - def test_fetch - response = @orb.plans.fetch("string") - assert(Orb::Converter.same_type?(Orb::Models::Plan, response), response.class.to_s) - end - -end \ No newline at end of file diff --git a/test/orb/prices_test.rb b/test/orb/prices_test.rb deleted file mode 100644 index aac8728e..00000000 --- a/test/orb/prices_test.rb +++ /dev/null @@ -1,23 +0,0 @@ -require 'orb/model' -require 'orb/orb' -require 'test/unit' - -class PricesResourceTest < Test::Unit::TestCase - - def setup - @orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - end - def test_create_required_params - response = @orb.prices.create(cadence: "annual", currency: "string", item_id: "string", model_type: "unit", name: "Annual fee", unit_config: {"unit_amount" => "string", }) - assert(Orb::Converter.same_type?(Orb::Unknown, response), response.class.to_s) - end - def test_list - response = @orb.prices.list() - assert(Orb::Converter.same_type?(Orb::Resources::PricePage, response), response.class.to_s) - end - def test_fetch - response = @orb.prices.fetch("string") - assert(Orb::Converter.same_type?(Orb::Unknown, response), response.class.to_s) - end - -end \ No newline at end of file diff --git a/test/orb/resources/alerts_test.rb b/test/orb/resources/alerts_test.rb new file mode 100644 index 00000000..e9968518 --- /dev/null +++ b/test/orb/resources/alerts_test.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Orb::Test::Resources::AlertsTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_retrieve + response = @orb.alerts.retrieve("alert_id") + + assert_pattern do + response => Orb::Models::Alert + end + end + + def test_update_required_params + response = @orb.alerts.update("alert_configuration_id", thresholds: [{"value" => 0}]) + + assert_pattern do + response => Orb::Models::Alert + end + end + + def test_list + skip("plan_version=0 breaks Prism") + + response = @orb.alerts.list + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end + + def test_create_for_customer_required_params + response = @orb.alerts.create_for_customer("customer_id", currency: "currency", type: "usage_exceeded") + + assert_pattern do + response => Orb::Models::Alert + end + end + + def test_create_for_external_customer_required_params + response = @orb.alerts.create_for_external_customer( + "external_customer_id", + currency: "currency", + type: "usage_exceeded" + ) + + assert_pattern do + response => Orb::Models::Alert + end + end + + def test_create_for_subscription_required_params + response = @orb.alerts.create_for_subscription( + "subscription_id", + thresholds: [{"value" => 0}], + type: "usage_exceeded" + ) + + assert_pattern do + response => Orb::Models::Alert + end + end + + def test_disable + response = @orb.alerts.disable("alert_configuration_id") + + assert_pattern do + response => Orb::Models::Alert + end + end + + def test_enable + response = @orb.alerts.enable("alert_configuration_id") + + assert_pattern do + response => Orb::Models::Alert + end + end +end diff --git a/test/orb/resources/coupons/subscriptions_test.rb b/test/orb/resources/coupons/subscriptions_test.rb new file mode 100644 index 00000000..55f24d97 --- /dev/null +++ b/test/orb/resources/coupons/subscriptions_test.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Orb::Test::Resources::Coupons::SubscriptionsTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_list + response = @orb.coupons.subscriptions.list("coupon_id") + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end +end diff --git a/test/orb/resources/coupons_test.rb b/test/orb/resources/coupons_test.rb new file mode 100644 index 00000000..d1913f95 --- /dev/null +++ b/test/orb/resources/coupons_test.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Orb::Test::Resources::CouponsTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_create_required_params + response = @orb.coupons.create( + discount: {"discount_type" => "percentage", "percentage_discount" => 0}, + redemption_code: "HALFOFF" + ) + + assert_pattern do + response => Orb::Models::Coupon + end + end + + def test_list + response = @orb.coupons.list + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end + + def test_archive + response = @orb.coupons.archive("coupon_id") + + assert_pattern do + response => Orb::Models::Coupon + end + end + + def test_fetch + response = @orb.coupons.fetch("coupon_id") + + assert_pattern do + response => Orb::Models::Coupon + end + end +end diff --git a/test/orb/resources/credit_notes_test.rb b/test/orb/resources/credit_notes_test.rb new file mode 100644 index 00000000..1cc7328a --- /dev/null +++ b/test/orb/resources/credit_notes_test.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Orb::Test::Resources::CreditNotesTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_create_required_params + response = @orb.credit_notes.create( + line_items: [ + { + "amount" => "amount", + "invoice_line_item_id" => "4khy3nwzktxv7" + } + ] + ) + + assert_pattern do + response => Orb::Models::CreditNote + end + end + + def test_list + response = @orb.credit_notes.list + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end + + def test_fetch + response = @orb.credit_notes.fetch("credit_note_id") + + assert_pattern do + response => Orb::Models::CreditNote + end + end +end diff --git a/test/orb/resources/customers/balance_transactions_test.rb b/test/orb/resources/customers/balance_transactions_test.rb new file mode 100644 index 00000000..b70cd0b7 --- /dev/null +++ b/test/orb/resources/customers/balance_transactions_test.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Orb::Test::Resources::Customers::BalanceTransactionsTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_create_required_params + response = @orb.customers.balance_transactions.create("customer_id", amount: "amount", type: "increment") + + assert_pattern do + response => Orb::Models::Customers::BalanceTransactionCreateResponse + end + end + + def test_list + response = @orb.customers.balance_transactions.list("customer_id") + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end +end diff --git a/test/orb/resources/customers/costs_test.rb b/test/orb/resources/customers/costs_test.rb new file mode 100644 index 00000000..2d42203b --- /dev/null +++ b/test/orb/resources/customers/costs_test.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Orb::Test::Resources::Customers::CostsTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_list + response = @orb.customers.costs.list("customer_id") + + assert_pattern do + response => Orb::Models::Customers::CostListResponse + end + end + + def test_list_by_external_id + response = @orb.customers.costs.list_by_external_id("external_customer_id") + + assert_pattern do + response => Orb::Models::Customers::CostListByExternalIDResponse + end + end +end diff --git a/test/orb/resources/customers/credits/ledger_test.rb b/test/orb/resources/customers/credits/ledger_test.rb new file mode 100644 index 00000000..bda50b34 --- /dev/null +++ b/test/orb/resources/customers/credits/ledger_test.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class Orb::Test::Resources::Customers::Credits::LedgerTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_list + response = @orb.customers.credits.ledger.list("customer_id") + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end + + def test_create_entry_required_params + response = @orb.customers.credits.ledger.create_entry( + "customer_id", + entry_type: "expiration_change", + expiry_date: "2019-12-27T18:11:19.117Z", + target_expiry_date: "2019-12-27" + ) + + assert_pattern do + response => Orb::Models::Customers::Credits::LedgerCreateEntryResponse + end + end + + def test_create_entry_by_external_id_required_params + response = @orb.customers.credits.ledger.create_entry_by_external_id( + "external_customer_id", + entry_type: "expiration_change", + expiry_date: "2019-12-27T18:11:19.117Z", + target_expiry_date: "2019-12-27" + ) + + assert_pattern do + response => Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse + end + end + + def test_list_by_external_id + response = @orb.customers.credits.ledger.list_by_external_id("external_customer_id") + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end +end diff --git a/test/orb/resources/customers/credits/top_ups_test.rb b/test/orb/resources/customers/credits/top_ups_test.rb new file mode 100644 index 00000000..ac236492 --- /dev/null +++ b/test/orb/resources/customers/credits/top_ups_test.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class Orb::Test::Resources::Customers::Credits::TopUpsTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_create_required_params + response = @orb.customers.credits.top_ups.create( + "customer_id", + amount: "amount", + currency: "currency", + invoice_settings: {"auto_collection" => true, "net_terms" => 0}, + per_unit_cost_basis: "per_unit_cost_basis", + threshold: "threshold" + ) + + assert_pattern do + response => Orb::Models::Customers::Credits::TopUpCreateResponse + end + end + + def test_list + response = @orb.customers.credits.top_ups.list("customer_id") + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end + + def test_delete_required_params + response = @orb.customers.credits.top_ups.delete("top_up_id", customer_id: "customer_id") + + assert_pattern do + response => nil + end + end + + def test_create_by_external_id_required_params + response = @orb.customers.credits.top_ups.create_by_external_id( + "external_customer_id", + amount: "amount", + currency: "currency", + invoice_settings: {"auto_collection" => true, "net_terms" => 0}, + per_unit_cost_basis: "per_unit_cost_basis", + threshold: "threshold" + ) + + assert_pattern do + response => Orb::Models::Customers::Credits::TopUpCreateByExternalIDResponse + end + end + + def test_delete_by_external_id_required_params + response = @orb.customers.credits.top_ups.delete_by_external_id( + "top_up_id", + external_customer_id: "external_customer_id" + ) + + assert_pattern do + response => nil + end + end + + def test_list_by_external_id + response = @orb.customers.credits.top_ups.list_by_external_id("external_customer_id") + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end +end diff --git a/test/orb/resources/customers/credits_test.rb b/test/orb/resources/customers/credits_test.rb new file mode 100644 index 00000000..cdc47138 --- /dev/null +++ b/test/orb/resources/customers/credits_test.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Orb::Test::Resources::Customers::CreditsTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_list + response = @orb.customers.credits.list("customer_id") + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end + + def test_list_by_external_id + response = @orb.customers.credits.list_by_external_id("external_customer_id") + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end +end diff --git a/test/orb/resources/customers_test.rb b/test/orb/resources/customers_test.rb new file mode 100644 index 00000000..d906d02a --- /dev/null +++ b/test/orb/resources/customers_test.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Orb::Test::Resources::CustomersTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_create_required_params + response = @orb.customers.create(email: "dev@stainlessapi.com", name: "x") + + assert_pattern do + response => Orb::Models::Customer + end + end + + def test_update + response = @orb.customers.update("customer_id") + + assert_pattern do + response => Orb::Models::Customer + end + end + + def test_list + response = @orb.customers.list + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end + + def test_delete + response = @orb.customers.delete("customer_id") + + assert_pattern do + response => nil + end + end + + def test_fetch + response = @orb.customers.fetch("customer_id") + + assert_pattern do + response => Orb::Models::Customer + end + end + + def test_fetch_by_external_id + response = @orb.customers.fetch_by_external_id("external_customer_id") + + assert_pattern do + response => Orb::Models::Customer + end + end + + def test_sync_payment_methods_from_gateway + response = @orb.customers.sync_payment_methods_from_gateway("external_customer_id") + + assert_pattern do + response => nil + end + end + + def test_sync_payment_methods_from_gateway_by_external_customer_id + response = @orb.customers.sync_payment_methods_from_gateway_by_external_customer_id("customer_id") + + assert_pattern do + response => nil + end + end + + def test_update_by_external_id + response = @orb.customers.update_by_external_id("external_customer_id") + + assert_pattern do + response => Orb::Models::Customer + end + end +end diff --git a/test/orb/resources/dimensional_price_groups/external_dimensional_price_group_id_test.rb b/test/orb/resources/dimensional_price_groups/external_dimensional_price_group_id_test.rb new file mode 100644 index 00000000..fb10b70a --- /dev/null +++ b/test/orb/resources/dimensional_price_groups/external_dimensional_price_group_id_test.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Orb::Test::Resources::DimensionalPriceGroups::ExternalDimensionalPriceGroupIDTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_retrieve + response = @orb.dimensional_price_groups.external_dimensional_price_group_id.retrieve( + "external_dimensional_price_group_id" + ) + + assert_pattern do + response => Orb::Models::DimensionalPriceGroup + end + end +end diff --git a/test/orb/resources/dimensional_price_groups_test.rb b/test/orb/resources/dimensional_price_groups_test.rb new file mode 100644 index 00000000..ce495719 --- /dev/null +++ b/test/orb/resources/dimensional_price_groups_test.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Orb::Test::Resources::DimensionalPriceGroupsTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_create_required_params + response = @orb.dimensional_price_groups.create( + billable_metric_id: "billable_metric_id", + dimensions: %w[region instance_type], + name: "name" + ) + + assert_pattern do + response => Orb::Models::DimensionalPriceGroup + end + end + + def test_retrieve + response = @orb.dimensional_price_groups.retrieve("dimensional_price_group_id") + + assert_pattern do + response => Orb::Models::DimensionalPriceGroup + end + end + + def test_list + response = @orb.dimensional_price_groups.list + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end +end diff --git a/test/orb/resources/events/backfills_test.rb b/test/orb/resources/events/backfills_test.rb new file mode 100644 index 00000000..dc035ad4 --- /dev/null +++ b/test/orb/resources/events/backfills_test.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Orb::Test::Resources::Events::BackfillsTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_create_required_params + response = @orb.events.backfills.create( + timeframe_end: "2019-12-27T18:11:19.117Z", + timeframe_start: "2019-12-27T18:11:19.117Z" + ) + + assert_pattern do + response => Orb::Models::Events::BackfillCreateResponse + end + end + + def test_list + response = @orb.events.backfills.list + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end + + def test_close + response = @orb.events.backfills.close("backfill_id") + + assert_pattern do + response => Orb::Models::Events::BackfillCloseResponse + end + end + + def test_fetch + response = @orb.events.backfills.fetch("backfill_id") + + assert_pattern do + response => Orb::Models::Events::BackfillFetchResponse + end + end + + def test_revert + response = @orb.events.backfills.revert("backfill_id") + + assert_pattern do + response => Orb::Models::Events::BackfillRevertResponse + end + end +end diff --git a/test/orb/resources/events/volume_test.rb b/test/orb/resources/events/volume_test.rb new file mode 100644 index 00000000..6f056a99 --- /dev/null +++ b/test/orb/resources/events/volume_test.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Orb::Test::Resources::Events::VolumeTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_list_required_params + response = @orb.events.volume.list(timeframe_start: "2019-12-27T18:11:19.117Z") + + assert_pattern do + response => Orb::Models::Events::EventVolumes + end + end +end diff --git a/test/orb/resources/events_test.rb b/test/orb/resources/events_test.rb new file mode 100644 index 00000000..1b5b7c19 --- /dev/null +++ b/test/orb/resources/events_test.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Orb::Test::Resources::EventsTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_update_required_params + response = @orb.events.update( + "event_id", + event_name: "event_name", + properties: {}, + timestamp: "2020-12-09T16:09:53Z" + ) + + assert_pattern do + response => Orb::Models::EventUpdateResponse + end + end + + def test_deprecate + response = @orb.events.deprecate("event_id") + + assert_pattern do + response => Orb::Models::EventDeprecateResponse + end + end + + def test_ingest_required_params + response = @orb.events.ingest( + events: [ + { + "event_name" => "event_name", + "idempotency_key" => "idempotency_key", + "properties" => {}, + "timestamp" => "2020-12-09T16:09:53Z" + } + ] + ) + + assert_pattern do + response => Orb::Models::EventIngestResponse + end + end + + def test_search_required_params + response = @orb.events.search(event_ids: ["string"]) + + assert_pattern do + response => Orb::Models::EventSearchResponse + end + end +end diff --git a/test/orb/resources/invoice_line_items_test.rb b/test/orb/resources/invoice_line_items_test.rb new file mode 100644 index 00000000..1bbed6e4 --- /dev/null +++ b/test/orb/resources/invoice_line_items_test.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Orb::Test::Resources::InvoiceLineItemsTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_create_required_params + response = @orb.invoice_line_items.create( + amount: "12.00", + end_date: "2023-09-22", + invoice_id: "4khy3nwzktxv7", + name: "Item Name", + quantity: 1, + start_date: "2023-09-22" + ) + + assert_pattern do + response => Orb::Models::InvoiceLineItemCreateResponse + end + end +end diff --git a/test/orb/resources/invoices_test.rb b/test/orb/resources/invoices_test.rb new file mode 100644 index 00000000..d1847f8b --- /dev/null +++ b/test/orb/resources/invoices_test.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Orb::Test::Resources::InvoicesTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_create_required_params + response = @orb.invoices.create( + currency: "USD", + invoice_date: "2019-12-27T18:11:19.117Z", + line_items: [ + { + "end_date" => "2023-09-22", + "item_id" => "4khy3nwzktxv7", + "model_type" => "unit", + "name" => "Line Item Name", + "quantity" => 1, + "start_date" => "2023-09-22", + "unit_config" => {"unit_amount" => "unit_amount"} + } + ], + net_terms: 0 + ) + + assert_pattern do + response => Orb::Models::Invoice + end + end + + def test_update + response = @orb.invoices.update("invoice_id") + + assert_pattern do + response => Orb::Models::Invoice + end + end + + def test_list + response = @orb.invoices.list + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end + + def test_fetch + response = @orb.invoices.fetch("invoice_id") + + assert_pattern do + response => Orb::Models::Invoice + end + end + + def test_fetch_upcoming_required_params + response = @orb.invoices.fetch_upcoming(subscription_id: "subscription_id") + + assert_pattern do + response => Orb::Models::InvoiceFetchUpcomingResponse + end + end + + def test_issue + response = @orb.invoices.issue("invoice_id") + + assert_pattern do + response => Orb::Models::Invoice + end + end + + def test_mark_paid_required_params + response = @orb.invoices.mark_paid("invoice_id", payment_received_date: "2023-09-22") + + assert_pattern do + response => Orb::Models::Invoice + end + end + + def test_pay + response = @orb.invoices.pay("invoice_id") + + assert_pattern do + response => Orb::Models::Invoice + end + end + + def test_void + response = @orb.invoices.void("invoice_id") + + assert_pattern do + response => Orb::Models::Invoice + end + end +end diff --git a/test/orb/resources/items_test.rb b/test/orb/resources/items_test.rb new file mode 100644 index 00000000..51eb4898 --- /dev/null +++ b/test/orb/resources/items_test.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Orb::Test::Resources::ItemsTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_create_required_params + response = @orb.items.create(name: "API requests") + + assert_pattern do + response => Orb::Models::Item + end + end + + def test_update + response = @orb.items.update("item_id") + + assert_pattern do + response => Orb::Models::Item + end + end + + def test_list + response = @orb.items.list + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end + + def test_fetch + response = @orb.items.fetch("item_id") + + assert_pattern do + response => Orb::Models::Item + end + end +end diff --git a/test/orb/resources/metrics_test.rb b/test/orb/resources/metrics_test.rb new file mode 100644 index 00000000..5b5c8191 --- /dev/null +++ b/test/orb/resources/metrics_test.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Orb::Test::Resources::MetricsTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_create_required_params + response = @orb.metrics.create( + description: "Sum of bytes downloaded in fast mode", + item_id: "item_id", + name: "Bytes downloaded", + sql: "SELECT sum(bytes_downloaded) FROM events WHERE download_speed = 'fast'" + ) + + assert_pattern do + response => Orb::Models::BillableMetric + end + end + + def test_update + response = @orb.metrics.update("metric_id") + + assert_pattern do + response => Orb::Models::BillableMetric + end + end + + def test_list + response = @orb.metrics.list + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end + + def test_fetch + response = @orb.metrics.fetch("metric_id") + + assert_pattern do + response => Orb::Models::BillableMetric + end + end +end diff --git a/test/orb/resources/plans/external_plan_id_test.rb b/test/orb/resources/plans/external_plan_id_test.rb new file mode 100644 index 00000000..51cf9dc9 --- /dev/null +++ b/test/orb/resources/plans/external_plan_id_test.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Orb::Test::Resources::Plans::ExternalPlanIDTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_update + response = @orb.plans.external_plan_id.update("external_plan_id") + + assert_pattern do + response => Orb::Models::Plan + end + end + + def test_fetch + response = @orb.plans.external_plan_id.fetch("external_plan_id") + + assert_pattern do + response => Orb::Models::Plan + end + end +end diff --git a/test/orb/resources/plans_test.rb b/test/orb/resources/plans_test.rb new file mode 100644 index 00000000..6bc703ec --- /dev/null +++ b/test/orb/resources/plans_test.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Orb::Test::Resources::PlansTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_create_required_params + response = @orb.plans.create( + currency: "currency", + name: "name", + prices: [ + { + "cadence" => "annual", + "item_id" => "item_id", + "model_type" => "unit", + "name" => "Annual fee", + "unit_config" => {"unit_amount" => "unit_amount"} + } + ] + ) + + assert_pattern do + response => Orb::Models::Plan + end + end + + def test_update + response = @orb.plans.update("plan_id") + + assert_pattern do + response => Orb::Models::Plan + end + end + + def test_list + response = @orb.plans.list + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end + + def test_fetch + response = @orb.plans.fetch("plan_id") + + assert_pattern do + response => Orb::Models::Plan + end + end +end diff --git a/test/orb/resources/prices/external_price_id_test.rb b/test/orb/resources/prices/external_price_id_test.rb new file mode 100644 index 00000000..dee3cde3 --- /dev/null +++ b/test/orb/resources/prices/external_price_id_test.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Orb::Test::Resources::Prices::ExternalPriceIDTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_update + response = @orb.prices.external_price_id.update("external_price_id") + + assert_pattern do + response => Orb::Models::Price + end + end + + def test_fetch + response = @orb.prices.external_price_id.fetch("external_price_id") + + assert_pattern do + response => Orb::Models::Price + end + end +end diff --git a/test/orb/resources/prices_test.rb b/test/orb/resources/prices_test.rb new file mode 100644 index 00000000..0f3d599f --- /dev/null +++ b/test/orb/resources/prices_test.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Orb::Test::Resources::PricesTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_create_required_params + response = @orb.prices.create( + cadence: "annual", + currency: "currency", + item_id: "item_id", + model_type: "unit", + name: "Annual fee", + unit_config: {"unit_amount" => "unit_amount"} + ) + + assert_pattern do + response => Orb::Models::Price + end + end + + def test_update + response = @orb.prices.update("price_id") + + assert_pattern do + response => Orb::Models::Price + end + end + + def test_list + response = @orb.prices.list + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end + + def test_evaluate_required_params + response = @orb.prices.evaluate( + "price_id", + timeframe_end: "2019-12-27T18:11:19.117Z", + timeframe_start: "2019-12-27T18:11:19.117Z" + ) + + assert_pattern do + response => Orb::Models::PriceEvaluateResponse + end + end + + def test_fetch + response = @orb.prices.fetch("price_id") + + assert_pattern do + response => Orb::Models::Price + end + end +end diff --git a/test/orb/resources/shared_test.rb b/test/orb/resources/shared_test.rb new file mode 100644 index 00000000..97902d91 --- /dev/null +++ b/test/orb/resources/shared_test.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Orb::Test::Resources::SharedTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end +end diff --git a/test/orb/resources/subscriptions_test.rb b/test/orb/resources/subscriptions_test.rb new file mode 100644 index 00000000..14f43d3d --- /dev/null +++ b/test/orb/resources/subscriptions_test.rb @@ -0,0 +1,161 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Orb::Test::Resources::SubscriptionsTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_create + response = @orb.subscriptions.create + + assert_pattern do + response => Orb::Models::SubscriptionCreateResponse + end + end + + def test_update + response = @orb.subscriptions.update("subscription_id") + + assert_pattern do + response => Orb::Models::Subscription + end + end + + def test_list + response = @orb.subscriptions.list + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end + + def test_cancel_required_params + response = @orb.subscriptions.cancel("subscription_id", cancel_option: "end_of_subscription_term") + + assert_pattern do + response => Orb::Models::SubscriptionCancelResponse + end + end + + def test_fetch + response = @orb.subscriptions.fetch("subscription_id") + + assert_pattern do + response => Orb::Models::Subscription + end + end + + def test_fetch_costs + response = @orb.subscriptions.fetch_costs("subscription_id") + + assert_pattern do + response => Orb::Models::SubscriptionFetchCostsResponse + end + end + + def test_fetch_schedule + response = @orb.subscriptions.fetch_schedule("subscription_id") + + assert_pattern do + response => Orb::Page + end + + page = response.next_page + assert_pattern do + page => Orb::Page + end + end + + def test_fetch_usage + skip("Incorrect example breaks Prism") + + response = @orb.subscriptions.fetch_usage("subscription_id") + + assert_pattern do + response => Orb::Models::SubscriptionUsage + end + end + + def test_price_intervals + skip("Incorrect example breaks Prism") + + response = @orb.subscriptions.price_intervals("subscription_id") + + assert_pattern do + response => Orb::Models::SubscriptionPriceIntervalsResponse + end + end + + def test_schedule_plan_change_required_params + response = @orb.subscriptions.schedule_plan_change("subscription_id", change_option: "requested_date") + + assert_pattern do + response => Orb::Models::SubscriptionSchedulePlanChangeResponse + end + end + + def test_trigger_phase + response = @orb.subscriptions.trigger_phase("subscription_id") + + assert_pattern do + response => Orb::Models::SubscriptionTriggerPhaseResponse + end + end + + def test_unschedule_cancellation + response = @orb.subscriptions.unschedule_cancellation("subscription_id") + + assert_pattern do + response => Orb::Models::SubscriptionUnscheduleCancellationResponse + end + end + + def test_unschedule_fixed_fee_quantity_updates_required_params + response = @orb.subscriptions.unschedule_fixed_fee_quantity_updates( + "subscription_id", + price_id: "price_id" + ) + + assert_pattern do + response => Orb::Models::SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse + end + end + + def test_unschedule_pending_plan_changes + response = @orb.subscriptions.unschedule_pending_plan_changes("subscription_id") + + assert_pattern do + response => Orb::Models::SubscriptionUnschedulePendingPlanChangesResponse + end + end + + def test_update_fixed_fee_quantity_required_params + response = @orb.subscriptions.update_fixed_fee_quantity( + "subscription_id", + price_id: "price_id", + quantity: 0 + ) + + assert_pattern do + response => Orb::Models::SubscriptionUpdateFixedFeeQuantityResponse + end + end + + def test_update_trial_required_params + response = @orb.subscriptions.update_trial("subscription_id", trial_end_date: "2017-07-21T17:32:28Z") + + assert_pattern do + response => Orb::Models::SubscriptionUpdateTrialResponse + end + end +end diff --git a/test/orb/resources/top_level_test.rb b/test/orb/resources/top_level_test.rb new file mode 100644 index 00000000..2a7727c0 --- /dev/null +++ b/test/orb/resources/top_level_test.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Orb::Test::Resources::TopLevelTest < Minitest::Test + def before_all + @orb = Orb::Client.new( + base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), + api_key: "My API Key" + ) + end + + def test_ping + response = @orb.top_level.ping + + assert_pattern do + response => Orb::Models::TopLevelPingResponse + end + end +end diff --git a/test/orb/subscriptions_test.rb b/test/orb/subscriptions_test.rb deleted file mode 100644 index 7a53f568..00000000 --- a/test/orb/subscriptions_test.rb +++ /dev/null @@ -1,61 +0,0 @@ -require 'orb/model' -require 'orb/models/subscription' -require 'orb/models/subscription_fetch_costs_response' -require 'orb/orb' -require 'test/unit' - -class SubscriptionsResourceTest < Test::Unit::TestCase - - def setup - @orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - end - def test_create - response = @orb.subscriptions.create() - assert(Orb::Converter.same_type?(Orb::Models::Subscription, response), response.class.to_s) - end - def test_list - response = @orb.subscriptions.list() - assert(Orb::Converter.same_type?(Orb::Resources::SubscriptionPage, response), response.class.to_s) - end - def test_cancel_required_params - response = @orb.subscriptions.cancel("string", cancel_option: "end_of_subscription_term") - assert(Orb::Converter.same_type?(Orb::Models::Subscription, response), response.class.to_s) - end - def test_fetch - response = @orb.subscriptions.fetch("string") - assert(Orb::Converter.same_type?(Orb::Models::Subscription, response), response.class.to_s) - end - def test_fetch_costs - response = @orb.subscriptions.fetch_costs("string") - assert(Orb::Converter.same_type?(Orb::Models::SubscriptionFetchCostsResponse, response), response.class.to_s) - end - def test_fetch_schedule - response = @orb.subscriptions.fetch_schedule("string") - assert(Orb::Converter.same_type?(Orb::Resources::SubscriptionFetchScheduleResponsePage, response), response.class.to_s) - end - def test_schedule_plan_change_required_params - response = @orb.subscriptions.schedule_plan_change("string", change_option: "requested_date") - assert(Orb::Converter.same_type?(Orb::Models::Subscription, response), response.class.to_s) - end - def test_trigger_phase - response = @orb.subscriptions.trigger_phase("string") - assert(Orb::Converter.same_type?(Orb::Models::Subscription, response), response.class.to_s) - end - def test_unschedule_cancellation - response = @orb.subscriptions.unschedule_cancellation("string") - assert(Orb::Converter.same_type?(Orb::Models::Subscription, response), response.class.to_s) - end - def test_unschedule_fixed_fee_quantity_updates_required_params - response = @orb.subscriptions.unschedule_fixed_fee_quantity_updates("string", price_id: "string") - assert(Orb::Converter.same_type?(Orb::Models::Subscription, response), response.class.to_s) - end - def test_unschedule_pending_plan_changes - response = @orb.subscriptions.unschedule_pending_plan_changes("string") - assert(Orb::Converter.same_type?(Orb::Models::Subscription, response), response.class.to_s) - end - def test_update_fixed_fee_quantity_required_params - response = @orb.subscriptions.update_fixed_fee_quantity("string", price_id: "string", quantity: 0) - assert(Orb::Converter.same_type?(Orb::Models::Subscription, response), response.class.to_s) - end - -end \ No newline at end of file diff --git a/test/orb/test_helper.rb b/test/orb/test_helper.rb new file mode 100644 index 00000000..1fe7affd --- /dev/null +++ b/test/orb/test_helper.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# Requiring this file from each test file ensures we always do the following, even +# when running a single-file test: +# - Load the whole gem (as one would in production) +# - Define shared testing namespace so that we don't need to indent test files as much +# - Setting up testing dependencies + +require_relative "../../lib/orb" +require_relative "test_namespaces" + +require "minitest" +require "minitest/focus" +require "minitest/hooks/test" + +class Minitest::Test + parallelize_me! + make_my_diffs_pretty! + + include Minitest::Hooks +end + +class Time + class << self + alias_method :_now, :now + end + + def self.now = Thread.current.thread_variable_get(:time_now) || _now +end + +module Kernel + alias_method :_sleep, :sleep + + def sleep(secs) + case (counter = Thread.current.thread_variable_get(:mock_sleep)) + in Array + counter << secs + secs + else + _sleep(secs) + end + end +end diff --git a/test/orb/test_namespaces.rb b/test/orb/test_namespaces.rb new file mode 100644 index 00000000..90d6c289 --- /dev/null +++ b/test/orb/test_namespaces.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Orb + module Test + module Resources + module Coupons + end + + module Credits + end + + module Customers + module Credits + end + end + + module DimensionalPriceGroups + end + + module Events + end + + module Plans + end + + module Prices + end + end + end +end diff --git a/test/orb/top_level_test.rb b/test/orb/top_level_test.rb deleted file mode 100644 index 379e84cf..00000000 --- a/test/orb/top_level_test.rb +++ /dev/null @@ -1,16 +0,0 @@ -require 'orb/model' -require 'orb/models/top_level_ping_response' -require 'orb/orb' -require 'test/unit' - -class TopLevelResourceTest < Test::Unit::TestCase - - def setup - @orb = Orb::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - end - def test_ping - response = @orb.top_level.ping() - assert(Orb::Converter.same_type?(Orb::Models::TopLevelPingResponse, response), response.class.to_s) - end - -end \ No newline at end of file diff --git a/test/orb/util_test.rb b/test/orb/util_test.rb new file mode 100644 index 00000000..6404abe2 --- /dev/null +++ b/test/orb/util_test.rb @@ -0,0 +1,211 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +class Orb::Test::UtilTest < Minitest::Test + def test_left_map + assert_pattern do + Orb::Util.deep_merge({a: 1}, nil) => nil + end + end + + def test_right_map + assert_pattern do + Orb::Util.deep_merge(nil, {a: 1}) => {a: 1} + end + end + + def test_disjoint_maps + assert_pattern do + Orb::Util.deep_merge({b: 2}, {a: 1}) => {a: 1, b: 2} + end + end + + def test_overlapping_maps + assert_pattern do + Orb::Util.deep_merge({b: 2, c: 3}, {a: 1, c: 4}) => {a: 1, b: 2, c: 4} + end + end + + def test_nested + assert_pattern do + Orb::Util.deep_merge({b: {b2: 1}}, {b: {b2: 2}}) => {b: {b2: 2}} + end + end + + def test_nested_left_map + assert_pattern do + Orb::Util.deep_merge({b: {b2: 1}}, {b: 6}) => {b: 6} + end + end + + def test_omission + merged = Orb::Util.deep_merge( + {b: {b2: 1, b3: {c: 4, d: 5}}}, + {b: {b2: 1, b3: {c: Orb::Util::OMIT, d: 5}}} + ) + + assert_pattern do + merged => {b: {b2: 1, b3: {d: 5}}} + end + end + + def test_concat + merged = Orb::Util.deep_merge( + {a: {b: [1, 2]}}, + {a: {b: [3, 4]}}, + concat: true + ) + + assert_pattern do + merged => {a: {b: [1, 2, 3, 4]}} + end + end + + def test_concat_false + merged = Orb::Util.deep_merge( + {a: {b: [1, 2]}}, + {a: {b: [3, 4]}}, + concat: false + ) + + assert_pattern do + merged => {a: {b: [3, 4]}} + end + end + + def test_dig + assert_pattern do + Orb::Util.dig(1, nil) => 1 + Orb::Util.dig({a: 1}, :b) => nil + Orb::Util.dig({a: 1}, :a) => 1 + Orb::Util.dig({a: {b: 1}}, [:a, :b]) => 1 + + Orb::Util.dig([], 1) => nil + Orb::Util.dig([nil, [nil, 1]], [1, 1]) => 1 + Orb::Util.dig({a: [nil, 1]}, [:a, 1]) => 1 + Orb::Util.dig([], 1.0) => nil + + Orb::Util.dig(Object, 1) => nil + Orb::Util.dig([], 1.0, 2) => 2 + Orb::Util.dig([], 1.0) { 2 } => 2 + end + end + + def test_uri_parsing + %w[ + http://example.com + https://example.com/ + https://example.com:443/example?e1=e1&e2=e2&e= + ].each do |url| + parsed = Orb::Util.parse_uri(url) + unparsed = Orb::Util.unparse_uri(parsed).to_s + + assert_equal(url, unparsed) + assert_equal(parsed, Orb::Util.parse_uri(unparsed)) + end + end + + def test_joining_uris + cases = [ + [ + "h://a.b/c?d=e", + "h://nope/ignored", + Orb::Util.parse_uri("h://a.b/c?d=e") + ], + [ + "h://a.b/c?d=e&f=g", + "h://nope", + { + host: "a.b", + path: "/c", + query: {"d" => ["e"]}, + extra_query: { + "f" => ["g"] + } + } + ] + ] + + cases.each do |expect, lhs, rhs| + assert_equal( + URI.parse(expect), + Orb::Util.join_parsed_uri( + Orb::Util.parse_uri(lhs), + rhs + ) + ) + end + end + + def test_joining_uri_queries + base_url = "h://a.b/c?d=e" + cases = { + "c2" => "h://a.b/c/c2", + "/c2?f=g" => "h://a.b/c2?f=g", + "/c?f=g" => "h://a.b/c?d=e&f=g" + } + + cases.each do |path, expected| + assert_equal( + URI.parse(expected), + Orb::Util.join_parsed_uri( + Orb::Util.parse_uri(base_url), + {path: path} + ) + ) + end + end + + class FakeCGI < CGI + def initialize(headers, io) + @ctype = headers["content-type"] + @io = io + super() + end + + def stdinput = @io + + def env_table + { + "REQUEST_METHOD" => "POST", + "CONTENT_TYPE" => @ctype, + "CONTENT_LENGTH" => stdinput.string.length + } + end + end + + def test_multipart_file_encode + headers = {"content-type" => "multipart/form-data"} + File.open(__FILE__) do |fd| + cases = { + StringIO.new("abc") => "abc", + fd => StringIO + } + cases.each do |body, val| + encoded = Orb::Util.encode_content(headers, body) + cgi = FakeCGI.new(*encoded) + assert_pattern do + cgi[""] => ^val + end + end + end + end + + def test_multipart_hash_encode + headers = {"content-type" => "multipart/form-data"} + cases = { + {a: 2, b: 3} => {"a" => "2", "b" => "3"}, + {a: 2, b: nil} => {"a" => "2", "b" => "null"}, + {a: 2, b: [1, 2, 3]} => {"a" => "2", "b" => "1"}, + {file: StringIO.new("a")} => {"file" => "a"} + } + cases.each do |body, testcase| + encoded = Orb::Util.encode_content(headers, body) + cgi = FakeCGI.new(*encoded) + testcase.each do |key, val| + assert_equal(val, cgi[key]) + end + end + end +end From d639fc412540aad39cca170932326e78994e0dcc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 00:25:04 +0000 Subject: [PATCH 2/2] release: 0.1.0-alpha.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 37 +++++++++++++++++++++++++++++++++++ lib/orb/version.rb | 2 +- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c4762802..ba6c3483 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.1-alpha.0" + ".": "0.1.0-alpha.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..38f6bdae --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,37 @@ +# Changelog + +## 0.1.0-alpha.1 (2025-02-06) + +Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/orbcorp/orb-ruby/compare/v0.0.1-alpha.0...v0.1.0-alpha.1) + +### Features + +* **api:** manual updates ([#1](https://github.com/orbcorp/orb-ruby/issues/1)) ([77ed62a](https://github.com/orbcorp/orb-ruby/commit/77ed62a9e0db52bad066462d12b7a66625d9dd89)) +* **api:** remove unsupported params ([bc0ff3a](https://github.com/orbcorp/orb-ruby/commit/bc0ff3a901cf9a790f6bcf5cd5b74fee05e04986)) +* **api:** updates ([cf773b5](https://github.com/orbcorp/orb-ruby/commit/cf773b54f507991f83d675eac765882e7b475070)) +* **api:** updates ([5a0c078](https://github.com/orbcorp/orb-ruby/commit/5a0c07810335ababdd14e14fc5873267036b8ce5)) +* **api:** updates ([71edb4f](https://github.com/orbcorp/orb-ruby/commit/71edb4f4dcafd4c5b3a3ca44c6b403cebfca6c94)) +* **api:** updates ([d26936e](https://github.com/orbcorp/orb-ruby/commit/d26936ebdab15ca264facaf1a8118475c7567e44)) +* avoid overwriting Ruby class members ([6cc8147](https://github.com/orbcorp/orb-ruby/commit/6cc8147317f23809af06682705c752572084c276)) +* basic Ruby pagination support ([15d64b4](https://github.com/orbcorp/orb-ruby/commit/15d64b4fa4fd15ead82b00996c30f737a03e9ed9)) +* document Ruby SDK basics ([cd30a25](https://github.com/orbcorp/orb-ruby/commit/cd30a25d9b8c847a3b95743f32e25a83d97e218d)) +* handle HTTP errors in Ruby ([11d81db](https://github.com/orbcorp/orb-ruby/commit/11d81dbc47a14233ca28100a567301bce24b7fea)) +* initial commit ([647e35c](https://github.com/orbcorp/orb-ruby/commit/647e35ca0153e2226f00b858e4e45a967fe605a8)) +* initial commit ([#1](https://github.com/orbcorp/orb-ruby/issues/1)) ([ef4701e](https://github.com/orbcorp/orb-ruby/commit/ef4701ecf8ca4a1b6361796ac9ebf1e6e0879e3c)) +* initial commit ([#2](https://github.com/orbcorp/orb-ruby/issues/2)) ([8f144a1](https://github.com/orbcorp/orb-ruby/commit/8f144a12004ae09b742e1848fcc1b5e6844b33dc)) +* prettier Ruby code ([1849b10](https://github.com/orbcorp/orb-ruby/commit/1849b106a22de8247eaad0520cd03aa00f5cae5c)) +* produce unit tests for generated code ([c0075ce](https://github.com/orbcorp/orb-ruby/commit/c0075ceb23efebbb6eaffdf9f0ac5fac764c91a6)) +* provide code at less ambiguous paths ([deddf74](https://github.com/orbcorp/orb-ruby/commit/deddf74670653a0ceb929988aceabd4dd42d92cd)) +* ruby support for some auth methods ([0e3eb7d](https://github.com/orbcorp/orb-ruby/commit/0e3eb7df13890cb930aabef71d87da268e2391f1)) +* use example values in tests ([08f866a](https://github.com/orbcorp/orb-ruby/commit/08f866a942b86395733bd86ee52e37dd0783f3c3)) + + +### Bug Fixes + +* **client:** include more detail in error messages ([7b46a84](https://github.com/orbcorp/orb-ruby/commit/7b46a841c02805c5703eb919d62cbcc7d457e2d4)) +* rename customer.credits.ledger.create_entry_by_exteral_id and RequestValidationErrors ([3468947](https://github.com/orbcorp/orb-ruby/commit/3468947cbe45a79fac30c05872b8727b4362fef4)) + + +### Documentation + +* **readme:** improve example snippets ([92c7892](https://github.com/orbcorp/orb-ruby/commit/92c78921b97b4d6e7155bd8a093bb0d4eac834ae)) diff --git a/lib/orb/version.rb b/lib/orb/version.rb index 2ee7a1d4..6f7fad3c 100644 --- a/lib/orb/version.rb +++ b/lib/orb/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Orb - VERSION = "0.0.1-alpha.0" + VERSION = "0.1.0-alpha.1" end