orb-billing 1.54.0 → 1.56.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 (150) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +7 -0
  5. data/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +496 -6
  6. data/lib/orb/models/beta_create_plan_version_params.rb +496 -6
  7. data/lib/orb/models/changed_subscription_resources.rb +2 -2
  8. data/lib/orb/models/credit_block_accounting_sync_failed_webhook_event.rb +4 -4
  9. data/lib/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rb +4 -4
  10. data/lib/orb/models/credit_block_list_invoices_response.rb +4 -4
  11. data/lib/orb/models/credit_block_retrieve_response.rb +4 -4
  12. data/lib/orb/models/credit_block_update_response.rb +4 -4
  13. data/lib/orb/models/customer_credit_ledger_incremented_webhook_event.rb +4 -4
  14. data/lib/orb/models/dimensional_price_groups/price_create_response.rb +2 -2
  15. data/lib/orb/models/invoice.rb +2 -2
  16. data/lib/orb/models/invoice_edited_webhook_event.rb +2 -2
  17. data/lib/orb/models/invoice_fetch_upcoming_response.rb +2 -2
  18. data/lib/orb/models/invoice_line_item_create_response.rb +2 -2
  19. data/lib/orb/models/metric_update_params.rb +4 -3
  20. data/lib/orb/models/migration_cancel_params.rb +20 -0
  21. data/lib/orb/models/migration_cancel_response.rb +133 -0
  22. data/lib/orb/models/migration_create_params.rb +159 -0
  23. data/lib/orb/models/migration_create_response.rb +133 -0
  24. data/lib/orb/models/migration_list_params.rb +48 -0
  25. data/lib/orb/models/migration_list_response.rb +133 -0
  26. data/lib/orb/models/migration_retrieve_params.rb +20 -0
  27. data/lib/orb/models/migration_retrieve_response.rb +133 -0
  28. data/lib/orb/models/migration_subscription.rb +75 -0
  29. data/lib/orb/models/migrations/subscription_list_params.rb +74 -0
  30. data/lib/orb/models/per_price_cost.rb +2 -2
  31. data/lib/orb/models/plan.rb +2 -2
  32. data/lib/orb/models/plan_create_params.rb +246 -3
  33. data/lib/orb/models/plan_version.rb +2 -2
  34. data/lib/orb/models/plans/migration_cancel_response.rb +28 -8
  35. data/lib/orb/models/plans/migration_list_response.rb +28 -8
  36. data/lib/orb/models/plans/migration_retrieve_response.rb +28 -8
  37. data/lib/orb/models/price.rb +416 -1
  38. data/lib/orb/models/price_create_params.rb +231 -3
  39. data/lib/orb/models/price_edited_webhook_event.rb +2 -2
  40. data/lib/orb/models/price_evaluate_multiple_params.rb +238 -3
  41. data/lib/orb/models/price_evaluate_preview_events_params.rb +238 -3
  42. data/lib/orb/models/price_interval.rb +2 -2
  43. data/lib/orb/models/subscription_create_params.rb +495 -6
  44. data/lib/orb/models/subscription_price_intervals_params.rb +238 -3
  45. data/lib/orb/models/subscription_schedule_plan_change_params.rb +496 -6
  46. data/lib/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rb +4 -4
  47. data/lib/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rb +4 -4
  48. data/lib/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rb +4 -4
  49. data/lib/orb/models/webhooks/invoice_edited_standard_webhook_event.rb +2 -2
  50. data/lib/orb/models/webhooks/price_edited_standard_webhook_event.rb +2 -2
  51. data/lib/orb/models.rb +12 -0
  52. data/lib/orb/resources/credit_blocks.rb +1 -1
  53. data/lib/orb/resources/dimensional_price_groups/prices.rb +1 -1
  54. data/lib/orb/resources/metrics.rb +11 -10
  55. data/lib/orb/resources/migrations/subscriptions.rb +60 -0
  56. data/lib/orb/resources/migrations.rb +153 -0
  57. data/lib/orb/resources/prices/external_price_id.rb +2 -2
  58. data/lib/orb/resources/prices.rb +5 -5
  59. data/lib/orb/version.rb +1 -1
  60. data/lib/orb.rb +12 -0
  61. data/rbi/orb/client.rbi +6 -0
  62. data/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +2939 -2129
  63. data/rbi/orb/models/beta_create_plan_version_params.rbi +2937 -2127
  64. data/rbi/orb/models/changed_subscription_resources.rbi +2 -1
  65. data/rbi/orb/models/credit_block_accounting_sync_failed_webhook_event.rbi +5 -5
  66. data/rbi/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rbi +5 -5
  67. data/rbi/orb/models/credit_block_list_invoices_response.rbi +5 -5
  68. data/rbi/orb/models/credit_block_retrieve_response.rbi +5 -5
  69. data/rbi/orb/models/credit_block_update_response.rbi +5 -5
  70. data/rbi/orb/models/customer_credit_ledger_incremented_webhook_event.rbi +5 -5
  71. data/rbi/orb/models/dimensional_price_groups/price_create_response.rbi +2 -1
  72. data/rbi/orb/models/invoice.rbi +2 -1
  73. data/rbi/orb/models/invoice_edited_webhook_event.rbi +2 -1
  74. data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +2 -1
  75. data/rbi/orb/models/invoice_line_item_create_response.rbi +2 -1
  76. data/rbi/orb/models/metric_update_params.rbi +6 -4
  77. data/rbi/orb/models/migration_cancel_params.rbi +35 -0
  78. data/rbi/orb/models/migration_cancel_response.rbi +218 -0
  79. data/rbi/orb/models/migration_create_params.rbi +248 -0
  80. data/rbi/orb/models/migration_create_response.rbi +218 -0
  81. data/rbi/orb/models/migration_list_params.rbi +66 -0
  82. data/rbi/orb/models/migration_list_response.rbi +214 -0
  83. data/rbi/orb/models/migration_retrieve_params.rbi +35 -0
  84. data/rbi/orb/models/migration_retrieve_response.rbi +221 -0
  85. data/rbi/orb/models/migration_subscription.rbi +112 -0
  86. data/rbi/orb/models/migrations/subscription_list_params.rbi +147 -0
  87. data/rbi/orb/models/per_price_cost.rbi +2 -1
  88. data/rbi/orb/models/plan.rbi +2 -1
  89. data/rbi/orb/models/plan_create_params.rbi +409 -4
  90. data/rbi/orb/models/plan_version.rbi +2 -1
  91. data/rbi/orb/models/plans/migration_cancel_response.rbi +36 -12
  92. data/rbi/orb/models/plans/migration_list_response.rbi +36 -12
  93. data/rbi/orb/models/plans/migration_retrieve_response.rbi +36 -12
  94. data/rbi/orb/models/price.rbi +716 -1
  95. data/rbi/orb/models/price_create_params.rbi +397 -4
  96. data/rbi/orb/models/price_edited_webhook_event.rbi +2 -1
  97. data/rbi/orb/models/price_evaluate_multiple_params.rbi +397 -4
  98. data/rbi/orb/models/price_evaluate_preview_events_params.rbi +397 -4
  99. data/rbi/orb/models/price_interval.rbi +2 -1
  100. data/rbi/orb/models/subscription_create_params.rbi +2676 -1866
  101. data/rbi/orb/models/subscription_price_intervals_params.rbi +397 -4
  102. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +2686 -1876
  103. data/rbi/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rbi +5 -5
  104. data/rbi/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rbi +5 -5
  105. data/rbi/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rbi +5 -5
  106. data/rbi/orb/models/webhooks/invoice_edited_standard_webhook_event.rbi +2 -1
  107. data/rbi/orb/models/webhooks/price_edited_standard_webhook_event.rbi +2 -1
  108. data/rbi/orb/models.rbi +12 -0
  109. data/rbi/orb/resources/credit_blocks.rbi +1 -1
  110. data/rbi/orb/resources/metrics.rbi +13 -11
  111. data/rbi/orb/resources/migrations/subscriptions.rbi +54 -0
  112. data/rbi/orb/resources/migrations.rbi +130 -0
  113. data/rbi/orb/resources/prices.rbi +2 -1
  114. data/sig/orb/client.rbs +2 -0
  115. data/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +322 -0
  116. data/sig/orb/models/beta_create_plan_version_params.rbs +322 -0
  117. data/sig/orb/models/credit_block_accounting_sync_failed_webhook_event.rbs +2 -2
  118. data/sig/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rbs +2 -2
  119. data/sig/orb/models/credit_block_list_invoices_response.rbs +2 -2
  120. data/sig/orb/models/credit_block_retrieve_response.rbs +2 -2
  121. data/sig/orb/models/credit_block_update_response.rbs +2 -2
  122. data/sig/orb/models/customer_credit_ledger_incremented_webhook_event.rbs +2 -2
  123. data/sig/orb/models/migration_cancel_params.rbs +23 -0
  124. data/sig/orb/models/migration_cancel_response.rbs +84 -0
  125. data/sig/orb/models/migration_create_params.rbs +126 -0
  126. data/sig/orb/models/migration_create_response.rbs +84 -0
  127. data/sig/orb/models/migration_list_params.rbs +43 -0
  128. data/sig/orb/models/migration_list_response.rbs +84 -0
  129. data/sig/orb/models/migration_retrieve_params.rbs +23 -0
  130. data/sig/orb/models/migration_retrieve_response.rbs +84 -0
  131. data/sig/orb/models/migration_subscription.rbs +54 -0
  132. data/sig/orb/models/migrations/subscription_list_params.rbs +64 -0
  133. data/sig/orb/models/plan_create_params.rbs +161 -0
  134. data/sig/orb/models/plans/migration_cancel_response.rbs +17 -4
  135. data/sig/orb/models/plans/migration_list_response.rbs +17 -4
  136. data/sig/orb/models/plans/migration_retrieve_response.rbs +17 -4
  137. data/sig/orb/models/price.rbs +305 -0
  138. data/sig/orb/models/price_create_params.rbs +151 -0
  139. data/sig/orb/models/price_evaluate_multiple_params.rbs +156 -0
  140. data/sig/orb/models/price_evaluate_preview_events_params.rbs +156 -0
  141. data/sig/orb/models/subscription_create_params.rbs +322 -0
  142. data/sig/orb/models/subscription_price_intervals_params.rbs +156 -0
  143. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +322 -0
  144. data/sig/orb/models/webhooks/credit_block_accounting_sync_failed_standard_webhook_event.rbs +2 -2
  145. data/sig/orb/models/webhooks/credit_block_accounting_sync_succeeded_standard_webhook_event.rbs +2 -2
  146. data/sig/orb/models/webhooks/customer_credit_ledger_incremented_standard_webhook_event.rbs +2 -2
  147. data/sig/orb/models.rbs +12 -0
  148. data/sig/orb/resources/migrations/subscriptions.rbs +18 -0
  149. data/sig/orb/resources/migrations.rbs +44 -0
  150. metadata +37 -1
