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.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +496 -6
  5. data/lib/orb/models/beta_create_plan_version_params.rb +496 -6
  6. data/lib/orb/models/changed_subscription_resources.rb +2 -2
  7. data/lib/orb/models/credit_block_accounting_sync_failed_webhook_event.rb +4 -4
  8. data/lib/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rb +4 -4
  9. data/lib/orb/models/credit_block_list_invoices_response.rb +4 -4
  10. data/lib/orb/models/credit_block_retrieve_response.rb +4 -4
  11. data/lib/orb/models/credit_block_update_response.rb +4 -4
  12. data/lib/orb/models/customer_credit_ledger_incremented_webhook_event.rb +4 -4
  13. data/lib/orb/models/dimensional_price_groups/price_create_response.rb +2 -2
  14. data/lib/orb/models/invoice.rb +2 -2
  15. data/lib/orb/models/invoice_edited_webhook_event.rb +2 -2
  16. data/lib/orb/models/invoice_fetch_upcoming_response.rb +2 -2
  17. data/lib/orb/models/invoice_line_item_create_response.rb +2 -2
  18. data/lib/orb/models/per_price_cost.rb +2 -2
  19. data/lib/orb/models/plan.rb +2 -2
  20. data/lib/orb/models/plan_create_params.rb +246 -3
  21. data/lib/orb/models/plan_version.rb +2 -2
  22. data/lib/orb/models/price.rb +416 -1
  23. data/lib/orb/models/price_create_params.rb +231 -3
  24. data/lib/orb/models/price_edited_webhook_event.rb +2 -2
  25. data/lib/orb/models/price_evaluate_multiple_params.rb +238 -3
  26. data/lib/orb/models/price_evaluate_preview_events_params.rb +238 -3
  27. data/lib/orb/models/price_interval.rb +2 -2
  28. data/lib/orb/models/subscription_create_params.rb +495 -6
  29. data/lib/orb/models/subscription_price_intervals_params.rb +238 -3
  30. data/lib/orb/models/subscription_schedule_plan_change_params.rb +496 -6
  31. data/lib/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rb +4 -4
  32. data/lib/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rb +4 -4
  33. data/lib/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rb +4 -4
  34. data/lib/orb/models/webhooks/invoice_edited_standard_webhook_event.rb +2 -2
  35. data/lib/orb/models/webhooks/price_edited_standard_webhook_event.rb +2 -2
  36. data/lib/orb/resources/credit_blocks.rb +1 -1
  37. data/lib/orb/resources/dimensional_price_groups/prices.rb +1 -1
  38. data/lib/orb/resources/prices/external_price_id.rb +2 -2
  39. data/lib/orb/resources/prices.rb +5 -5
  40. data/lib/orb/version.rb +1 -1
  41. data/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +2939 -2129
  42. data/rbi/orb/models/beta_create_plan_version_params.rbi +2937 -2127
  43. data/rbi/orb/models/changed_subscription_resources.rbi +2 -1
  44. data/rbi/orb/models/credit_block_accounting_sync_failed_webhook_event.rbi +5 -5
  45. data/rbi/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rbi +5 -5
  46. data/rbi/orb/models/credit_block_list_invoices_response.rbi +5 -5
  47. data/rbi/orb/models/credit_block_retrieve_response.rbi +5 -5
  48. data/rbi/orb/models/credit_block_update_response.rbi +5 -5
  49. data/rbi/orb/models/customer_credit_ledger_incremented_webhook_event.rbi +5 -5
  50. data/rbi/orb/models/dimensional_price_groups/price_create_response.rbi +2 -1
  51. data/rbi/orb/models/invoice.rbi +2 -1
  52. data/rbi/orb/models/invoice_edited_webhook_event.rbi +2 -1
  53. data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +2 -1
  54. data/rbi/orb/models/invoice_line_item_create_response.rbi +2 -1
  55. data/rbi/orb/models/per_price_cost.rbi +2 -1
  56. data/rbi/orb/models/plan.rbi +2 -1
  57. data/rbi/orb/models/plan_create_params.rbi +409 -4
  58. data/rbi/orb/models/plan_version.rbi +2 -1
  59. data/rbi/orb/models/price.rbi +716 -1
  60. data/rbi/orb/models/price_create_params.rbi +397 -4
  61. data/rbi/orb/models/price_edited_webhook_event.rbi +2 -1
  62. data/rbi/orb/models/price_evaluate_multiple_params.rbi +397 -4
  63. data/rbi/orb/models/price_evaluate_preview_events_params.rbi +397 -4
  64. data/rbi/orb/models/price_interval.rbi +2 -1
  65. data/rbi/orb/models/subscription_create_params.rbi +2676 -1866
  66. data/rbi/orb/models/subscription_price_intervals_params.rbi +397 -4
  67. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +2686 -1876
  68. data/rbi/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rbi +5 -5
  69. data/rbi/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rbi +5 -5
  70. data/rbi/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rbi +5 -5
  71. data/rbi/orb/models/webhooks/invoice_edited_standard_webhook_event.rbi +2 -1
  72. data/rbi/orb/models/webhooks/price_edited_standard_webhook_event.rbi +2 -1
  73. data/rbi/orb/resources/credit_blocks.rbi +1 -1
  74. data/rbi/orb/resources/prices.rbi +2 -1
  75. data/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +322 -0
  76. data/sig/orb/models/beta_create_plan_version_params.rbs +322 -0
  77. data/sig/orb/models/credit_block_accounting_sync_failed_webhook_event.rbs +2 -2
  78. data/sig/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rbs +2 -2
  79. data/sig/orb/models/credit_block_list_invoices_response.rbs +2 -2
  80. data/sig/orb/models/credit_block_retrieve_response.rbs +2 -2
  81. data/sig/orb/models/credit_block_update_response.rbs +2 -2
  82. data/sig/orb/models/customer_credit_ledger_incremented_webhook_event.rbs +2 -2
  83. data/sig/orb/models/plan_create_params.rbs +161 -0
  84. data/sig/orb/models/price.rbs +305 -0
  85. data/sig/orb/models/price_create_params.rbs +151 -0
  86. data/sig/orb/models/price_evaluate_multiple_params.rbs +156 -0
  87. data/sig/orb/models/price_evaluate_preview_events_params.rbs +156 -0
  88. data/sig/orb/models/subscription_create_params.rbs +322 -0
  89. data/sig/orb/models/subscription_price_intervals_params.rbs +156 -0
  90. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +322 -0
  91. data/sig/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rbs +2 -2
  92. data/sig/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rbs +2 -2
  93. data/sig/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rbs +2 -2
  94. metadata +1 -1
