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
@@ -285,7 +285,8 @@ module Orb
285
285
  Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance,
286
286
  Orb::NewFloatingMinimumCompositePrice,
287
287
  Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent,
288
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput
288
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput,
289
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier
289
290
  )
290
291
  )
291
292
  )
@@ -371,7 +372,8 @@ module Orb
371
372
  Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance::OrHash,
372
373
  Orb::NewFloatingMinimumCompositePrice::OrHash,
373
374
  Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent::OrHash,
374
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::OrHash
375
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput::OrHash,
376
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::OrHash
375
377
  )
376
378
  ),
377
379
  price_id: T.nilable(String),
@@ -493,7 +495,8 @@ module Orb
493
495
  Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance,
494
496
  Orb::NewFloatingMinimumCompositePrice,
495
497
  Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent,
496
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput
498
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput,
499
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier
497
500
  )
498
501
  ),
499
502
  price_id: T.nilable(String),
@@ -759,7 +762,8 @@ module Orb
759
762
  Orb::SubscriptionPriceIntervalsParams::Add::Price::MeteredAllowance,
760
763
  Orb::NewFloatingMinimumCompositePrice,
761
764
  Orb::SubscriptionPriceIntervalsParams::Add::Price::Percent,
762
- Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput
765
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::EventOutput,
766
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier
763
767
  )
764
768
  end
765
769
 
@@ -5031,6 +5035,395 @@ module Orb
5031
5035
  end
5032
5036
  end
5033
5037
 