@@ -0,0 +1,147 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Models
5
+ module Migrations
6
+ class SubscriptionListParams < Orb::Internal::Type::BaseModel
7
+ extend Orb::Internal::Type::RequestParameters::Converter
8
+ include Orb::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Orb::Migrations::SubscriptionListParams,
14
+ Orb::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :migration_id
20
+
21
+ # Cursor for pagination. This can be populated by the `next_cursor` value returned
22
+ # from the initial request.
23
+ sig { returns(T.nilable(String)) }
24
+ attr_accessor :cursor
25
+
26
+ # The number of items to fetch. Defaults to 20.
27
+ sig { returns(T.nilable(Integer)) }
28
+ attr_reader :limit
29
+
30
+ sig { params(limit: Integer).void }
31
+ attr_writer :limit
32
+
33
+ # Only return subscriptions with one of these statuses.
34
+ sig do
35
+ returns(
36
+ T.nilable(
37
+ T::Array[
38
+ Orb::Migrations::SubscriptionListParams::Status::OrSymbol
39
+ ]
40
+ )
41
+ )
42
+ end
43
+ attr_accessor :status
44
+
45
+ # Only return these subscriptions. Up to 100 IDs.
46
+ sig { returns(T.nilable(T::Array[String])) }
47
+ attr_accessor :subscription_id
48
+
49
+ sig do
50
+ params(
51
+ migration_id: String,
52
+ cursor: T.nilable(String),
53
+ limit: Integer,
54
+ status:
55
+ T.nilable(
56
+ T::Array[
57
+ Orb::Migrations::SubscriptionListParams::Status::OrSymbol
58
+ ]
59
+ ),
60
+ subscription_id: T.nilable(T::Array[String]),
61
+ request_options: Orb::RequestOptions::OrHash
62
+ ).returns(T.attached_class)
63
+ end
64
+ def self.new(
65
+ migration_id:,
66
+ # Cursor for pagination. This can be populated by the `next_cursor` value returned
67
+ # from the initial request.
68
+ cursor: nil,
69
+ # The number of items to fetch. Defaults to 20.
70
+ limit: nil,
71
+ # Only return subscriptions with one of these statuses.
72
+ status: nil,
73
+ # Only return these subscriptions. Up to 100 IDs.
74
+ subscription_id: nil,
75
+ request_options: {}
76
+ )
77
+ end
78
+
79
+ sig do
80
+ override.returns(
81
+ {
82
+ migration_id: String,
83
+ cursor: T.nilable(String),
84
+ limit: Integer,
85
+ status:
86
+ T.nilable(
87
+ T::Array[
88
+ Orb::Migrations::SubscriptionListParams::Status::OrSymbol
89
+ ]
90
+ ),
91
+ subscription_id: T.nilable(T::Array[String]),
92
+ request_options: Orb::RequestOptions
93
+ }
94
+ )
95
+ end
96
+ def to_hash
97
+ end
98
+
99
+ module Status
100
+ extend Orb::Internal::Type::Enum
101
+
102
+ TaggedSymbol =
103
+ T.type_alias do
104
+ T.all(Symbol, Orb::Migrations::SubscriptionListParams::Status)
105
+ end
106
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
107
+
108
+ SCHEDULING =
109
+ T.let(
110
+ :scheduling,
111
+ Orb::Migrations::SubscriptionListParams::Status::TaggedSymbol
112
+ )
113
+ SCHEDULED =
114
+ T.let(
115
+ :scheduled,
116
+ Orb::Migrations::SubscriptionListParams::Status::TaggedSymbol
117
+ )
118
+ COMPLETED =
119
+ T.let(
120
+ :completed,
121
+ Orb::Migrations::SubscriptionListParams::Status::TaggedSymbol
122
+ )
123
+ SKIPPED =
124
+ T.let(
125
+ :skipped,
126
+ Orb::Migrations::SubscriptionListParams::Status::TaggedSymbol
127
+ )
128
+ FAILED =
129
+ T.let(
130
+ :failed,
131
+ Orb::Migrations::SubscriptionListParams::Status::TaggedSymbol
132
+ )
133
+
134
+ sig do
135
+ override.returns(
136
+ T::Array[
137
+ Orb::Migrations::SubscriptionListParams::Status::TaggedSymbol
138
+ ]
139
+ )
140
+ end
141
+ def self.values
142
+ end
143
+ end
144
+ end
145
+ end
146
+ end
147
+ end
@@ -64,7 +64,8 @@ module Orb
64
64
  Orb::Price::MeteredAllowance::OrHash,
65
65
  Orb::Price::MinimumComposite::OrHash,
66
66
  Orb::Price::Percent::OrHash,
67
- Orb::Price::EventOutput::OrHash
67
+ Orb::Price::EventOutput::OrHash,
68
+ Orb::Price::UnitWithMultiplier::OrHash
68
69
  ),
69
70
  price_id: String,
70
71
  subtotal: String,
@@ -200,7 +200,8 @@ module Orb
200
200
  Orb::Price::MeteredAllowance::OrHash,
201
201
  Orb::Price::MinimumComposite::OrHash,
202
202
  Orb::Price::Percent::OrHash,
203
- Orb::Price::EventOutput::OrHash
203
+ Orb::Price::EventOutput::OrHash,
204
+ Orb::Price::UnitWithMultiplier::OrHash
204
205
  )
205
206
  ],
206
207
  product: Orb::Plan::Product::OrHash,
@@ -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