diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ee49ac2d..fd0ccba9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.11" + ".": "0.1.0-alpha.12" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index a16642c4..fb35dc35 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-99ab2def905df4700d0555a61c3e6f3e378664df85756fc0ff604aed8f8c5f8b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-097aa5c0e1408d7bd31c15caded400b84f45c0296aebdf67a1dc1a4013f371dd.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e9a19b2..70e0b435 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.1.0-alpha.12 (2025-02-21) + +Full Changelog: [v0.1.0-alpha.11...v0.1.0-alpha.12](https://github.com/orbcorp/orb-ruby/compare/v0.1.0-alpha.11...v0.1.0-alpha.12) + +### Features + +* **api:** api update ([#64](https://github.com/orbcorp/orb-ruby/issues/64)) ([d32e004](https://github.com/orbcorp/orb-ruby/commit/d32e00419803bd61930782859f50c90223688b86)) + + +### Chores + +* **internal:** version bump ([#61](https://github.com/orbcorp/orb-ruby/issues/61)) ([e75cd95](https://github.com/orbcorp/orb-ruby/commit/e75cd95f6ad3bd68ae4eeb43a2b3af86664b5d7e)) +* sort imports via topological dependency & file path ([#63](https://github.com/orbcorp/orb-ruby/issues/63)) ([ae2296e](https://github.com/orbcorp/orb-ruby/commit/ae2296e987462259283f548724b46200c50cc752)) + ## 0.1.0-alpha.11 (2025-02-20) Full Changelog: [v0.1.0-alpha.10...v0.1.0-alpha.11](https://github.com/orbcorp/orb-ruby/compare/v0.1.0-alpha.10...v0.1.0-alpha.11) diff --git a/Gemfile.lock b/Gemfile.lock index 5e2e3863..4e7a3d04 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - orb (0.1.0.pre.alpha.11) + orb (0.1.0.pre.alpha.12) connection_pool GEM diff --git a/lib/orb.rb b/lib/orb.rb index 360d0e13..330bbe0d 100644 --- a/lib/orb.rb +++ b/lib/orb.rb @@ -28,181 +28,183 @@ require_relative "orb/pooled_net_requester" require_relative "orb/client" require_relative "orb/page" +require_relative "orb/models/alert" +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/alert_list_params" +require_relative "orb/models/alert_retrieve_params" +require_relative "orb/models/alert_update_params" require_relative "orb/models/amount_discount" +require_relative "orb/models/billable_metric" 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_create_params" require_relative "orb/models/coupon_fetch_params" +require_relative "orb/models/coupon_list_params" require_relative "orb/models/coupons/subscription_list_params" +require_relative "orb/models/credit_note" 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/credit_note_list_params" +require_relative "orb/models/customer" 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/customer_fetch_params" +require_relative "orb/models/customer_list_params" +require_relative "orb/models/customers/balance_transaction_create_params" +require_relative "orb/models/customers/balance_transaction_create_response" +require_relative "orb/models/customers/balance_transaction_list_params" +require_relative "orb/models/customers/balance_transaction_list_response" require_relative "orb/models/customers/cost_list_by_external_id_params" -require_relative "orb/models/customers/credit_list_params" +require_relative "orb/models/customers/cost_list_by_external_id_response" +require_relative "orb/models/customers/cost_list_params" +require_relative "orb/models/customers/cost_list_response" 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/credit_list_by_external_id_response" +require_relative "orb/models/customers/credit_list_params" +require_relative "orb/models/customers/credit_list_response" require_relative "orb/models/customers/credits/ledger_create_entry_by_external_id_params" +require_relative "orb/models/customers/credits/ledger_create_entry_by_external_id_response" +require_relative "orb/models/customers/credits/ledger_create_entry_params" +require_relative "orb/models/customers/credits/ledger_create_entry_response" 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/ledger_list_by_external_id_response" +require_relative "orb/models/customers/credits/ledger_list_params" +require_relative "orb/models/customers/credits/ledger_list_response" require_relative "orb/models/customers/credits/top_up_create_by_external_id_params" +require_relative "orb/models/customers/credits/top_up_create_by_external_id_response" +require_relative "orb/models/customers/credits/top_up_create_params" +require_relative "orb/models/customers/credits/top_up_create_response" require_relative "orb/models/customers/credits/top_up_delete_by_external_id_params" +require_relative "orb/models/customers/credits/top_up_delete_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/customers/credits/top_up_list_by_external_id_response" +require_relative "orb/models/customers/credits/top_up_list_params" +require_relative "orb/models/customers/credits/top_up_list_response" +require_relative "orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params" +require_relative "orb/models/customer_sync_payment_methods_from_gateway_params" +require_relative "orb/models/customer_update_by_external_id_params" +require_relative "orb/models/customer_update_params" +require_relative "orb/models/dimensional_price_group" +require_relative "orb/models/dimensional_price_group_create_params" +require_relative "orb/models/dimensional_price_group_list_params" +require_relative "orb/models/dimensional_price_group_retrieve_params" +require_relative "orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params" +require_relative "orb/models/dimensional_price_groups" +require_relative "orb/models/discount" +require_relative "orb/models/evaluate_price_group" require_relative "orb/models/event_deprecate_params" +require_relative "orb/models/event_deprecate_response" 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/event_ingest_response" require_relative "orb/models/events/backfill_close_params" +require_relative "orb/models/events/backfill_close_response" +require_relative "orb/models/events/backfill_create_params" +require_relative "orb/models/events/backfill_create_response" require_relative "orb/models/events/backfill_fetch_params" +require_relative "orb/models/events/backfill_fetch_response" +require_relative "orb/models/events/backfill_list_params" +require_relative "orb/models/events/backfill_list_response" require_relative "orb/models/events/backfill_revert_params" +require_relative "orb/models/events/backfill_revert_response" +require_relative "orb/models/events/event_volumes" require_relative "orb/models/events/volume_list_params" -require_relative "orb/models/invoice_line_item_create_params" +require_relative "orb/models/event_search_params" +require_relative "orb/models/event_search_response" +require_relative "orb/models/event_update_params" +require_relative "orb/models/event_update_response" +require_relative "orb/models/invoice" 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_fetch_upcoming_response" require_relative "orb/models/invoice_issue_params" +require_relative "orb/models/invoice_level_discount" +require_relative "orb/models/invoice_line_item_create_params" +require_relative "orb/models/invoice_line_item_create_response" +require_relative "orb/models/invoice_list_params" require_relative "orb/models/invoice_mark_paid_params" require_relative "orb/models/invoice_pay_params" +require_relative "orb/models/invoice_update_params" require_relative "orb/models/invoice_void_params" +require_relative "orb/models/item" 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/item_list_params" +require_relative "orb/models/item_update_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/metric_list_params" +require_relative "orb/models/metric_update_params" +require_relative "orb/models/pagination_metadata" +require_relative "orb/models/percentage_discount" +require_relative "orb/models/plan" 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/plan_list_params" require_relative "orb/models/plans/external_plan_id_fetch_params" +require_relative "orb/models/plans/external_plan_id_update_params" +require_relative "orb/models/plan_update_params" +require_relative "orb/models/price" 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_evaluate_response" require_relative "orb/models/price_fetch_params" -require_relative "orb/models/prices/external_price_id_update_params" +require_relative "orb/models/price_list_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/prices/external_price_id_update_params" +require_relative "orb/models/price_update_params" +require_relative "orb/models/subscription" require_relative "orb/models/subscription_cancel_params" -require_relative "orb/models/subscription_fetch_params" +require_relative "orb/models/subscription_cancel_response" +require_relative "orb/models/subscription_create_params" +require_relative "orb/models/subscription_create_response" require_relative "orb/models/subscription_fetch_costs_params" +require_relative "orb/models/subscription_fetch_costs_response" +require_relative "orb/models/subscription_fetch_params" require_relative "orb/models/subscription_fetch_schedule_params" +require_relative "orb/models/subscription_fetch_schedule_response" require_relative "orb/models/subscription_fetch_usage_params" +require_relative "orb/models/subscription_list_params" require_relative "orb/models/subscription_price_intervals_params" +require_relative "orb/models/subscription_price_intervals_response" +require_relative "orb/models/subscriptions" require_relative "orb/models/subscription_schedule_plan_change_params" +require_relative "orb/models/subscription_schedule_plan_change_response" require_relative "orb/models/subscription_trigger_phase_params" +require_relative "orb/models/subscription_trigger_phase_response" require_relative "orb/models/subscription_unschedule_cancellation_params" +require_relative "orb/models/subscription_unschedule_cancellation_response" require_relative "orb/models/subscription_unschedule_fixed_fee_quantity_updates_params" +require_relative "orb/models/subscription_unschedule_fixed_fee_quantity_updates_response" require_relative "orb/models/subscription_unschedule_pending_plan_changes_params" +require_relative "orb/models/subscription_unschedule_pending_plan_changes_response" require_relative "orb/models/subscription_update_fixed_fee_quantity_params" +require_relative "orb/models/subscription_update_fixed_fee_quantity_response" +require_relative "orb/models/subscription_update_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/resources/top_level" +require_relative "orb/models/subscription_update_trial_response" +require_relative "orb/models/subscription_usage" +require_relative "orb/models/top_level_ping_params" +require_relative "orb/models/top_level_ping_response" +require_relative "orb/models/trial_discount" +require_relative "orb/resources/alerts" 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/balance_transactions" 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/dimensional_price_groups" +require_relative "orb/resources/dimensional_price_groups/external_dimensional_price_group_id" require_relative "orb/resources/events" require_relative "orb/resources/events/backfills" require_relative "orb/resources/events/volume" @@ -215,6 +217,4 @@ 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" +require_relative "orb/resources/top_level" diff --git a/lib/orb/models/customer.rb b/lib/orb/models/customer.rb index 64130439..29057077 100644 --- a/lib/orb/models/customer.rb +++ b/lib/orb/models/customer.rb @@ -65,6 +65,12 @@ class Customer < Orb::BaseModel # @return [String, nil] required :external_customer_id, String, nil?: true + # @!attribute hierarchy + # The hierarchical relationships for this customer. + # + # @return [Orb::Models::Customer::Hierarchy] + required :hierarchy, -> { Orb::Models::Customer::Hierarchy } + # @!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 @@ -266,6 +272,7 @@ class Customer < Orb::BaseModel # # @param email_delivery [Boolean] # # @param exempt_from_automated_tax [Boolean, nil] # # @param external_customer_id [String, nil] + # # @param hierarchy [Orb::Models::Customer::Hierarchy] # # @param metadata [Hash{Symbol=>String}] # # @param name [String] # # @param payment_provider [Symbol, Orb::Models::Customer::PaymentProvider, nil] @@ -289,6 +296,7 @@ class Customer < Orb::BaseModel # email_delivery:, # exempt_from_automated_tax:, # external_customer_id:, + # hierarchy:, # metadata:, # name:, # payment_provider:, @@ -350,6 +358,68 @@ class BillingAddress < Orb::BaseModel # def initialize: (Hash | Orb::BaseModel) -> void end + class Hierarchy < Orb::BaseModel + # @!attribute children + # + # @return [Array] + required :children, -> { Orb::ArrayOf[Orb::Models::Customer::Hierarchy::Child] } + + # @!attribute parent + # + # @return [Orb::Models::Customer::Hierarchy::Parent, nil] + required :parent, -> { Orb::Models::Customer::Hierarchy::Parent }, nil?: true + + # @!parse + # # The hierarchical relationships for this customer. + # # + # # @param children [Array] + # # @param parent [Orb::Models::Customer::Hierarchy::Parent, nil] + # # + # def initialize(children:, parent:, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + + class Child < 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 + + class Parent < 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 + end + # @abstract # # This is used for creating charges or invoices in an external system via Orb. diff --git a/lib/orb/models/customer_create_params.rb b/lib/orb/models/customer_create_params.rb index 9fa70ee3..5e08d3ee 100644 --- a/lib/orb/models/customer_create_params.rb +++ b/lib/orb/models/customer_create_params.rb @@ -68,6 +68,12 @@ class CustomerCreateParams < Orb::BaseModel # @return [String, nil] optional :external_customer_id, String, nil?: true + # @!attribute hierarchy + # The hierarchical relationships for this customer. + # + # @return [Orb::Models::CustomerCreateParams::Hierarchy, nil] + optional :hierarchy, -> { Orb::Models::CustomerCreateParams::Hierarchy }, 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 @@ -236,6 +242,7 @@ class CustomerCreateParams < Orb::BaseModel # # @param currency [String, nil] # # @param email_delivery [Boolean, nil] # # @param external_customer_id [String, nil] + # # @param hierarchy [Orb::Models::CustomerCreateParams::Hierarchy, nil] # # @param metadata [Hash{Symbol=>String, nil}, nil] # # @param payment_provider [Symbol, Orb::Models::CustomerCreateParams::PaymentProvider, nil] # # @param payment_provider_id [String, nil] @@ -256,6 +263,7 @@ class CustomerCreateParams < Orb::BaseModel # currency: nil, # email_delivery: nil, # external_customer_id: nil, + # hierarchy: nil, # metadata: nil, # payment_provider: nil, # payment_provider_id: nil, @@ -358,6 +366,36 @@ class BillingAddress < Orb::BaseModel # def initialize: (Hash | Orb::BaseModel) -> void end + class Hierarchy < Orb::BaseModel + # @!attribute [r] child_customer_ids + # A list of child customer IDs to add to the hierarchy. The desired child + # customers must not already be part of another hierarchy. + # + # @return [Array, nil] + optional :child_customer_ids, Orb::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :child_customer_ids + + # @!attribute parent_customer_id + # The ID of the parent customer in the hierarchy. The desired parent customer must + # not be a child of another customer. + # + # @return [String, nil] + optional :parent_customer_id, String, nil?: true + + # @!parse + # # The hierarchical relationships for this customer. + # # + # # @param child_customer_ids [Array] + # # @param parent_customer_id [String, nil] + # # + # def initialize(child_customer_ids: nil, parent_customer_id: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + # @abstract # # This is used for creating charges or invoices in an external system via Orb. diff --git a/lib/orb/models/customer_update_by_external_id_params.rb b/lib/orb/models/customer_update_by_external_id_params.rb index 1a34666e..ae34b576 100644 --- a/lib/orb/models/customer_update_by_external_id_params.rb +++ b/lib/orb/models/customer_update_by_external_id_params.rb @@ -61,6 +61,12 @@ class CustomerUpdateByExternalIDParams < Orb::BaseModel # @return [String, nil] optional :external_customer_id, String, nil?: true + # @!attribute hierarchy + # The hierarchical relationships for this customer. + # + # @return [Orb::Models::CustomerUpdateByExternalIDParams::Hierarchy, nil] + optional :hierarchy, -> { Orb::Models::CustomerUpdateByExternalIDParams::Hierarchy }, 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 @@ -236,6 +242,7 @@ class CustomerUpdateByExternalIDParams < Orb::BaseModel # # @param email [String, nil] # # @param email_delivery [Boolean, nil] # # @param external_customer_id [String, nil] + # # @param hierarchy [Orb::Models::CustomerUpdateByExternalIDParams::Hierarchy, nil] # # @param metadata [Hash{Symbol=>String, nil}, nil] # # @param name [String, nil] # # @param payment_provider [Symbol, Orb::Models::CustomerUpdateByExternalIDParams::PaymentProvider, nil] @@ -255,6 +262,7 @@ class CustomerUpdateByExternalIDParams < Orb::BaseModel # email: nil, # email_delivery: nil, # external_customer_id: nil, + # hierarchy: nil, # metadata: nil, # name: nil, # payment_provider: nil, @@ -357,6 +365,36 @@ class BillingAddress < Orb::BaseModel # def initialize: (Hash | Orb::BaseModel) -> void end + class Hierarchy < Orb::BaseModel + # @!attribute [r] child_customer_ids + # A list of child customer IDs to add to the hierarchy. The desired child + # customers must not already be part of another hierarchy. + # + # @return [Array, nil] + optional :child_customer_ids, Orb::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :child_customer_ids + + # @!attribute parent_customer_id + # The ID of the parent customer in the hierarchy. The desired parent customer must + # not be a child of another customer. + # + # @return [String, nil] + optional :parent_customer_id, String, nil?: true + + # @!parse + # # The hierarchical relationships for this customer. + # # + # # @param child_customer_ids [Array] + # # @param parent_customer_id [String, nil] + # # + # def initialize(child_customer_ids: nil, parent_customer_id: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + # @abstract # # This is used for creating charges or invoices in an external system via Orb. diff --git a/lib/orb/models/customer_update_params.rb b/lib/orb/models/customer_update_params.rb index 964519d7..c929f0ae 100644 --- a/lib/orb/models/customer_update_params.rb +++ b/lib/orb/models/customer_update_params.rb @@ -59,6 +59,12 @@ class CustomerUpdateParams < Orb::BaseModel # @return [String, nil] optional :external_customer_id, String, nil?: true + # @!attribute hierarchy + # The hierarchical relationships for this customer. + # + # @return [Orb::Models::CustomerUpdateParams::Hierarchy, nil] + optional :hierarchy, -> { Orb::Models::CustomerUpdateParams::Hierarchy }, 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 @@ -228,6 +234,7 @@ class CustomerUpdateParams < Orb::BaseModel # # @param email [String, nil] # # @param email_delivery [Boolean, nil] # # @param external_customer_id [String, nil] + # # @param hierarchy [Orb::Models::CustomerUpdateParams::Hierarchy, nil] # # @param metadata [Hash{Symbol=>String, nil}, nil] # # @param name [String, nil] # # @param payment_provider [Symbol, Orb::Models::CustomerUpdateParams::PaymentProvider, nil] @@ -247,6 +254,7 @@ class CustomerUpdateParams < Orb::BaseModel # email: nil, # email_delivery: nil, # external_customer_id: nil, + # hierarchy: nil, # metadata: nil, # name: nil, # payment_provider: nil, @@ -349,6 +357,36 @@ class BillingAddress < Orb::BaseModel # def initialize: (Hash | Orb::BaseModel) -> void end + class Hierarchy < Orb::BaseModel + # @!attribute [r] child_customer_ids + # A list of child customer IDs to add to the hierarchy. The desired child + # customers must not already be part of another hierarchy. + # + # @return [Array, nil] + optional :child_customer_ids, Orb::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :child_customer_ids + + # @!attribute parent_customer_id + # The ID of the parent customer in the hierarchy. The desired parent customer must + # not be a child of another customer. + # + # @return [String, nil] + optional :parent_customer_id, String, nil?: true + + # @!parse + # # The hierarchical relationships for this customer. + # # + # # @param child_customer_ids [Array] + # # @param parent_customer_id [String, nil] + # # + # def initialize(child_customer_ids: nil, parent_customer_id: nil, **) = super + + # def initialize: (Hash | Orb::BaseModel) -> void + end + # @abstract # # This is used for creating charges or invoices in an external system via Orb. diff --git a/lib/orb/models/subscription_create_params.rb b/lib/orb/models/subscription_create_params.rb index e25acd30..820066d0 100644 --- a/lib/orb/models/subscription_create_params.rb +++ b/lib/orb/models/subscription_create_params.rb @@ -220,6 +220,17 @@ class SubscriptionCreateParams < Orb::BaseModel # @return [Integer, nil] optional :trial_duration_days, Integer, nil?: true + # @!attribute usage_customer_ids + # A list of customer IDs whose usage events will be aggregated and billed under + # this subscription. By default, a subscription only considers usage events + # associated with its attached customer's customer_id. When usage_customer_ids is + # provided, the subscription includes usage events from the specified customers + # only. Provided usage_customer_ids must be either the customer for this + # subscription itself, or any of that customer's children. + # + # @return [Array, nil] + optional :usage_customer_ids, Orb::ArrayOf[String], nil?: true + # @!parse # # @param add_adjustments [Array, nil] # # @param add_prices [Array, nil] @@ -251,6 +262,7 @@ class SubscriptionCreateParams < Orb::BaseModel # # @param replace_prices [Array, nil] # # @param start_date [Time, nil] # # @param trial_duration_days [Integer, nil] + # # @param usage_customer_ids [Array, nil] # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] # # # def initialize( @@ -284,6 +296,7 @@ class SubscriptionCreateParams < Orb::BaseModel # replace_prices: nil, # start_date: nil, # trial_duration_days: nil, + # usage_customer_ids: nil, # request_options: {}, # ** # ) diff --git a/lib/orb/models/subscription_schedule_plan_change_params.rb b/lib/orb/models/subscription_schedule_plan_change_params.rb index 2f4dbef2..77e3ffcb 100644 --- a/lib/orb/models/subscription_schedule_plan_change_params.rb +++ b/lib/orb/models/subscription_schedule_plan_change_params.rb @@ -198,6 +198,17 @@ class SubscriptionSchedulePlanChangeParams < Orb::BaseModel # @return [Integer, nil] optional :trial_duration_days, Integer, nil?: true + # @!attribute usage_customer_ids + # A list of customer IDs whose usage events will be aggregated and billed under + # this subscription. By default, a subscription only considers usage events + # associated with its attached customer's customer_id. When usage_customer_ids is + # provided, the subscription includes usage events from the specified customers + # only. Provided usage_customer_ids must be either the customer for this + # subscription itself, or any of that customer's children. + # + # @return [Array, nil] + optional :usage_customer_ids, Orb::ArrayOf[String], nil?: true + # @!parse # # @param change_option [Symbol, Orb::Models::SubscriptionSchedulePlanChangeParams::ChangeOption] # # @param add_adjustments [Array, nil] @@ -224,6 +235,7 @@ class SubscriptionSchedulePlanChangeParams < Orb::BaseModel # # @param replace_adjustments [Array, nil] # # @param replace_prices [Array, nil] # # @param trial_duration_days [Integer, nil] + # # @param usage_customer_ids [Array, nil] # # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}] # # # def initialize( @@ -252,6 +264,7 @@ class SubscriptionSchedulePlanChangeParams < Orb::BaseModel # replace_adjustments: nil, # replace_prices: nil, # trial_duration_days: nil, + # usage_customer_ids: nil, # request_options: {}, # ** # ) diff --git a/lib/orb/resources/customers.rb b/lib/orb/resources/customers.rb index f090a2da..7526333d 100644 --- a/lib/orb/resources/customers.rb +++ b/lib/orb/resources/customers.rb @@ -53,6 +53,8 @@ class Customers # system as an alias for this Customer. Use this field to identify a customer by # an existing identifier in your system. # + # @option params [Orb::Models::CustomerCreateParams::Hierarchy, nil] :hierarchy The hierarchical relationships for this customer. + # # @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`. @@ -226,6 +228,8 @@ def create(params) # @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 [Orb::Models::CustomerUpdateParams::Hierarchy, nil] :hierarchy The hierarchical relationships for this customer. + # # @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`. @@ -569,6 +573,8 @@ def sync_payment_methods_from_gateway_by_external_customer_id(customer_id, param # @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 [Orb::Models::CustomerUpdateByExternalIDParams::Hierarchy, nil] :hierarchy The hierarchical relationships for this customer. + # # @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`. diff --git a/lib/orb/resources/subscriptions.rb b/lib/orb/resources/subscriptions.rb index 61695d38..bdebb743 100644 --- a/lib/orb/resources/subscriptions.rb +++ b/lib/orb/resources/subscriptions.rb @@ -348,6 +348,13 @@ class Subscriptions # value specified in the plan. If `0` is provided, the trial on the plan will be # skipped. # + # @option params [Array, nil] :usage_customer_ids A list of customer IDs whose usage events will be aggregated and billed under + # this subscription. By default, a subscription only considers usage events + # associated with its attached customer's customer_id. When usage_customer_ids is + # provided, the subscription includes usage events from the specified customers + # only. Provided usage_customer_ids must be either the customer for this + # subscription itself, or any of that customer's children. + # # @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options # # @return [Orb::Models::SubscriptionCreateResponse] @@ -1252,6 +1259,13 @@ def price_intervals(subscription_id, params = {}) # value specified in the plan. If `0` is provided, the trial on the plan will be # skipped. # + # @option params [Array, nil] :usage_customer_ids A list of customer IDs whose usage events will be aggregated and billed under + # this subscription. By default, a subscription only considers usage events + # associated with its attached customer's customer_id. When usage_customer_ids is + # provided, the subscription includes usage events from the specified customers + # only. Provided usage_customer_ids must be either the customer for this + # subscription itself, or any of that customer's children. + # # @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options # # @return [Orb::Models::SubscriptionSchedulePlanChangeResponse] diff --git a/lib/orb/version.rb b/lib/orb/version.rb index 67d01d88..4353c86f 100644 --- a/lib/orb/version.rb +++ b/lib/orb/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Orb - VERSION = "0.1.0-alpha.11" + VERSION = "0.1.0-alpha.12" end diff --git a/rbi/lib/orb/models/customer.rbi b/rbi/lib/orb/models/customer.rbi index b10159d8..d9ea5366 100644 --- a/rbi/lib/orb/models/customer.rbi +++ b/rbi/lib/orb/models/customer.rbi @@ -94,6 +94,14 @@ module Orb def external_customer_id=(_) end + sig { returns(Orb::Models::Customer::Hierarchy) } + def hierarchy + end + + sig { params(_: Orb::Models::Customer::Hierarchy).returns(Orb::Models::Customer::Hierarchy) } + def hierarchy=(_) + end + sig { returns(T::Hash[Symbol, String]) } def metadata end @@ -196,6 +204,7 @@ module Orb email_delivery: T::Boolean, exempt_from_automated_tax: T.nilable(T::Boolean), external_customer_id: T.nilable(String), + hierarchy: Orb::Models::Customer::Hierarchy, metadata: T::Hash[Symbol, String], name: String, payment_provider: T.nilable(Symbol), @@ -221,6 +230,7 @@ module Orb email_delivery:, exempt_from_automated_tax:, external_customer_id:, + hierarchy:, metadata:, name:, payment_provider:, @@ -249,6 +259,7 @@ module Orb email_delivery: T::Boolean, exempt_from_automated_tax: T.nilable(T::Boolean), external_customer_id: T.nilable(String), + hierarchy: Orb::Models::Customer::Hierarchy, metadata: T::Hash[Symbol, String], name: String, payment_provider: T.nilable(Symbol), @@ -345,6 +356,104 @@ module Orb end end + class Hierarchy < Orb::BaseModel + sig { returns(T::Array[Orb::Models::Customer::Hierarchy::Child]) } + def children + end + + sig do + params(_: T::Array[Orb::Models::Customer::Hierarchy::Child]) + .returns(T::Array[Orb::Models::Customer::Hierarchy::Child]) + end + def children=(_) + end + + sig { returns(T.nilable(Orb::Models::Customer::Hierarchy::Parent)) } + def parent + end + + sig do + params(_: T.nilable(Orb::Models::Customer::Hierarchy::Parent)) + .returns(T.nilable(Orb::Models::Customer::Hierarchy::Parent)) + end + def parent=(_) + end + + sig do + params( + children: T::Array[Orb::Models::Customer::Hierarchy::Child], + parent: T.nilable(Orb::Models::Customer::Hierarchy::Parent) + ) + .void + end + def initialize(children:, parent:) + end + + sig do + override + .returns( + { + children: T::Array[Orb::Models::Customer::Hierarchy::Child], + parent: T.nilable(Orb::Models::Customer::Hierarchy::Parent) + } + ) + end + def to_hash + end + + class Child < Orb::BaseModel + sig { returns(String) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { returns(T.nilable(String)) } + def external_customer_id + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def external_customer_id=(_) + end + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:) + end + + sig { override.returns({id: String, external_customer_id: T.nilable(String)}) } + def to_hash + end + end + + class Parent < Orb::BaseModel + sig { returns(String) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { returns(T.nilable(String)) } + def external_customer_id + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def external_customer_id=(_) + end + + sig { params(id: String, external_customer_id: T.nilable(String)).void } + def initialize(id:, external_customer_id:) + end + + sig { override.returns({id: String, external_customer_id: T.nilable(String)}) } + def to_hash + end + end + end + class PaymentProvider < Orb::Enum abstract! diff --git a/rbi/lib/orb/models/customer_create_params.rbi b/rbi/lib/orb/models/customer_create_params.rbi index d8c24998..76910a58 100644 --- a/rbi/lib/orb/models/customer_create_params.rbi +++ b/rbi/lib/orb/models/customer_create_params.rbi @@ -84,6 +84,17 @@ module Orb def external_customer_id=(_) end + sig { returns(T.nilable(Orb::Models::CustomerCreateParams::Hierarchy)) } + def hierarchy + end + + sig do + params(_: T.nilable(Orb::Models::CustomerCreateParams::Hierarchy)) + .returns(T.nilable(Orb::Models::CustomerCreateParams::Hierarchy)) + end + def hierarchy=(_) + end + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } def metadata end @@ -197,6 +208,7 @@ module Orb currency: T.nilable(String), email_delivery: T.nilable(T::Boolean), external_customer_id: T.nilable(String), + hierarchy: T.nilable(Orb::Models::CustomerCreateParams::Hierarchy), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), payment_provider: T.nilable(Symbol), payment_provider_id: T.nilable(String), @@ -224,6 +236,7 @@ module Orb currency: nil, email_delivery: nil, external_customer_id: nil, + hierarchy: nil, metadata: nil, payment_provider: nil, payment_provider_id: nil, @@ -249,6 +262,7 @@ module Orb currency: T.nilable(String), email_delivery: T.nilable(T::Boolean), external_customer_id: T.nilable(String), + hierarchy: T.nilable(Orb::Models::CustomerCreateParams::Hierarchy), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), payment_provider: T.nilable(Symbol), payment_provider_id: T.nilable(String), @@ -426,6 +440,34 @@ module Orb end end + class Hierarchy < Orb::BaseModel + sig { returns(T.nilable(T::Array[String])) } + def child_customer_ids + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def child_customer_ids=(_) + end + + sig { returns(T.nilable(String)) } + def parent_customer_id + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def parent_customer_id=(_) + end + + sig { params(child_customer_ids: T::Array[String], parent_customer_id: T.nilable(String)).void } + def initialize(child_customer_ids: nil, parent_customer_id: nil) + end + + sig do + override.returns({child_customer_ids: T::Array[String], parent_customer_id: T.nilable(String)}) + end + def to_hash + end + end + class PaymentProvider < Orb::Enum abstract! 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 index f32967f5..6936f16b 100644 --- a/rbi/lib/orb/models/customer_update_by_external_id_params.rbi +++ b/rbi/lib/orb/models/customer_update_by_external_id_params.rbi @@ -76,6 +76,17 @@ module Orb def external_customer_id=(_) end + sig { returns(T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::Hierarchy)) } + def hierarchy + end + + sig do + params(_: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::Hierarchy)) + .returns(T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::Hierarchy)) + end + def hierarchy=(_) + end + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } def metadata end @@ -188,6 +199,7 @@ module Orb email: T.nilable(String), email_delivery: T.nilable(T::Boolean), external_customer_id: T.nilable(String), + hierarchy: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::Hierarchy), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), name: T.nilable(String), payment_provider: T.nilable(Symbol), @@ -214,6 +226,7 @@ module Orb email: nil, email_delivery: nil, external_customer_id: nil, + hierarchy: nil, metadata: nil, name: nil, payment_provider: nil, @@ -238,6 +251,7 @@ module Orb email: T.nilable(String), email_delivery: T.nilable(T::Boolean), external_customer_id: T.nilable(String), + hierarchy: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::Hierarchy), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), name: T.nilable(String), payment_provider: T.nilable(Symbol), @@ -425,6 +439,34 @@ module Orb end end + class Hierarchy < Orb::BaseModel + sig { returns(T.nilable(T::Array[String])) } + def child_customer_ids + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def child_customer_ids=(_) + end + + sig { returns(T.nilable(String)) } + def parent_customer_id + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def parent_customer_id=(_) + end + + sig { params(child_customer_ids: T::Array[String], parent_customer_id: T.nilable(String)).void } + def initialize(child_customer_ids: nil, parent_customer_id: nil) + end + + sig do + override.returns({child_customer_ids: T::Array[String], parent_customer_id: T.nilable(String)}) + end + def to_hash + end + end + class PaymentProvider < Orb::Enum abstract! diff --git a/rbi/lib/orb/models/customer_update_params.rbi b/rbi/lib/orb/models/customer_update_params.rbi index d02efe08..700cc5f3 100644 --- a/rbi/lib/orb/models/customer_update_params.rbi +++ b/rbi/lib/orb/models/customer_update_params.rbi @@ -76,6 +76,17 @@ module Orb def external_customer_id=(_) end + sig { returns(T.nilable(Orb::Models::CustomerUpdateParams::Hierarchy)) } + def hierarchy + end + + sig do + params(_: T.nilable(Orb::Models::CustomerUpdateParams::Hierarchy)) + .returns(T.nilable(Orb::Models::CustomerUpdateParams::Hierarchy)) + end + def hierarchy=(_) + end + sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) } def metadata end @@ -188,6 +199,7 @@ module Orb email: T.nilable(String), email_delivery: T.nilable(T::Boolean), external_customer_id: T.nilable(String), + hierarchy: T.nilable(Orb::Models::CustomerUpdateParams::Hierarchy), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), name: T.nilable(String), payment_provider: T.nilable(Symbol), @@ -214,6 +226,7 @@ module Orb email: nil, email_delivery: nil, external_customer_id: nil, + hierarchy: nil, metadata: nil, name: nil, payment_provider: nil, @@ -238,6 +251,7 @@ module Orb email: T.nilable(String), email_delivery: T.nilable(T::Boolean), external_customer_id: T.nilable(String), + hierarchy: T.nilable(Orb::Models::CustomerUpdateParams::Hierarchy), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), name: T.nilable(String), payment_provider: T.nilable(Symbol), @@ -415,6 +429,34 @@ module Orb end end + class Hierarchy < Orb::BaseModel + sig { returns(T.nilable(T::Array[String])) } + def child_customer_ids + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def child_customer_ids=(_) + end + + sig { returns(T.nilable(String)) } + def parent_customer_id + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def parent_customer_id=(_) + end + + sig { params(child_customer_ids: T::Array[String], parent_customer_id: T.nilable(String)).void } + def initialize(child_customer_ids: nil, parent_customer_id: nil) + end + + sig do + override.returns({child_customer_ids: T::Array[String], parent_customer_id: T.nilable(String)}) + end + def to_hash + end + end + class PaymentProvider < Orb::Enum abstract! diff --git a/rbi/lib/orb/models/subscription_create_params.rbi b/rbi/lib/orb/models/subscription_create_params.rbi index 46b7998c..92fdf9b4 100644 --- a/rbi/lib/orb/models/subscription_create_params.rbi +++ b/rbi/lib/orb/models/subscription_create_params.rbi @@ -270,6 +270,14 @@ module Orb def trial_duration_days=(_) end + sig { returns(T.nilable(T::Array[String])) } + def usage_customer_ids + end + + sig { params(_: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def usage_customer_ids=(_) + end + sig do params( add_adjustments: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::AddAdjustment]), @@ -302,6 +310,7 @@ module Orb replace_prices: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice]), start_date: T.nilable(Time), trial_duration_days: T.nilable(Integer), + usage_customer_ids: T.nilable(T::Array[String]), request_options: T.any(Orb::RequestOptions, T::Hash[Symbol, T.anything]) ) .void @@ -337,6 +346,7 @@ module Orb replace_prices: nil, start_date: nil, trial_duration_days: nil, + usage_customer_ids: nil, request_options: {} ) end @@ -375,6 +385,7 @@ module Orb replace_prices: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice]), start_date: T.nilable(Time), trial_duration_days: T.nilable(Integer), + usage_customer_ids: T.nilable(T::Array[String]), request_options: Orb::RequestOptions } ) diff --git a/rbi/lib/orb/models/subscription_schedule_plan_change_params.rbi b/rbi/lib/orb/models/subscription_schedule_plan_change_params.rbi index 8c2d3ef7..51a20eef 100644 --- a/rbi/lib/orb/models/subscription_schedule_plan_change_params.rbi +++ b/rbi/lib/orb/models/subscription_schedule_plan_change_params.rbi @@ -227,6 +227,14 @@ module Orb def trial_duration_days=(_) end + sig { returns(T.nilable(T::Array[String])) } + def usage_customer_ids + end + + sig { params(_: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def usage_customer_ids=(_) + end + sig do params( change_option: Symbol, @@ -254,6 +262,7 @@ module Orb 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), + usage_customer_ids: T.nilable(T::Array[String]), request_options: T.any(Orb::RequestOptions, T::Hash[Symbol, T.anything]) ) .void @@ -284,6 +293,7 @@ module Orb replace_adjustments: nil, replace_prices: nil, trial_duration_days: nil, + usage_customer_ids: nil, request_options: {} ) end @@ -317,6 +327,7 @@ module Orb 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), + usage_customer_ids: T.nilable(T::Array[String]), request_options: Orb::RequestOptions } ) diff --git a/rbi/lib/orb/resources/customers.rbi b/rbi/lib/orb/resources/customers.rbi index b9c5f7ce..53015b31 100644 --- a/rbi/lib/orb/resources/customers.rbi +++ b/rbi/lib/orb/resources/customers.rbi @@ -26,6 +26,7 @@ module Orb currency: T.nilable(String), email_delivery: T.nilable(T::Boolean), external_customer_id: T.nilable(String), + hierarchy: T.nilable(Orb::Models::CustomerCreateParams::Hierarchy), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), payment_provider: T.nilable(Symbol), payment_provider_id: T.nilable(String), @@ -53,6 +54,7 @@ module Orb currency: nil, email_delivery: nil, external_customer_id: nil, + hierarchy: nil, metadata: nil, payment_provider: nil, payment_provider_id: nil, @@ -76,6 +78,7 @@ module Orb email: T.nilable(String), email_delivery: T.nilable(T::Boolean), external_customer_id: T.nilable(String), + hierarchy: T.nilable(Orb::Models::CustomerUpdateParams::Hierarchy), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), name: T.nilable(String), payment_provider: T.nilable(Symbol), @@ -103,6 +106,7 @@ module Orb email: nil, email_delivery: nil, external_customer_id: nil, + hierarchy: nil, metadata: nil, name: nil, payment_provider: nil, @@ -199,6 +203,7 @@ module Orb email: T.nilable(String), email_delivery: T.nilable(T::Boolean), external_customer_id: T.nilable(String), + hierarchy: T.nilable(Orb::Models::CustomerUpdateByExternalIDParams::Hierarchy), metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]), name: T.nilable(String), payment_provider: T.nilable(Symbol), @@ -226,6 +231,7 @@ module Orb email: nil, email_delivery: nil, external_customer_id: nil, + hierarchy: nil, metadata: nil, name: nil, payment_provider: nil, diff --git a/rbi/lib/orb/resources/subscriptions.rbi b/rbi/lib/orb/resources/subscriptions.rbi index 7137979e..8f1aa8a3 100644 --- a/rbi/lib/orb/resources/subscriptions.rbi +++ b/rbi/lib/orb/resources/subscriptions.rbi @@ -35,6 +35,7 @@ module Orb replace_prices: T.nilable(T::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice]), start_date: T.nilable(Time), trial_duration_days: T.nilable(Integer), + usage_customer_ids: T.nilable(T::Array[String]), request_options: T.nilable(T.any(Orb::RequestOptions, T::Hash[Symbol, T.anything])) ) .returns(Orb::Models::SubscriptionCreateResponse) @@ -70,6 +71,7 @@ module Orb replace_prices: nil, start_date: nil, trial_duration_days: nil, + usage_customer_ids: nil, request_options: {} ) end @@ -290,6 +292,7 @@ module Orb 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), + usage_customer_ids: T.nilable(T::Array[String]), request_options: T.nilable(T.any(Orb::RequestOptions, T::Hash[Symbol, T.anything])) ) .returns(Orb::Models::SubscriptionSchedulePlanChangeResponse) @@ -321,6 +324,7 @@ module Orb replace_adjustments: nil, replace_prices: nil, trial_duration_days: nil, + usage_customer_ids: nil, request_options: {} ) end diff --git a/rbi/lib/orb/version.rbi b/rbi/lib/orb/version.rbi index 6b332147..208fca1d 100644 --- a/rbi/lib/orb/version.rbi +++ b/rbi/lib/orb/version.rbi @@ -1,5 +1,5 @@ # typed: strong module Orb - VERSION = "0.1.0-alpha.11" + VERSION = "0.1.0-alpha.12" end diff --git a/sig/orb/models/customer.rbs b/sig/orb/models/customer.rbs index dee9255a..5be47fb4 100644 --- a/sig/orb/models/customer.rbs +++ b/sig/orb/models/customer.rbs @@ -13,6 +13,7 @@ module Orb email_delivery: bool, exempt_from_automated_tax: bool?, external_customer_id: String?, + hierarchy: Orb::Models::Customer::Hierarchy, metadata: ::Hash[Symbol, String], name: String, payment_provider: Orb::Models::Customer::payment_provider?, @@ -48,6 +49,8 @@ module Orb attr_accessor external_customer_id: String? + attr_accessor hierarchy: Orb::Models::Customer::Hierarchy + attr_accessor metadata: ::Hash[Symbol, String] attr_accessor name: String @@ -81,6 +84,7 @@ module Orb email_delivery: bool, exempt_from_automated_tax: bool?, external_customer_id: String?, + hierarchy: Orb::Models::Customer::Hierarchy, metadata: ::Hash[Symbol, String], name: String, payment_provider: Orb::Models::Customer::payment_provider?, @@ -135,6 +139,59 @@ module Orb def to_hash: -> Orb::Models::Customer::billing_address end + type hierarchy = + { + children: ::Array[Orb::Models::Customer::Hierarchy::Child], + parent: Orb::Models::Customer::Hierarchy::Parent? + } + + class Hierarchy < Orb::BaseModel + attr_accessor children: ::Array[Orb::Models::Customer::Hierarchy::Child] + + attr_accessor parent: Orb::Models::Customer::Hierarchy::Parent? + + def initialize: + ( + children: ::Array[Orb::Models::Customer::Hierarchy::Child], + parent: Orb::Models::Customer::Hierarchy::Parent? + ) -> void + | (?Orb::Models::Customer::hierarchy | Orb::BaseModel data) -> void + + def to_hash: -> Orb::Models::Customer::hierarchy + + type child = { id: String, external_customer_id: String? } + + class Child < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customer::Hierarchy::child | Orb::BaseModel data + ) -> void + + def to_hash: -> Orb::Models::Customer::Hierarchy::child + end + + type parent = { id: String, external_customer_id: String? } + + class Parent < Orb::BaseModel + attr_accessor id: String + + attr_accessor external_customer_id: String? + + def initialize: + (id: String, external_customer_id: String?) -> void + | ( + ?Orb::Models::Customer::Hierarchy::parent | Orb::BaseModel data + ) -> void + + def to_hash: -> Orb::Models::Customer::Hierarchy::parent + end + end + type payment_provider = :quickbooks | :"bill.com" | :stripe_charge | :stripe_invoice | :netsuite diff --git a/sig/orb/models/customer_create_params.rbs b/sig/orb/models/customer_create_params.rbs index facf8141..d31cec12 100644 --- a/sig/orb/models/customer_create_params.rbs +++ b/sig/orb/models/customer_create_params.rbs @@ -11,6 +11,7 @@ module Orb currency: String?, email_delivery: bool?, external_customer_id: String?, + hierarchy: Orb::Models::CustomerCreateParams::Hierarchy?, metadata: ::Hash[Symbol, String?]?, payment_provider: Orb::Models::CustomerCreateParams::payment_provider?, payment_provider_id: String?, @@ -44,6 +45,8 @@ module Orb attr_accessor external_customer_id: String? + attr_accessor hierarchy: Orb::Models::CustomerCreateParams::Hierarchy? + attr_accessor metadata: ::Hash[Symbol, String?]? attr_accessor payment_provider: Orb::Models::CustomerCreateParams::payment_provider? @@ -71,6 +74,7 @@ module Orb currency: String?, email_delivery: bool?, external_customer_id: String?, + hierarchy: Orb::Models::CustomerCreateParams::Hierarchy?, metadata: ::Hash[Symbol, String?]?, payment_provider: Orb::Models::CustomerCreateParams::payment_provider?, payment_provider_id: String?, @@ -167,6 +171,28 @@ module Orb def to_hash: -> Orb::Models::CustomerCreateParams::billing_address end + type hierarchy = + { child_customer_ids: ::Array[String], parent_customer_id: String? } + + class Hierarchy < Orb::BaseModel + attr_reader child_customer_ids: ::Array[String]? + + def child_customer_ids=: (::Array[String]) -> ::Array[String] + + attr_accessor parent_customer_id: String? + + def initialize: + ( + child_customer_ids: ::Array[String], + parent_customer_id: String? + ) -> void + | ( + ?Orb::Models::CustomerCreateParams::hierarchy | Orb::BaseModel data + ) -> void + + def to_hash: -> Orb::Models::CustomerCreateParams::hierarchy + end + type payment_provider = :quickbooks | :"bill.com" | :stripe_charge | :stripe_invoice | :netsuite diff --git a/sig/orb/models/customer_update_by_external_id_params.rbs b/sig/orb/models/customer_update_by_external_id_params.rbs index 06027f66..e3e9b2ca 100644 --- a/sig/orb/models/customer_update_by_external_id_params.rbs +++ b/sig/orb/models/customer_update_by_external_id_params.rbs @@ -10,6 +10,7 @@ module Orb email: String?, email_delivery: bool?, external_customer_id: String?, + hierarchy: Orb::Models::CustomerUpdateByExternalIDParams::Hierarchy?, metadata: ::Hash[Symbol, String?]?, name: String?, payment_provider: Orb::Models::CustomerUpdateByExternalIDParams::payment_provider?, @@ -41,6 +42,8 @@ module Orb attr_accessor external_customer_id: String? + attr_accessor hierarchy: Orb::Models::CustomerUpdateByExternalIDParams::Hierarchy? + attr_accessor metadata: ::Hash[Symbol, String?]? attr_accessor name: String? @@ -67,6 +70,7 @@ module Orb email: String?, email_delivery: bool?, external_customer_id: String?, + hierarchy: Orb::Models::CustomerUpdateByExternalIDParams::Hierarchy?, metadata: ::Hash[Symbol, String?]?, name: String?, payment_provider: Orb::Models::CustomerUpdateByExternalIDParams::payment_provider?, @@ -166,6 +170,29 @@ module Orb def to_hash: -> Orb::Models::CustomerUpdateByExternalIDParams::billing_address end + type hierarchy = + { child_customer_ids: ::Array[String], parent_customer_id: String? } + + class Hierarchy < Orb::BaseModel + attr_reader child_customer_ids: ::Array[String]? + + def child_customer_ids=: (::Array[String]) -> ::Array[String] + + attr_accessor parent_customer_id: String? + + def initialize: + ( + child_customer_ids: ::Array[String], + parent_customer_id: String? + ) -> void + | ( + ?Orb::Models::CustomerUpdateByExternalIDParams::hierarchy + | Orb::BaseModel data + ) -> void + + def to_hash: -> Orb::Models::CustomerUpdateByExternalIDParams::hierarchy + end + type payment_provider = :quickbooks | :"bill.com" | :stripe_charge | :stripe_invoice | :netsuite diff --git a/sig/orb/models/customer_update_params.rbs b/sig/orb/models/customer_update_params.rbs index 9f5ea7aa..7f7b92d5 100644 --- a/sig/orb/models/customer_update_params.rbs +++ b/sig/orb/models/customer_update_params.rbs @@ -10,6 +10,7 @@ module Orb email: String?, email_delivery: bool?, external_customer_id: String?, + hierarchy: Orb::Models::CustomerUpdateParams::Hierarchy?, metadata: ::Hash[Symbol, String?]?, name: String?, payment_provider: Orb::Models::CustomerUpdateParams::payment_provider?, @@ -41,6 +42,8 @@ module Orb attr_accessor external_customer_id: String? + attr_accessor hierarchy: Orb::Models::CustomerUpdateParams::Hierarchy? + attr_accessor metadata: ::Hash[Symbol, String?]? attr_accessor name: String? @@ -67,6 +70,7 @@ module Orb email: String?, email_delivery: bool?, external_customer_id: String?, + hierarchy: Orb::Models::CustomerUpdateParams::Hierarchy?, metadata: ::Hash[Symbol, String?]?, name: String?, payment_provider: Orb::Models::CustomerUpdateParams::payment_provider?, @@ -163,6 +167,28 @@ module Orb def to_hash: -> Orb::Models::CustomerUpdateParams::billing_address end + type hierarchy = + { child_customer_ids: ::Array[String], parent_customer_id: String? } + + class Hierarchy < Orb::BaseModel + attr_reader child_customer_ids: ::Array[String]? + + def child_customer_ids=: (::Array[String]) -> ::Array[String] + + attr_accessor parent_customer_id: String? + + def initialize: + ( + child_customer_ids: ::Array[String], + parent_customer_id: String? + ) -> void + | ( + ?Orb::Models::CustomerUpdateParams::hierarchy | Orb::BaseModel data + ) -> void + + def to_hash: -> Orb::Models::CustomerUpdateParams::hierarchy + end + type payment_provider = :quickbooks | :"bill.com" | :stripe_charge | :stripe_invoice | :netsuite diff --git a/sig/orb/models/subscription_create_params.rbs b/sig/orb/models/subscription_create_params.rbs index a0ee1ec1..eaed62cf 100644 --- a/sig/orb/models/subscription_create_params.rbs +++ b/sig/orb/models/subscription_create_params.rbs @@ -31,7 +31,8 @@ module Orb replace_adjustments: ::Array[Orb::Models::SubscriptionCreateParams::ReplaceAdjustment]?, replace_prices: ::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice]?, start_date: Time?, - trial_duration_days: Integer? + trial_duration_days: Integer?, + usage_customer_ids: ::Array[String]? } & Orb::request_parameters @@ -101,6 +102,8 @@ module Orb attr_accessor trial_duration_days: Integer? + attr_accessor usage_customer_ids: ::Array[String]? + def initialize: ( add_adjustments: ::Array[Orb::Models::SubscriptionCreateParams::AddAdjustment]?, @@ -133,6 +136,7 @@ module Orb replace_prices: ::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice]?, start_date: Time?, trial_duration_days: Integer?, + usage_customer_ids: ::Array[String]?, request_options: Orb::request_opts ) -> void | ( diff --git a/sig/orb/models/subscription_schedule_plan_change_params.rbs b/sig/orb/models/subscription_schedule_plan_change_params.rbs index ffcfda34..769ae387 100644 --- a/sig/orb/models/subscription_schedule_plan_change_params.rbs +++ b/sig/orb/models/subscription_schedule_plan_change_params.rbs @@ -26,7 +26,8 @@ module Orb 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? + trial_duration_days: Integer?, + usage_customer_ids: ::Array[String]? } & Orb::request_parameters @@ -84,6 +85,8 @@ module Orb attr_accessor trial_duration_days: Integer? + attr_accessor usage_customer_ids: ::Array[String]? + def initialize: ( change_option: Orb::Models::SubscriptionSchedulePlanChangeParams::change_option, @@ -111,6 +114,7 @@ module Orb replace_adjustments: ::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment]?, replace_prices: ::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice]?, trial_duration_days: Integer?, + usage_customer_ids: ::Array[String]?, request_options: Orb::request_opts ) -> void | ( diff --git a/sig/orb/resources/customers.rbs b/sig/orb/resources/customers.rbs index ef6509d0..29b716c5 100644 --- a/sig/orb/resources/customers.rbs +++ b/sig/orb/resources/customers.rbs @@ -21,6 +21,7 @@ module Orb currency: String?, email_delivery: bool?, external_customer_id: String?, + hierarchy: Orb::Models::CustomerCreateParams::Hierarchy?, metadata: ::Hash[Symbol, String?]?, payment_provider: Orb::Models::CustomerCreateParams::payment_provider?, payment_provider_id: String?, @@ -47,6 +48,7 @@ module Orb email: String?, email_delivery: bool?, external_customer_id: String?, + hierarchy: Orb::Models::CustomerUpdateParams::Hierarchy?, metadata: ::Hash[Symbol, String?]?, name: String?, payment_provider: Orb::Models::CustomerUpdateParams::payment_provider?, @@ -135,6 +137,7 @@ module Orb email: String?, email_delivery: bool?, external_customer_id: String?, + hierarchy: Orb::Models::CustomerUpdateByExternalIDParams::Hierarchy?, metadata: ::Hash[Symbol, String?]?, name: String?, payment_provider: Orb::Models::CustomerUpdateByExternalIDParams::payment_provider?, diff --git a/sig/orb/resources/subscriptions.rbs b/sig/orb/resources/subscriptions.rbs index aa9807e1..8d8a6319 100644 --- a/sig/orb/resources/subscriptions.rbs +++ b/sig/orb/resources/subscriptions.rbs @@ -36,6 +36,7 @@ module Orb replace_prices: ::Array[Orb::Models::SubscriptionCreateParams::ReplacePrice]?, start_date: Time?, trial_duration_days: Integer?, + usage_customer_ids: ::Array[String]?, request_options: Orb::request_opts ) -> Orb::Models::SubscriptionCreateResponse @@ -196,6 +197,7 @@ module Orb replace_adjustments: ::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplaceAdjustment]?, replace_prices: ::Array[Orb::Models::SubscriptionSchedulePlanChangeParams::ReplacePrice]?, trial_duration_days: Integer?, + usage_customer_ids: ::Array[String]?, request_options: Orb::request_opts ) -> Orb::Models::SubscriptionSchedulePlanChangeResponse diff --git a/sig/orb/version.rbs b/sig/orb/version.rbs index a1234e1a..f0503064 100644 --- a/sig/orb/version.rbs +++ b/sig/orb/version.rbs @@ -1,3 +1,3 @@ module Orb - VERSION: "0.1.0-alpha.10" + VERSION: "0.1.0-alpha.11" end diff --git a/test/orb/resources/customers_test.rb b/test/orb/resources/customers_test.rb index ab91801a..f407b5e6 100644 --- a/test/orb/resources/customers_test.rb +++ b/test/orb/resources/customers_test.rb @@ -30,6 +30,7 @@ def test_create_required_params email_delivery: Orb::BooleanModel, exempt_from_automated_tax: Orb::BooleanModel | nil, external_customer_id: String | nil, + hierarchy: Orb::Models::Customer::Hierarchy, metadata: ^(Orb::HashOf[String]), name: String, payment_provider: Orb::Models::Customer::PaymentProvider | nil, @@ -64,6 +65,7 @@ def test_update email_delivery: Orb::BooleanModel, exempt_from_automated_tax: Orb::BooleanModel | nil, external_customer_id: String | nil, + hierarchy: Orb::Models::Customer::Hierarchy, metadata: ^(Orb::HashOf[String]), name: String, payment_provider: Orb::Models::Customer::PaymentProvider | nil, @@ -108,6 +110,7 @@ def test_list email_delivery: Orb::BooleanModel, exempt_from_automated_tax: Orb::BooleanModel | nil, external_customer_id: String | nil, + hierarchy: Orb::Models::Customer::Hierarchy, metadata: ^(Orb::HashOf[String]), name: String, payment_provider: Orb::Models::Customer::PaymentProvider | nil, @@ -150,6 +153,7 @@ def test_fetch email_delivery: Orb::BooleanModel, exempt_from_automated_tax: Orb::BooleanModel | nil, external_customer_id: String | nil, + hierarchy: Orb::Models::Customer::Hierarchy, metadata: ^(Orb::HashOf[String]), name: String, payment_provider: Orb::Models::Customer::PaymentProvider | nil, @@ -184,6 +188,7 @@ def test_fetch_by_external_id email_delivery: Orb::BooleanModel, exempt_from_automated_tax: Orb::BooleanModel | nil, external_customer_id: String | nil, + hierarchy: Orb::Models::Customer::Hierarchy, metadata: ^(Orb::HashOf[String]), name: String, payment_provider: Orb::Models::Customer::PaymentProvider | nil, @@ -234,6 +239,7 @@ def test_update_by_external_id email_delivery: Orb::BooleanModel, exempt_from_automated_tax: Orb::BooleanModel | nil, external_customer_id: String | nil, + hierarchy: Orb::Models::Customer::Hierarchy, metadata: ^(Orb::HashOf[String]), name: String, payment_provider: Orb::Models::Customer::PaymentProvider | nil,