orb-billing 1.54.0 → 1.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +496 -6
- data/lib/orb/models/beta_create_plan_version_params.rb +496 -6
- data/lib/orb/models/changed_subscription_resources.rb +2 -2
- data/lib/orb/models/credit_block_accounting_sync_failed_webhook_event.rb +4 -4
- data/lib/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rb +4 -4
- data/lib/orb/models/credit_block_list_invoices_response.rb +4 -4
- data/lib/orb/models/credit_block_retrieve_response.rb +4 -4
- data/lib/orb/models/credit_block_update_response.rb +4 -4
- data/lib/orb/models/customer_credit_ledger_incremented_webhook_event.rb +4 -4
- data/lib/orb/models/dimensional_price_groups/price_create_response.rb +2 -2
- data/lib/orb/models/invoice.rb +2 -2
- data/lib/orb/models/invoice_edited_webhook_event.rb +2 -2
- data/lib/orb/models/invoice_fetch_upcoming_response.rb +2 -2
- data/lib/orb/models/invoice_line_item_create_response.rb +2 -2
- data/lib/orb/models/per_price_cost.rb +2 -2
- data/lib/orb/models/plan.rb +2 -2
- data/lib/orb/models/plan_create_params.rb +246 -3
- data/lib/orb/models/plan_version.rb +2 -2
- data/lib/orb/models/price.rb +416 -1
- data/lib/orb/models/price_create_params.rb +231 -3
- data/lib/orb/models/price_edited_webhook_event.rb +2 -2
- data/lib/orb/models/price_evaluate_multiple_params.rb +238 -3
- data/lib/orb/models/price_evaluate_preview_events_params.rb +238 -3
- data/lib/orb/models/price_interval.rb +2 -2
- data/lib/orb/models/subscription_create_params.rb +495 -6
- data/lib/orb/models/subscription_price_intervals_params.rb +238 -3
- data/lib/orb/models/subscription_schedule_plan_change_params.rb +496 -6
- data/lib/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rb +4 -4
- data/lib/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rb +4 -4
- data/lib/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rb +4 -4
- data/lib/orb/models/webhooks/invoice_edited_standard_webhook_event.rb +2 -2
- data/lib/orb/models/webhooks/price_edited_standard_webhook_event.rb +2 -2
- data/lib/orb/resources/credit_blocks.rb +1 -1
- data/lib/orb/resources/dimensional_price_groups/prices.rb +1 -1
- data/lib/orb/resources/prices/external_price_id.rb +2 -2
- data/lib/orb/resources/prices.rb +5 -5
- data/lib/orb/version.rb +1 -1
- data/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +2939 -2129
- data/rbi/orb/models/beta_create_plan_version_params.rbi +2937 -2127
- data/rbi/orb/models/changed_subscription_resources.rbi +2 -1
- data/rbi/orb/models/credit_block_accounting_sync_failed_webhook_event.rbi +5 -5
- data/rbi/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rbi +5 -5
- data/rbi/orb/models/credit_block_list_invoices_response.rbi +5 -5
- data/rbi/orb/models/credit_block_retrieve_response.rbi +5 -5
- data/rbi/orb/models/credit_block_update_response.rbi +5 -5
- data/rbi/orb/models/customer_credit_ledger_incremented_webhook_event.rbi +5 -5
- data/rbi/orb/models/dimensional_price_groups/price_create_response.rbi +2 -1
- data/rbi/orb/models/invoice.rbi +2 -1
- data/rbi/orb/models/invoice_edited_webhook_event.rbi +2 -1
- data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +2 -1
- data/rbi/orb/models/invoice_line_item_create_response.rbi +2 -1
- data/rbi/orb/models/per_price_cost.rbi +2 -1
- data/rbi/orb/models/plan.rbi +2 -1
- data/rbi/orb/models/plan_create_params.rbi +409 -4
- data/rbi/orb/models/plan_version.rbi +2 -1
- data/rbi/orb/models/price.rbi +716 -1
- data/rbi/orb/models/price_create_params.rbi +397 -4
- data/rbi/orb/models/price_edited_webhook_event.rbi +2 -1
- data/rbi/orb/models/price_evaluate_multiple_params.rbi +397 -4
- data/rbi/orb/models/price_evaluate_preview_events_params.rbi +397 -4
- data/rbi/orb/models/price_interval.rbi +2 -1
- data/rbi/orb/models/subscription_create_params.rbi +2676 -1866
- data/rbi/orb/models/subscription_price_intervals_params.rbi +397 -4
- data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +2686 -1876
- data/rbi/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rbi +5 -5
- data/rbi/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rbi +5 -5
- data/rbi/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rbi +5 -5
- data/rbi/orb/models/webhooks/invoice_edited_standard_webhook_event.rbi +2 -1
- data/rbi/orb/models/webhooks/price_edited_standard_webhook_event.rbi +2 -1
- data/rbi/orb/resources/credit_blocks.rbi +1 -1
- data/rbi/orb/resources/prices.rbi +2 -1
- data/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +322 -0
- data/sig/orb/models/beta_create_plan_version_params.rbs +322 -0
- data/sig/orb/models/credit_block_accounting_sync_failed_webhook_event.rbs +2 -2
- data/sig/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rbs +2 -2
- data/sig/orb/models/credit_block_list_invoices_response.rbs +2 -2
- data/sig/orb/models/credit_block_retrieve_response.rbs +2 -2
- data/sig/orb/models/credit_block_update_response.rbs +2 -2
- data/sig/orb/models/customer_credit_ledger_incremented_webhook_event.rbs +2 -2
- data/sig/orb/models/plan_create_params.rbs +161 -0
- data/sig/orb/models/price.rbs +305 -0
- data/sig/orb/models/price_create_params.rbs +151 -0
- data/sig/orb/models/price_evaluate_multiple_params.rbs +156 -0
- data/sig/orb/models/price_evaluate_preview_events_params.rbs +156 -0
- data/sig/orb/models/subscription_create_params.rbs +322 -0
- data/sig/orb/models/subscription_price_intervals_params.rbs +156 -0
- data/sig/orb/models/subscription_schedule_plan_change_params.rbs +322 -0
- data/sig/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rbs +2 -2
- data/sig/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rbs +2 -2
- data/sig/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rbs +2 -2
- metadata +1 -1
|
@@ -215,7 +215,8 @@ module Orb
|
|
|
215
215
|
Orb::PlanCreateParams::Price::Price::MeteredAllowance,
|
|
216
216
|
Orb::NewPlanMinimumCompositePrice,
|
|
217
217
|
Orb::PlanCreateParams::Price::Price::Percent,
|
|
218
|
-
Orb::PlanCreateParams::Price::Price::EventOutput
|
|
218
|
+
Orb::PlanCreateParams::Price::Price::EventOutput,
|
|
219
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier
|
|
219
220
|
)
|
|
220
221
|
)
|
|
221
222
|
)
|
|
@@ -268,7 +269,8 @@ module Orb
|
|
|
268
269
|
Orb::PlanCreateParams::Price::Price::MeteredAllowance::OrHash,
|
|
269
270
|
Orb::NewPlanMinimumCompositePrice::OrHash,
|
|
270
271
|
Orb::PlanCreateParams::Price::Price::Percent::OrHash,
|
|
271
|
-
Orb::PlanCreateParams::Price::Price::EventOutput::OrHash
|
|
272
|
+
Orb::PlanCreateParams::Price::Price::EventOutput::OrHash,
|
|
273
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::OrHash
|
|
272
274
|
)
|
|
273
275
|
)
|
|
274
276
|
).returns(T.attached_class)
|
|
@@ -330,7 +332,8 @@ module Orb
|
|
|
330
332
|
Orb::PlanCreateParams::Price::Price::MeteredAllowance,
|
|
331
333
|
Orb::NewPlanMinimumCompositePrice,
|
|
332
334
|
Orb::PlanCreateParams::Price::Price::Percent,
|
|
333
|
-
Orb::PlanCreateParams::Price::Price::EventOutput
|
|
335
|
+
Orb::PlanCreateParams::Price::Price::EventOutput,
|
|
336
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier
|
|
334
337
|
)
|
|
335
338
|
)
|
|
336
339
|
}
|
|
@@ -815,7 +818,8 @@ module Orb
|
|
|
815
818
|
Orb::PlanCreateParams::Price::Price::MeteredAllowance,
|
|
816
819
|
Orb::NewPlanMinimumCompositePrice,
|
|
817
820
|
Orb::PlanCreateParams::Price::Price::Percent,
|
|
818
|
-
Orb::PlanCreateParams::Price::Price::EventOutput
|
|
821
|
+
Orb::PlanCreateParams::Price::Price::EventOutput,
|
|
822
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier
|
|
819
823
|
)
|
|
820
824
|
end
|
|
821
825
|
|
|
@@ -5628,6 +5632,407 @@ module Orb
|
|
|
5628
5632
|
end
|
|
5629
5633
|
end
|
|
5630
5634
|
|
|
5635
|
+
class UnitWithMultiplier < Orb::Internal::Type::BaseModel
|
|
5636
|
+
OrHash =
|
|
5637
|
+
T.type_alias do
|
|
5638
|
+
T.any(
|
|
5639
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier,
|
|
5640
|
+
Orb::Internal::AnyHash
|
|
5641
|
+
)
|
|
5642
|
+
end
|
|
5643
|
+
|
|
5644
|
+
# The cadence to bill for this price on.
|
|
5645
|
+
sig do
|
|
5646
|
+
returns(
|
|
5647
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::Cadence::OrSymbol
|
|
5648
|
+
)
|
|
5649
|
+
end
|
|
5650
|
+
attr_accessor :cadence
|
|
5651
|
+
|
|
5652
|
+
# The id of the item the price will be associated with.
|
|
5653
|
+
sig { returns(String) }
|
|
5654
|
+
attr_accessor :item_id
|
|
5655
|
+
|
|
5656
|
+
# The pricing model type
|
|
5657
|
+
sig { returns(Symbol) }
|
|
5658
|
+
attr_accessor :model_type
|
|
5659
|
+
|
|
5660
|
+
# The name of the price.
|
|
5661
|
+
sig { returns(String) }
|
|
5662
|
+
attr_accessor :name
|
|
5663
|
+
|
|
5664
|
+
# Configuration for unit_with_multiplier pricing
|
|
5665
|
+
sig do
|
|
5666
|
+
returns(
|
|
5667
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::UnitWithMultiplierConfig
|
|
5668
|
+
)
|
|
5669
|
+
end
|
|
5670
|
+
attr_reader :unit_with_multiplier_config
|
|
5671
|
+
|
|
5672
|
+
sig do
|
|
5673
|
+
params(
|
|
5674
|
+
unit_with_multiplier_config:
|
|
5675
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::UnitWithMultiplierConfig::OrHash
|
|
5676
|
+
).void
|
|
5677
|
+
end
|
|
5678
|
+
attr_writer :unit_with_multiplier_config
|
|
5679
|
+
|
|
5680
|
+
# The id of the billable metric for the price. Only needed if the price is
|
|
5681
|
+
# usage-based.
|
|
5682
|
+
sig { returns(T.nilable(String)) }
|
|
5683
|
+
attr_accessor :billable_metric_id
|
|
5684
|
+
|
|
5685
|
+
# If the Price represents a fixed cost, the price will be billed in-advance if
|
|
5686
|
+
# this is true, and in-arrears if this is false.
|
|
5687
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
5688
|
+
attr_accessor :billed_in_advance
|
|
5689
|
+
|
|
5690
|
+
# For custom cadence: specifies the duration of the billing period in days or
|
|
5691
|
+
# months.
|
|
5692
|
+
sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
|
|
5693
|
+
attr_reader :billing_cycle_configuration
|
|
5694
|
+
|
|
5695
|
+
sig do
|
|
5696
|
+
params(
|
|
5697
|
+
billing_cycle_configuration:
|
|
5698
|
+
T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
|
|
5699
|
+
).void
|
|
5700
|
+
end
|
|
5701
|
+
attr_writer :billing_cycle_configuration
|
|
5702
|
+
|
|
5703
|
+
# The per unit conversion rate of the price currency to the invoicing currency.
|
|
5704
|
+
sig { returns(T.nilable(Float)) }
|
|
5705
|
+
attr_accessor :conversion_rate
|
|
5706
|
+
|
|
5707
|
+
# The configuration for the rate of the price currency to the invoicing currency.
|
|
5708
|
+
sig do
|
|
5709
|
+
returns(
|
|
5710
|
+
T.nilable(
|
|
5711
|
+
T.any(
|
|
5712
|
+
Orb::UnitConversionRateConfig,
|
|
5713
|
+
Orb::TieredConversionRateConfig
|
|
5714
|
+
)
|
|
5715
|
+
)
|
|
5716
|
+
)
|
|
5717
|
+
end
|
|
5718
|
+
attr_accessor :conversion_rate_config
|
|
5719
|
+
|
|
5720
|
+
# An ISO 4217 currency string, or custom pricing unit identifier, in which this
|
|
5721
|
+
# price is billed.
|
|
5722
|
+
sig { returns(T.nilable(String)) }
|
|
5723
|
+
attr_accessor :currency
|
|
5724
|
+
|
|
5725
|
+
# For dimensional price: specifies a price group and dimension values
|
|
5726
|
+
sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) }
|
|
5727
|
+
attr_reader :dimensional_price_configuration
|
|
5728
|
+
|
|
5729
|
+
sig do
|
|
5730
|
+
params(
|
|
5731
|
+
dimensional_price_configuration:
|
|
5732
|
+
T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash)
|
|
5733
|
+
).void
|
|
5734
|
+
end
|
|
5735
|
+
attr_writer :dimensional_price_configuration
|
|
5736
|
+
|
|
5737
|
+
# An alias for the price.
|
|
5738
|
+
sig { returns(T.nilable(String)) }
|
|
5739
|
+
attr_accessor :external_price_id
|
|
5740
|
+
|
|
5741
|
+
# If the Price represents a fixed cost, this represents the quantity of units
|
|
5742
|
+
# applied.
|
|
5743
|
+
sig { returns(T.nilable(Float)) }
|
|
5744
|
+
attr_accessor :fixed_price_quantity
|
|
5745
|
+
|
|
5746
|
+
# The property used to group this price on an invoice
|
|
5747
|
+
sig { returns(T.nilable(String)) }
|
|
5748
|
+
attr_accessor :invoice_grouping_key
|
|
5749
|
+
|
|
5750
|
+
# Within each billing cycle, specifies the cadence at which invoices are produced.
|
|
5751
|
+
# If unspecified, a single invoice is produced per billing cycle.
|
|
5752
|
+
sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
|
|
5753
|
+
attr_reader :invoicing_cycle_configuration
|
|
5754
|
+
|
|
5755
|
+
sig do
|
|
5756
|
+
params(
|
|
5757
|
+
invoicing_cycle_configuration:
|
|
5758
|
+
T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
|
|
5759
|
+
).void
|
|
5760
|
+
end
|
|
5761
|
+
attr_writer :invoicing_cycle_configuration
|
|
5762
|
+
|
|
5763
|
+
# The ID of the license type to associate with this price. On a usage price this
|
|
5764
|
+
# also marks the price as eligible to draw down from that license type's
|
|
5765
|
+
# allocation; a usage price created without it is billed normally. Usage prices
|
|
5766
|
+
# with a license type must use the `unit` model, and only draw down when their
|
|
5767
|
+
# currency matches the allocation's.
|
|
5768
|
+
sig { returns(T.nilable(String)) }
|
|
5769
|
+
attr_accessor :license_type_id
|
|
5770
|
+
|
|
5771
|
+
# User-specified key/value pairs for the resource. Individual keys can be removed
|
|
5772
|
+
# by setting the value to `null`, and the entire metadata mapping can be cleared
|
|
5773
|
+
# by setting `metadata` to `null`.
|
|
5774
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
|
|
5775
|
+
attr_accessor :metadata
|
|
5776
|
+
|
|
5777
|
+
# A transient ID that can be used to reference this price when adding adjustments
|
|
5778
|
+
# in the same API call.
|
|
5779
|
+
sig { returns(T.nilable(String)) }
|
|
5780
|
+
attr_accessor :reference_id
|
|
5781
|
+
|
|
5782
|
+
sig do
|
|
5783
|
+
params(
|
|
5784
|
+
cadence:
|
|
5785
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::Cadence::OrSymbol,
|
|
5786
|
+
item_id: String,
|
|
5787
|
+
name: String,
|
|
5788
|
+
unit_with_multiplier_config:
|
|
5789
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::UnitWithMultiplierConfig::OrHash,
|
|
5790
|
+
billable_metric_id: T.nilable(String),
|
|
5791
|
+
billed_in_advance: T.nilable(T::Boolean),
|
|
5792
|
+
billing_cycle_configuration:
|
|
5793
|
+
T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
|
|
5794
|
+
conversion_rate: T.nilable(Float),
|
|
5795
|
+
conversion_rate_config:
|
|
5796
|
+
T.nilable(
|
|
5797
|
+
T.any(
|
|
5798
|
+
Orb::UnitConversionRateConfig::OrHash,
|
|
5799
|
+
Orb::TieredConversionRateConfig::OrHash
|
|
5800
|
+
)
|
|
5801
|
+
),
|
|
5802
|
+
currency: T.nilable(String),
|
|
5803
|
+
dimensional_price_configuration:
|
|
5804
|
+
T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash),
|
|
5805
|
+
external_price_id: T.nilable(String),
|
|
5806
|
+
fixed_price_quantity: T.nilable(Float),
|
|
5807
|
+
invoice_grouping_key: T.nilable(String),
|
|
5808
|
+
invoicing_cycle_configuration:
|
|
5809
|
+
T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
|
|
5810
|
+
license_type_id: T.nilable(String),
|
|
5811
|
+
metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
|
|
5812
|
+
reference_id: T.nilable(String),
|
|
5813
|
+
model_type: Symbol
|
|
5814
|
+
).returns(T.attached_class)
|
|
5815
|
+
end
|
|
5816
|
+
def self.new(
|
|
5817
|
+
# The cadence to bill for this price on.
|
|
5818
|
+
cadence:,
|
|
5819
|
+
# The id of the item the price will be associated with.
|
|
5820
|
+
item_id:,
|
|
5821
|
+
# The name of the price.
|
|
5822
|
+
name:,
|
|
5823
|
+
# Configuration for unit_with_multiplier pricing
|
|
5824
|
+
unit_with_multiplier_config:,
|
|
5825
|
+
# The id of the billable metric for the price. Only needed if the price is
|
|
5826
|
+
# usage-based.
|
|
5827
|
+
billable_metric_id: nil,
|
|
5828
|
+
# If the Price represents a fixed cost, the price will be billed in-advance if
|
|
5829
|
+
# this is true, and in-arrears if this is false.
|
|
5830
|
+
billed_in_advance: nil,
|
|
5831
|
+
# For custom cadence: specifies the duration of the billing period in days or
|
|
5832
|
+
# months.
|
|
5833
|
+
billing_cycle_configuration: nil,
|
|
5834
|
+
# The per unit conversion rate of the price currency to the invoicing currency.
|
|
5835
|
+
conversion_rate: nil,
|
|
5836
|
+
# The configuration for the rate of the price currency to the invoicing currency.
|
|
5837
|
+
conversion_rate_config: nil,
|
|
5838
|
+
# An ISO 4217 currency string, or custom pricing unit identifier, in which this
|
|
5839
|
+
# price is billed.
|
|
5840
|
+
currency: nil,
|
|
5841
|
+
# For dimensional price: specifies a price group and dimension values
|
|
5842
|
+
dimensional_price_configuration: nil,
|
|
5843
|
+
# An alias for the price.
|
|
5844
|
+
external_price_id: nil,
|
|
5845
|
+
# If the Price represents a fixed cost, this represents the quantity of units
|
|
5846
|
+
# applied.
|
|
5847
|
+
fixed_price_quantity: nil,
|
|
5848
|
+
# The property used to group this price on an invoice
|
|
5849
|
+
invoice_grouping_key: nil,
|
|
5850
|
+
# Within each billing cycle, specifies the cadence at which invoices are produced.
|
|
5851
|
+
# If unspecified, a single invoice is produced per billing cycle.
|
|
5852
|
+
invoicing_cycle_configuration: nil,
|
|
5853
|
+
# The ID of the license type to associate with this price. On a usage price this
|
|
5854
|
+
# also marks the price as eligible to draw down from that license type's
|
|
5855
|
+
# allocation; a usage price created without it is billed normally. Usage prices
|
|
5856
|
+
# with a license type must use the `unit` model, and only draw down when their
|
|
5857
|
+
# currency matches the allocation's.
|
|
5858
|
+
license_type_id: nil,
|
|
5859
|
+
# User-specified key/value pairs for the resource. Individual keys can be removed
|
|
5860
|
+
# by setting the value to `null`, and the entire metadata mapping can be cleared
|
|
5861
|
+
# by setting `metadata` to `null`.
|
|
5862
|
+
metadata: nil,
|
|
5863
|
+
# A transient ID that can be used to reference this price when adding adjustments
|
|
5864
|
+
# in the same API call.
|
|
5865
|
+
reference_id: nil,
|
|
5866
|
+
# The pricing model type
|
|
5867
|
+
model_type: :unit_with_multiplier
|
|
5868
|
+
)
|
|
5869
|
+
end
|
|
5870
|
+
|
|
5871
|
+
sig do
|
|
5872
|
+
override.returns(
|
|
5873
|
+
{
|
|
5874
|
+
cadence:
|
|
5875
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::Cadence::OrSymbol,
|
|
5876
|
+
item_id: String,
|
|
5877
|
+
model_type: Symbol,
|
|
5878
|
+
name: String,
|
|
5879
|
+
unit_with_multiplier_config:
|
|
5880
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::UnitWithMultiplierConfig,
|
|
5881
|
+
billable_metric_id: T.nilable(String),
|
|
5882
|
+
billed_in_advance: T.nilable(T::Boolean),
|
|
5883
|
+
billing_cycle_configuration:
|
|
5884
|
+
T.nilable(Orb::NewBillingCycleConfiguration),
|
|
5885
|
+
conversion_rate: T.nilable(Float),
|
|
5886
|
+
conversion_rate_config:
|
|
5887
|
+
T.nilable(
|
|
5888
|
+
T.any(
|
|
5889
|
+
Orb::UnitConversionRateConfig,
|
|
5890
|
+
Orb::TieredConversionRateConfig
|
|
5891
|
+
)
|
|
5892
|
+
),
|
|
5893
|
+
currency: T.nilable(String),
|
|
5894
|
+
dimensional_price_configuration:
|
|
5895
|
+
T.nilable(Orb::NewDimensionalPriceConfiguration),
|
|
5896
|
+
external_price_id: T.nilable(String),
|
|
5897
|
+
fixed_price_quantity: T.nilable(Float),
|
|
5898
|
+
invoice_grouping_key: T.nilable(String),
|
|
5899
|
+
invoicing_cycle_configuration:
|
|
5900
|
+
T.nilable(Orb::NewBillingCycleConfiguration),
|
|
5901
|
+
license_type_id: T.nilable(String),
|
|
5902
|
+
metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
|
|
5903
|
+
reference_id: T.nilable(String)
|
|
5904
|
+
}
|
|
5905
|
+
)
|
|
5906
|
+
end
|
|
5907
|
+
def to_hash
|
|
5908
|
+
end
|
|
5909
|
+
|
|
5910
|
+
# The cadence to bill for this price on.
|
|
5911
|
+
module Cadence
|
|
5912
|
+
extend Orb::Internal::Type::Enum
|
|
5913
|
+
|
|
5914
|
+
TaggedSymbol =
|
|
5915
|
+
T.type_alias do
|
|
5916
|
+
T.all(
|
|
5917
|
+
Symbol,
|
|
5918
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::Cadence
|
|
5919
|
+
)
|
|
5920
|
+
end
|
|
5921
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
5922
|
+
|
|
5923
|
+
ONE_TIME =
|
|
5924
|
+
T.let(
|
|
5925
|
+
:one_time,
|
|
5926
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::Cadence::TaggedSymbol
|
|
5927
|
+
)
|
|
5928
|
+
MONTHLY =
|
|
5929
|
+
T.let(
|
|
5930
|
+
:monthly,
|
|
5931
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::Cadence::TaggedSymbol
|
|
5932
|
+
)
|
|
5933
|
+
QUARTERLY =
|
|
5934
|
+
T.let(
|
|
5935
|
+
:quarterly,
|
|
5936
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::Cadence::TaggedSymbol
|
|
5937
|
+
)
|
|
5938
|
+
SEMI_ANNUAL =
|
|
5939
|
+
T.let(
|
|
5940
|
+
:semi_annual,
|
|
5941
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::Cadence::TaggedSymbol
|
|
5942
|
+
)
|
|
5943
|
+
ANNUAL =
|
|
5944
|
+
T.let(
|
|
5945
|
+
:annual,
|
|
5946
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::Cadence::TaggedSymbol
|
|
5947
|
+
)
|
|
5948
|
+
CUSTOM =
|
|
5949
|
+
T.let(
|
|
5950
|
+
:custom,
|
|
5951
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::Cadence::TaggedSymbol
|
|
5952
|
+
)
|
|
5953
|
+
|
|
5954
|
+
sig do
|
|
5955
|
+
override.returns(
|
|
5956
|
+
T::Array[
|
|
5957
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::Cadence::TaggedSymbol
|
|
5958
|
+
]
|
|
5959
|
+
)
|
|
5960
|
+
end
|
|
5961
|
+
def self.values
|
|
5962
|
+
end
|
|
5963
|
+
end
|
|
5964
|
+
|
|
5965
|
+
class UnitWithMultiplierConfig < Orb::Internal::Type::BaseModel
|
|
5966
|
+
OrHash =
|
|
5967
|
+
T.type_alias do
|
|
5968
|
+
T.any(
|
|
5969
|
+
Orb::PlanCreateParams::Price::Price::UnitWithMultiplier::UnitWithMultiplierConfig,
|
|
5970
|
+
Orb::Internal::AnyHash
|
|
5971
|
+
)
|
|
5972
|
+
end
|
|
5973
|
+
|
|
5974
|
+
# Sub-line label for list-price events that don't set display_name_key. Unlabeled
|
|
5975
|
+
# events with another multiplier are labeled by their multiplier (e.g. '0.8×
|
|
5976
|
+
# rate').
|
|
5977
|
+
sig { returns(String) }
|
|
5978
|
+
attr_accessor :default_display_name
|
|
5979
|
+
|
|
5980
|
+
# Event property holding the sub-line label for the event's rate (e.g.
|
|
5981
|
+
# 'Off-peak').
|
|
5982
|
+
sig { returns(String) }
|
|
5983
|
+
attr_accessor :display_name_key
|
|
5984
|
+
|
|
5985
|
+
# Event property holding the multiplier applied to unit_amount (e.g. 0.8 for a 20%
|
|
5986
|
+
# discount). Events without a number between 0 and 1000 with at most 12 decimal
|
|
5987
|
+
# places are charged at unit_amount.
|
|
5988
|
+
sig { returns(String) }
|
|
5989
|
+
attr_accessor :multiplier_key
|
|
5990
|
+
|
|
5991
|
+
# List price per unit, before the event's multiplier is applied.
|
|
5992
|
+
sig { returns(String) }
|
|
5993
|
+
attr_accessor :unit_amount
|
|
5994
|
+
|
|
5995
|
+
# Configuration for unit_with_multiplier pricing
|
|
5996
|
+
sig do
|
|
5997
|
+
params(
|
|
5998
|
+
default_display_name: String,
|
|
5999
|
+
display_name_key: String,
|
|
6000
|
+
multiplier_key: String,
|
|
6001
|
+
unit_amount: String
|
|
6002
|
+
).returns(T.attached_class)
|
|
6003
|
+
end
|
|
6004
|
+
def self.new(
|
|
6005
|
+
# Sub-line label for list-price events that don't set display_name_key. Unlabeled
|
|
6006
|
+
# events with another multiplier are labeled by their multiplier (e.g. '0.8×
|
|
6007
|
+
# rate').
|
|
6008
|
+
default_display_name:,
|
|
6009
|
+
# Event property holding the sub-line label for the event's rate (e.g.
|
|
6010
|
+
# 'Off-peak').
|
|
6011
|
+
display_name_key:,
|
|
6012
|
+
# Event property holding the multiplier applied to unit_amount (e.g. 0.8 for a 20%
|
|
6013
|
+
# discount). Events without a number between 0 and 1000 with at most 12 decimal
|
|
6014
|
+
# places are charged at unit_amount.
|
|
6015
|
+
multiplier_key:,
|
|
6016
|
+
# List price per unit, before the event's multiplier is applied.
|
|
6017
|
+
unit_amount:
|
|
6018
|
+
)
|
|
6019
|
+
end
|
|
6020
|
+
|
|
6021
|
+
sig do
|
|
6022
|
+
override.returns(
|
|
6023
|
+
{
|
|
6024
|
+
default_display_name: String,
|
|
6025
|
+
display_name_key: String,
|
|
6026
|
+
multiplier_key: String,
|
|
6027
|
+
unit_amount: String
|
|
6028
|
+
}
|
|
6029
|
+
)
|
|
6030
|
+
end
|
|
6031
|
+
def to_hash
|
|
6032
|
+
end
|
|
6033
|
+
end
|
|
6034
|
+
end
|
|
6035
|
+
|
|
5631
6036
|
sig do
|
|
5632
6037
|
override.returns(
|
|
5633
6038
|
T::Array[Orb::PlanCreateParams::Price::Price::Variants]
|
|
@@ -79,7 +79,8 @@ module Orb
|
|
|
79
79
|
Orb::Price::MeteredAllowance::OrHash,
|
|
80
80
|
Orb::Price::MinimumComposite::OrHash,
|
|
81
81
|
Orb::Price::Percent::OrHash,
|
|
82
|
-
Orb::Price::EventOutput::OrHash
|
|
82
|
+
Orb::Price::EventOutput::OrHash,
|
|
83
|
+
Orb::Price::UnitWithMultiplier::OrHash
|
|
83
84
|
)
|
|
84
85
|
],
|
|
85
86
|
version: Integer
|