@@ -48,7 +48,8 @@ module Orb
48
48
  Orb::PriceCreateParams::Body::MeteredAllowance,
49
49
  Orb::NewFloatingMinimumCompositePrice,
50
50
  Orb::PriceCreateParams::Body::Percent,
51
- Orb::PriceCreateParams::Body::EventOutput
51
+ Orb::PriceCreateParams::Body::EventOutput,
52
+ Orb::PriceCreateParams::Body::UnitWithMultiplier
52
53
  )
53
54
  )
54
55
  end
@@ -93,7 +94,8 @@ module Orb
93
94
  Orb::PriceCreateParams::Body::MeteredAllowance::OrHash,
94
95
  Orb::NewFloatingMinimumCompositePrice::OrHash,
95
96
  Orb::PriceCreateParams::Body::Percent::OrHash,
96
- Orb::PriceCreateParams::Body::EventOutput::OrHash
97
+ Orb::PriceCreateParams::Body::EventOutput::OrHash,
98
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::OrHash
97
99
  ),
98
100
  request_options: Orb::RequestOptions::OrHash
99
101
  ).returns(T.attached_class)
@@ -145,7 +147,8 @@ module Orb
145
147
  Orb::PriceCreateParams::Body::MeteredAllowance,
146
148
  Orb::NewFloatingMinimumCompositePrice,
147
149
  Orb::PriceCreateParams::Body::Percent,