5038
+ class UnitWithMultiplier < Orb::Internal::Type::BaseModel
5039
+ OrHash =
5040
+ T.type_alias do
5041
+ T.any(
5042
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier,
5043
+ Orb::Internal::AnyHash
5044
+ )
5045
+ end
5046
+
5047
+ # The cadence to bill for this price on.
5048
+ sig do
5049
+ returns(
5050
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::Cadence::OrSymbol
5051
+ )
5052
+ end
5053
+ attr_accessor :cadence
5054
+
5055
+ # An ISO 4217 currency string for which this price is billed in.
5056
+ sig { returns(String) }
5057
+ attr_accessor :currency
5058
+
5059
+ # The id of the item the price will be associated with.
5060
+ sig { returns(String) }
5061
+ attr_accessor :item_id
5062
+
5063
+ # The pricing model type
5064
+ sig { returns(Symbol) }
5065
+ attr_accessor :model_type
5066
+
5067
+ # The name of the price.
5068
+ sig { returns(String) }
5069
+ attr_accessor :name
5070
+
5071
+ # Configuration for unit_with_multiplier pricing
5072
+ sig do
5073
+ returns(
5074
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::UnitWithMultiplierConfig
5075
+ )
5076
+ end
5077
+ attr_reader :unit_with_multiplier_config
5078
+
5079
+ sig do
5080
+ params(
5081
+ unit_with_multiplier_config:
5082
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::UnitWithMultiplierConfig::OrHash
5083
+ ).void
5084
+ end
5085
+ attr_writer :unit_with_multiplier_config
5086
+
5087
+ # The id of the billable metric for the price. Only needed if the price is
5088
+ # usage-based.
5089
+ sig { returns(T.nilable(String)) }
5090
+ attr_accessor :billable_metric_id
5091
+
5092
+ # If the Price represents a fixed cost, the price will be billed in-advance if
5093
+ # this is true, and in-arrears if this is false.
5094
+ sig { returns(T.nilable(T::Boolean)) }
5095
+ attr_accessor :billed_in_advance
5096
+
5097
+ # For custom cadence: specifies the duration of the billing period in days or
5098
+ # months.
5099
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
5100
+ attr_reader :billing_cycle_configuration
5101
+
5102
+ sig do
5103
+ params(
5104
+ billing_cycle_configuration:
5105
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
5106
+ ).void
5107
+ end
5108
+ attr_writer :billing_cycle_configuration
5109
+
5110
+ # The per unit conversion rate of the price currency to the invoicing currency.
5111
+ sig { returns(T.nilable(Float)) }
5112
+ attr_accessor :conversion_rate
5113
+
5114
+ # The configuration for the rate of the price currency to the invoicing currency.
5115
+ sig do
5116
+ returns(
5117
+ T.nilable(
5118
+ T.any(
5119
+ Orb::UnitConversionRateConfig,
5120
+ Orb::TieredConversionRateConfig
5121
+ )
5122
+ )
5123
+ )
5124
+ end
5125
+ attr_accessor :conversion_rate_config
5126
+
5127
+ # For dimensional price: specifies a price group and dimension values
5128
+ sig { returns(T.nilable(Orb::NewDimensionalPriceConfiguration)) }
5129
+ attr_reader :dimensional_price_configuration
5130
+
5131
+ sig do
5132
+ params(
5133
+ dimensional_price_configuration:
5134
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash)
5135
+ ).void
5136
+ end
5137
+ attr_writer :dimensional_price_configuration
5138
+
5139
+ # An alias for the price.
5140
+ sig { returns(T.nilable(String)) }
5141
+ attr_accessor :external_price_id
5142
+
5143
+ # If the Price represents a fixed cost, this represents the quantity of units
5144
+ # applied.
5145
+ sig { returns(T.nilable(Float)) }
5146
+ attr_accessor :fixed_price_quantity
5147
+
5148
+ # The property used to group this price on an invoice
5149
+ sig { returns(T.nilable(String)) }
5150
+ attr_accessor :invoice_grouping_key
5151
+
5152
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
5153
+ # If unspecified, a single invoice is produced per billing cycle.
5154
+ sig { returns(T.nilable(Orb::NewBillingCycleConfiguration)) }
5155
+ attr_reader :invoicing_cycle_configuration
5156
+
5157
+ sig do
5158
+ params(
5159
+ invoicing_cycle_configuration:
5160
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash)
5161
+ ).void
5162
+ end
5163
+ attr_writer :invoicing_cycle_configuration
5164
+
5165
+ # The ID of the license type to associate with this price. On a usage price this
5166
+ # also marks the price as eligible to draw down from that license type's
5167
+ # allocation; a usage price created without it is billed normally. Usage prices
5168
+ # with a license type must use the `unit` model, and only draw down when their
5169
+ # currency matches the allocation's.
5170
+ sig { returns(T.nilable(String)) }
5171
+ attr_accessor :license_type_id
5172
+
5173
+ # User-specified key/value pairs for the resource. Individual keys can be removed
5174
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
5175
+ # by setting `metadata` to `null`.
5176
+ sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
5177
+ attr_accessor :metadata
5178
+
5179
+ sig do
5180
+ params(
5181
+ cadence:
5182
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::Cadence::OrSymbol,
5183
+ currency: String,
5184
+ item_id: String,
5185
+ name: String,
5186
+ unit_with_multiplier_config:
5187
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::UnitWithMultiplierConfig::OrHash,
5188
+ billable_metric_id: T.nilable(String),
5189
+ billed_in_advance: T.nilable(T::Boolean),
5190
+ billing_cycle_configuration:
5191
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
5192
+ conversion_rate: T.nilable(Float),
5193
+ conversion_rate_config:
5194
+ T.nilable(
5195
+ T.any(
5196
+ Orb::UnitConversionRateConfig::OrHash,
5197
+ Orb::TieredConversionRateConfig::OrHash
5198
+ )
5199
+ ),
5200
+ dimensional_price_configuration:
5201
+ T.nilable(Orb::NewDimensionalPriceConfiguration::OrHash),
5202
+ external_price_id: T.nilable(String),
5203
+ fixed_price_quantity: T.nilable(Float),
5204
+ invoice_grouping_key: T.nilable(String),
5205
+ invoicing_cycle_configuration:
5206
+ T.nilable(Orb::NewBillingCycleConfiguration::OrHash),
5207
+ license_type_id: T.nilable(String),
5208
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
5209
+ model_type: Symbol
5210
+ ).returns(T.attached_class)
5211
+ end
5212
+ def self.new(
5213
+ # The cadence to bill for this price on.
5214
+ cadence:,
5215
+ # An ISO 4217 currency string for which this price is billed in.
5216
+ currency:,
5217
+ # The id of the item the price will be associated with.
5218
+ item_id:,
5219
+ # The name of the price.
5220
+ name:,
5221
+ # Configuration for unit_with_multiplier pricing
5222
+ unit_with_multiplier_config:,
5223
+ # The id of the billable metric for the price. Only needed if the price is
5224
+ # usage-based.
5225
+ billable_metric_id: nil,
5226
+ # If the Price represents a fixed cost, the price will be billed in-advance if
5227
+ # this is true, and in-arrears if this is false.
5228
+ billed_in_advance: nil,
5229
+ # For custom cadence: specifies the duration of the billing period in days or
5230
+ # months.
5231
+ billing_cycle_configuration: nil,
5232
+ # The per unit conversion rate of the price currency to the invoicing currency.
5233
+ conversion_rate: nil,
5234
+ # The configuration for the rate of the price currency to the invoicing currency.
5235
+ conversion_rate_config: nil,
5236
+ # For dimensional price: specifies a price group and dimension values
5237
+ dimensional_price_configuration: nil,
5238
+ # An alias for the price.
5239
+ external_price_id: nil,
5240
+ # If the Price represents a fixed cost, this represents the quantity of units
5241
+ # applied.
5242
+ fixed_price_quantity: nil,
5243
+ # The property used to group this price on an invoice
5244
+ invoice_grouping_key: nil,
5245
+ # Within each billing cycle, specifies the cadence at which invoices are produced.
5246
+ # If unspecified, a single invoice is produced per billing cycle.
5247
+ invoicing_cycle_configuration: nil,
5248
+ # The ID of the license type to associate with this price. On a usage price this
5249
+ # also marks the price as eligible to draw down from that license type's
5250
+ # allocation; a usage price created without it is billed normally. Usage prices
5251
+ # with a license type must use the `unit` model, and only draw down when their
5252
+ # currency matches the allocation's.
5253
+ license_type_id: nil,
5254
+ # User-specified key/value pairs for the resource. Individual keys can be removed
5255
+ # by setting the value to `null`, and the entire metadata mapping can be cleared
5256
+ # by setting `metadata` to `null`.
5257
+ metadata: nil,
5258
+ # The pricing model type
5259
+ model_type: :unit_with_multiplier
5260
+ )
5261
+ end
5262
+
5263
+ sig do
5264
+ override.returns(
5265
+ {
5266
+ cadence:
5267
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::Cadence::OrSymbol,
5268
+ currency: String,
5269
+ item_id: String,
5270
+ model_type: Symbol,
5271
+ name: String,
5272
+ unit_with_multiplier_config:
5273
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::UnitWithMultiplierConfig,
5274
+ billable_metric_id: T.nilable(String),
5275
+ billed_in_advance: T.nilable(T::Boolean),
5276
+ billing_cycle_configuration:
5277
+ T.nilable(Orb::NewBillingCycleConfiguration),
5278
+ conversion_rate: T.nilable(Float),
5279
+ conversion_rate_config:
5280
+ T.nilable(
5281
+ T.any(
5282
+ Orb::UnitConversionRateConfig,
5283
+ Orb::TieredConversionRateConfig
5284
+ )
5285
+ ),
5286
+ dimensional_price_configuration:
5287
+ T.nilable(Orb::NewDimensionalPriceConfiguration),
5288
+ external_price_id: T.nilable(String),
5289
+ fixed_price_quantity: T.nilable(Float),
5290
+ invoice_grouping_key: T.nilable(String),
5291
+ invoicing_cycle_configuration:
5292
+ T.nilable(Orb::NewBillingCycleConfiguration),
5293
+ license_type_id: T.nilable(String),
5294
+ metadata: T.nilable(T::Hash[Symbol, T.nilable(String)])
5295
+ }
5296
+ )
5297
+ end
5298
+ def to_hash
5299
+ end
5300
+
5301
+ # The cadence to bill for this price on.
5302
+ module Cadence
5303
+ extend Orb::Internal::Type::Enum
5304
+
5305
+ TaggedSymbol =
5306
+ T.type_alias do
5307
+ T.all(
5308
+ Symbol,
5309
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::Cadence
5310
+ )
5311
+ end
5312
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
5313
+
5314
+ ONE_TIME =
5315
+ T.let(
5316
+ :one_time,
5317
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::Cadence::TaggedSymbol
5318
+ )
5319
+ MONTHLY =
5320
+ T.let(
5321
+ :monthly,
5322
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::Cadence::TaggedSymbol
5323
+ )
5324
+ QUARTERLY =
5325
+ T.let(
5326
+ :quarterly,
5327
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::Cadence::TaggedSymbol
5328
+ )
5329
+ SEMI_ANNUAL =
5330
+ T.let(
5331
+ :semi_annual,
5332
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::Cadence::TaggedSymbol
5333
+ )
5334
+ ANNUAL =
5335
+ T.let(
5336
+ :annual,
5337
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::Cadence::TaggedSymbol
5338
+ )
5339
+ CUSTOM =
5340
+ T.let(
5341
+ :custom,
5342
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::Cadence::TaggedSymbol
5343
+ )
5344
+
5345
+ sig do
5346
+ override.returns(
5347
+ T::Array[
5348
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::Cadence::TaggedSymbol
5349
+ ]
5350
+ )
5351
+ end
5352
+ def self.values
5353
+ end
5354
+ end
5355
+
5356
+ class UnitWithMultiplierConfig < Orb::Internal::Type::BaseModel
5357
+ OrHash =
5358
+ T.type_alias do
5359
+ T.any(
5360
+ Orb::SubscriptionPriceIntervalsParams::Add::Price::UnitWithMultiplier::UnitWithMultiplierConfig,
5361
+ Orb::Internal::AnyHash
5362
+ )
5363
+ end
5364
+
5365
+ # Sub-line label for list-price events that don't set display_name_key. Unlabeled
5366
+ # events with another multiplier are labeled by their multiplier (e.g. '0.8×
5367
+ # rate').
5368
+ sig { returns(String) }
5369
+ attr_accessor :default_display_name
5370
+
5371
+ # Event property holding the sub-line label for the event's rate (e.g.
5372
+ # 'Off-peak').
5373
+ sig { returns(String) }
5374
+ attr_accessor :display_name_key
5375
+
5376
+ # Event property holding the multiplier applied to unit_amount (e.g. 0.8 for a 20%
5377
+ # discount). Events without a number between 0 and 1000 with at most 12 decimal
5378
+ # places are charged at unit_amount.
5379
+ sig { returns(String) }
5380
+ attr_accessor :multiplier_key
5381
+
5382
+ # List price per unit, before the event's multiplier is applied.
5383
+ sig { returns(String) }
5384
+ attr_accessor :unit_amount
5385
+
5386
+ # Configuration for unit_with_multiplier pricing
5387
+ sig do
5388
+ params(
5389
+ default_display_name: String,
5390
+ display_name_key: String,
5391
+ multiplier_key: String,
5392
+ unit_amount: String
5393
+ ).returns(T.attached_class)
5394
+ end
5395
+ def self.new(
5396
+ # Sub-line label for list-price events that don't set display_name_key. Unlabeled
5397
+ # events with another multiplier are labeled by their multiplier (e.g. '0.8×
5398
+ # rate').
5399
+ default_display_name:,
5400
+ # Event property holding the sub-line label for the event's rate (e.g.
5401
+ # 'Off-peak').
5402
+ display_name_key:,
5403
+ # Event property holding the multiplier applied to unit_amount (e.g. 0.8 for a 20%
5404
+ # discount). Events without a number between 0 and 1000 with at most 12 decimal
5405
+ # places are charged at unit_amount.
5406
+ multiplier_key:,
5407
+ # List price per unit, before the event's multiplier is applied.
5408
+ unit_amount:
5409
+ )
5410
+ end
5411
+
5412
+ sig do
5413
+ override.returns(
5414
+ {
5415
+ default_display_name: String,
5416
+ display_name_key: String,
5417
+ multiplier_key: String,
5418
+ unit_amount: String
5419
+ }
5420
+ )
5421
+ end
5422
+ def to_hash
5423
+ end
5424
+ end
5425
+ end
5426
+
5034
5427
  sig do
5035
5428
  override.returns(
5036
5429
  T::Array[