148
- Orb::PriceCreateParams::Body::EventOutput
150
+ Orb::PriceCreateParams::Body::EventOutput,
151
+ Orb::PriceCreateParams::Body::UnitWithMultiplier
149
152
  ),
150
153
  request_options: Orb::RequestOptions
151
154
  }
@@ -196,7 +199,8 @@ module Orb
196
199
  Orb::PriceCreateParams::Body::MeteredAllowance,
197
200
  Orb::NewFloatingMinimumCompositePrice,
198
201
  Orb::PriceCreateParams::Body::Percent,
199
- Orb::PriceCreateParams::Body::EventOutput
202
+ Orb::PriceCreateParams::Body::EventOutput,
203
+ Orb::PriceCreateParams::Body::UnitWithMultiplier
200
204
  )
201
205
  end
202
206
 
@@ -4458,6 +4462,395 @@ module Orb
4458
4462
  end
4459
4463
  end
4460
4464
 
4465
+ class UnitWithMultiplier < Orb::Internal::Type::BaseModel
4466
+ OrHash =
4467
+ T.type_alias do
4468
+ T.any(
4469
+ Orb::PriceCreateParams::Body::UnitWithMultiplier,
4470
+ Orb::Internal::AnyHash
4471
+ )
4472
+ end
4473
+
4474
+ # The cadence to bill for this price on.
4475
+ sig do
4476
+ returns(
4477
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::Cadence::OrSymbol
4478
+ )
4479
+ end
4480
+ attr_accessor :cadence
4481
+
4482
+ # An ISO 4217 currency string for which this price is billed in.
4483
+ sig { returns(String) }
4484
+ attr_accessor :currency
4485
+
4486
+ # The id of the item the price will be associated with.
4487
+ sig { returns(String) }
4488
+ attr_accessor :item_id
4489
+
4490
+ # The pricing model type
4491
+ sig { returns(Symbol) }
4492
+ attr_accessor :model_type
4493
+
4494
+ # The name of the price.
4495
+ sig { returns(String) }
4496
+ attr_accessor :name
4497
+
4498
+ # Configuration for unit_with_multiplier pricing
4499
+ sig do
4500
+ returns(
4501
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::UnitWithMultiplierConfig
4502
+ )
4503
+ end
4504
+ attr_reader :unit_with_multiplier_config
4505
+
4506
+ sig do
4507
+ params(
4508
+ unit_with_multiplier_config:
4509
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::UnitWithMultiplierConfig::OrHash
4510
+ ).void
4511
+ end
4512
+ attr_writer :unit_with_multiplier_config
4513
+
4514
+ # The id of the billable metric for the price. Only needed if the price is
4515
+ # usage-based.
4516
+ sig { returns(T.nilable(String)) }
4517
+ attr_accessor :billable_metric_id
4518
+
4519
+ # If the Price represents a fixed cost, the price will be billed in-advance if
4520
+ # this is true, and in-arrears if this is false.
4521
+ sig { returns(T.nilable(T::Boolean)) }
4522
+ attr_accessor :billed_in_advance
4523
+
4524
+ # For custom cadence: specifies the duration of the billing period in days or
4525
+ # months.
4526
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
4527
+ attr_reader :billing_cycle_configuration
4528
+
4529
+ sig do
4530
+ params(
4531
+ billing_cycle_configuration:
4532
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
4533
+ ).void
4534
+ end
4535
+ attr_writer :billing_cycle_configuration
4536
+
4537
+ # The per unit conversion rate of the price currency to the invoicing currency.
4538
+ sig { returns(T.nilable(Float)) }
4539
+ attr_accessor :conversion_rate
4540
+
4541
+ # The configuration for the rate of the price currency to the invoicing currency.
4542
+ sig do
4543
+ returns(
4544
+ T.nilable(
4545
+ T.any(
4546
+ Orb::UnitConversionRateConfig,
4547
+ Orb::TieredConversionRateConfig
4548
+ )
4549
+ )
4550
+ )
4551
+ end
4552
+ attr_accessor :conversion_rate_config
4553
+
4554
+ # For dimensional price: specifies a price group and dimension values
4555
+ sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) }
4556
+ attr_reader :dimensional_price_configuration
4557
+
4558
+ sig do
4559
+ params(
4560
+ dimensional_price_configuration:
4561
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash)
4562
+ ).void
4563
+ end
4564
+ attr_writer :dimensional_price_configuration
4565
+
4566
+ # An alias for the price.
4567
+ sig { returns(T.nilable(String)) }
4568
+ attr_accessor :external_price_id
4569
+
4570
+ # If the Price represents a fixed cost, this represents the quantity of units
4571
+ # applied.
4572
+ sig { returns(T.nilable(Float)) }
4573
+ attr_accessor :fixed_price_quantity
4574
+
4575
+ # The property used to group this price on an invoice
4576
+ sig { returns(T.nilable(String)) }
4577
+ attr_accessor :invoice_grouping_key
4578
+
4579
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
4580
+ # If unspecified, a single invoice is produced per billing cycle.
4581
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
4582
+ attr_reader :invoicing_cycle_configuration
4583
+
4584
+ sig do
4585
+ params(
4586
+ invoicing_cycle_configuration:
4587
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
4588
+ ).void
4589
+ end
4590
+ attr_writer :invoicing_cycle_configuration
4591
+
4592
+ # The ID of the license type to associate with this price. On a usage price this
4593
+ # also marks the price as eligible to draw down from that license type's
4594
+ # allocation; a usage price created without it is billed normally. Usage prices
4595
+ # with a license type must use the `unit` model, and only draw down when their
4596
+ # currency matches the allocation's.
4597
+ sig { returns(T.nilable(String)) }
4598
+ attr_accessor :license_type_id
4599
+
4600
+ # User-specified key/value pairs for the resource. Individual keys can be removed
4601
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
4602
+ # by setting `metadata` to `null`.
4603
+ sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
4604
+ attr_accessor :metadata
4605
+
4606
+ sig do
4607
+ params(
4608
+ cadence:
4609
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::Cadence::OrSymbol,
4610
+ currency: String,
4611
+ item_id: String,
4612
+ name: String,
4613
+ unit_with_multiplier_config:
4614
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::UnitWithMultiplierConfig::OrHash,
4615
+ billable_metric_id: T.nilable(String),
4616
+ billed_in_advance: T.nilable(T::Boolean),
4617
+ billing_cycle_configuration:
4618
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
4619
+ conversion_rate: T.nilable(Float),
4620
+ conversion_rate_config:
4621
+ T.nilable(
4622
+ T.any(
4623
+ Orb::UnitConversionRateConfig::OrHash,
4624
+ Orb::TieredConversionRateConfig::OrHash
4625
+ )
4626
+ ),
4627
+ dimensional_price_configuration:
4628
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash),
4629
+ external_price_id: T.nilable(String),
4630
+ fixed_price_quantity: T.nilable(Float),
4631
+ invoice_grouping_key: T.nilable(String),
4632
+ invoicing_cycle_configuration:
4633
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
4634
+ license_type_id: T.nilable(String),
4635
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
4636
+ model_type: Symbol
4637
+ ).returns(T.attached_class)
4638
+ end
4639
+ def self.new(
4640
+ # The cadence to bill for this price on.
4641
+ cadence:,
4642
+ # An ISO 4217 currency string for which this price is billed in.
4643
+ currency:,
4644
+ # The id of the item the price will be associated with.
4645
+ item_id:,
4646
+ # The name of the price.
4647
+ name:,
4648
+ # Configuration for unit_with_multiplier pricing
4649
+ unit_with_multiplier_config:,
4650
+ # The id of the billable metric for the price. Only needed if the price is
4651
+ # usage-based.
4652
+ billable_metric_id: nil,
4653
+ # If the Price represents a fixed cost, the price will be billed in-advance if
4654
+ # this is true, and in-arrears if this is false.
4655
+ billed_in_advance: nil,
4656
+ # For custom cadence: specifies the duration of the billing period in days or
4657
+ # months.
4658
+ billing_cycle_configuration: nil,
4659
+ # The per unit conversion rate of the price currency to the invoicing currency.
4660
+ conversion_rate: nil,
4661
+ # The configuration for the rate of the price currency to the invoicing currency.
4662
+ conversion_rate_config: nil,
4663
+ # For dimensional price: specifies a price group and dimension values
4664
+ dimensional_price_configuration: nil,
4665
+ # An alias for the price.
4666
+ external_price_id: nil,
4667
+ # If the Price represents a fixed cost, this represents the quantity of units
4668
+ # applied.
4669
+ fixed_price_quantity: nil,
4670
+ # The property used to group this price on an invoice
4671
+ invoice_grouping_key: nil,
4672
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
4673
+ # If unspecified, a single invoice is produced per billing cycle.
4674
+ invoicing_cycle_configuration: nil,
4675
+ # The ID of the license type to associate with this price. On a usage price this
4676
+ # also marks the price as eligible to draw down from that license type's
4677
+ # allocation; a usage price created without it is billed normally. Usage prices
4678
+ # with a license type must use the `unit` model, and only draw down when their
4679
+ # currency matches the allocation's.
4680
+ license_type_id: nil,
4681
+ # User-specified key/value pairs for the resource. Individual keys can be removed
4682
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
4683
+ # by setting `metadata` to `null`.
4684
+ metadata: nil,
4685
+ # The pricing model type
4686
+ model_type: :unit_with_multiplier
4687
+ )
4688
+ end
4689
+
4690
+ sig do
4691
+ override.returns(
4692
+ {
4693
+ cadence:
4694
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::Cadence::OrSymbol,
4695
+ currency: String,
4696
+ item_id: String,
4697
+ model_type: Symbol,
4698
+ name: String,
4699
+ unit_with_multiplier_config:
4700
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::UnitWithMultiplierConfig,
4701
+ billable_metric_id: T.nilable(String),
4702
+ billed_in_advance: T.nilable(T::Boolean),
4703
+ billing_cycle_configuration:
4704
+ T.nilable(Orb::NewBillingCycleConfiguration),
4705
+ conversion_rate: T.nilable(Float),
4706
+ conversion_rate_config:
4707
+ T.nilable(
4708
+ T.any(
4709
+ Orb::UnitConversionRateConfig,
4710
+ Orb::TieredConversionRateConfig
4711
+ )
4712
+ ),
4713
+ dimensional_price_configuration:
4714
+ T.nilable(Orb::NewDimensionalPriceConfiguration),
4715
+ external_price_id: T.nilable(String),
4716
+ fixed_price_quantity: T.nilable(Float),
4717
+ invoice_grouping_key: T.nilable(String),
4718
+ invoicing_cycle_configuration:
4719
+ T.nilable(Orb::NewBillingCycleConfiguration),
4720
+ license_type_id: T.nilable(String),
4721
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])
4722
+ }
4723
+ )
4724
+ end
4725
+ def to_hash
4726
+ end
4727
+
4728
+ # The cadence to bill for this price on.
4729
+ module Cadence
4730
+ extend Orb::Internal::Type::Enum
4731
+
4732
+ TaggedSymbol =
4733
+ T.type_alias do
4734
+ T.all(
4735
+ Symbol,
4736
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::Cadence
4737
+ )
4738
+ end
4739
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
4740
+
4741
+ ONE_TIME =
4742
+ T.let(
4743
+ :one_time,
4744
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::Cadence::TaggedSymbol
4745
+ )
4746
+ MONTHLY =
4747
+ T.let(
4748
+ :monthly,
4749
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::Cadence::TaggedSymbol
4750
+ )
4751
+ QUARTERLY =
4752
+ T.let(
4753
+ :quarterly,
4754
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::Cadence::TaggedSymbol
4755
+ )
4756
+ SEMI_ANNUAL =
4757
+ T.let(
4758
+ :semi_annual,
4759
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::Cadence::TaggedSymbol
4760
+ )
4761
+ ANNUAL =
4762
+ T.let(
4763
+ :annual,
4764
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::Cadence::TaggedSymbol
4765
+ )
4766
+ CUSTOM =
4767
+ T.let(
4768
+ :custom,
4769
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::Cadence::TaggedSymbol
4770
+ )
4771
+
4772
+ sig do
4773
+ override.returns(
4774
+ T::Array[
4775
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::Cadence::TaggedSymbol
4776
+ ]
4777
+ )
4778
+ end
4779
+ def self.values
4780
+ end
4781
+ end
4782
+
4783
+ class UnitWithMultiplierConfig < Orb::Internal::Type::BaseModel
4784
+ OrHash =
4785
+ T.type_alias do
4786
+ T.any(
4787
+ Orb::PriceCreateParams::Body::UnitWithMultiplier::UnitWithMultiplierConfig,
4788
+ Orb::Internal::AnyHash
4789
+ )
4790
+ end
4791
+
4792
+ # Sub-line label for list-price events that don't set display_name_key. Unlabeled
4793
+ # events with another multiplier are labeled by their multiplier (e.g. '0.8×
4794
+ # rate').
4795
+ sig { returns(String) }
4796
+ attr_accessor :default_display_name
4797
+
4798
+ # Event property holding the sub-line label for the event's rate (e.g.
4799
+ # 'Off-peak').
4800
+ sig { returns(String) }
4801
+ attr_accessor :display_name_key
4802
+
4803
+ # Event property holding the multiplier applied to unit_amount (e.g. 0.8 for a 20%
4804
+ # discount). Events without a number between 0 and 1000 with at most 12 decimal
4805
+ # places are charged at unit_amount.
4806
+ sig { returns(String) }
4807
+ attr_accessor :multiplier_key
4808
+
4809
+ # List price per unit, before the event's multiplier is applied.
4810
+ sig { returns(String) }
4811
+ attr_accessor :unit_amount
4812
+
4813
+ # Configuration for unit_with_multiplier pricing
4814
+ sig do
4815
+ params(
4816
+ default_display_name: String,
4817
+ display_name_key: String,
4818
+ multiplier_key: String,
4819
+ unit_amount: String
4820
+ ).returns(T.attached_class)
4821
+ end
4822
+ def self.new(
4823
+ # Sub-line label for list-price events that don't set display_name_key. Unlabeled
4824
+ # events with another multiplier are labeled by their multiplier (e.g. '0.8×
4825
+ # rate').
4826
+ default_display_name:,
4827
+ # Event property holding the sub-line label for the event's rate (e.g.
4828
+ # 'Off-peak').
4829
+ display_name_key:,
4830
+ # Event property holding the multiplier applied to unit_amount (e.g. 0.8 for a 20%
4831
+ # discount). Events without a number between 0 and 1000 with at most 12 decimal
4832
+ # places are charged at unit_amount.
4833
+ multiplier_key:,
4834
+ # List price per unit, before the event's multiplier is applied.
4835
+ unit_amount:
4836
+ )
4837
+ end
4838
+
4839
+ sig do
4840
+ override.returns(
4841
+ {
4842
+ default_display_name: String,
4843
+ display_name_key: String,
4844
+ multiplier_key: String,
4845
+ unit_amount: String
4846
+ }
4847
+ )
4848
+ end
4849
+ def to_hash
4850
+ end
4851
+ end
4852
+ end
4853
+
4461
4854
  sig do
4462
4855
  override.returns(T::Array[Orb::PriceCreateParams::Body::Variants])
4463
4856
  end
@@ -91,7 +91,8 @@ module Orb
91
91
  Orb::Price::MeteredAllowance::OrHash,
92
92
  Orb::Price::MinimumComposite::OrHash,
93
93
  Orb::Price::Percent::OrHash,
94
- Orb::Price::EventOutput::OrHash
94
+ Orb::Price::EventOutput::OrHash,
95
+ Orb::Price::UnitWithMultiplier::OrHash
95
96
  ),
96
97
  properties: Orb::PriceEditedWebhookEvent::Properties::OrHash,
97
98
  type: Orb::PriceEditedWebhookEvent::Type::OrSymbol