Skip to content

Commit 444add5

Browse files
chore: use sorbet union aliases where available
1 parent fe6a29e commit 444add5

30 files changed

+278
-2854
lines changed

rbi/orb/models/coupon.rbi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module Orb
1414
sig { returns(T.nilable(Time)) }
1515
attr_accessor :archived_at
1616

17-
sig { returns(T.any(Orb::PercentageDiscount, Orb::AmountDiscount)) }
17+
sig { returns(Orb::Coupon::Discount::Variants) }
1818
attr_accessor :discount
1919

2020
# This allows for a coupon's discount to apply for a limited time (determined in
@@ -77,7 +77,7 @@ module Orb
7777
{
7878
id: String,
7979
archived_at: T.nilable(Time),
80-
discount: T.any(Orb::PercentageDiscount, Orb::AmountDiscount),
80+
discount: Orb::Coupon::Discount::Variants,
8181
duration_in_months: T.nilable(Integer),
8282
max_redemptions: T.nilable(Integer),
8383
redemption_code: String,

rbi/orb/models/customers/cost_list_by_external_id_response.rbi

Lines changed: 2 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -125,40 +125,7 @@ module Orb
125125
end
126126

127127
# The price object
128-
sig do
129-
returns(
130-
T.any(
131-
Orb::Price::Unit,
132-
Orb::Price::Package,
133-
Orb::Price::Matrix,
134-
Orb::Price::Tiered,
135-
Orb::Price::TieredBps,
136-
Orb::Price::Bps,
137-
Orb::Price::BulkBps,
138-
Orb::Price::Bulk,
139-
Orb::Price::ThresholdTotalAmount,
140-
Orb::Price::TieredPackage,
141-
Orb::Price::GroupedTiered,
142-
Orb::Price::TieredWithMinimum,
143-
Orb::Price::TieredPackageWithMinimum,
144-
Orb::Price::PackageWithAllocation,
145-
Orb::Price::UnitWithPercent,
146-
Orb::Price::MatrixWithAllocation,
147-
Orb::Price::TieredWithProration,
148-
Orb::Price::UnitWithProration,
149-
Orb::Price::GroupedAllocation,
150-
Orb::Price::GroupedWithProratedMinimum,
151-
Orb::Price::GroupedWithMeteredMinimum,
152-
Orb::Price::MatrixWithDisplayName,
153-
Orb::Price::BulkWithProration,
154-
Orb::Price::GroupedTieredPackage,
155-
Orb::Price::MaxGroupTieredPackage,
156-
Orb::Price::ScalableMatrixWithUnitPricing,
157-
Orb::Price::ScalableMatrixWithTieredPricing,
158-
Orb::Price::CumulativeGroupedBulk
159-
)
160-
)
161-
end
128+
sig { returns(Orb::Price::Variants) }
162129
attr_accessor :price
163130

164131
# The price the cost is associated with
@@ -233,37 +200,7 @@ module Orb
233200
sig do
234201
override.returns(
235202
{
236-
price:
237-
T.any(
238-
Orb::Price::Unit,
239-
Orb::Price::Package,
240-
Orb::Price::Matrix,
241-
Orb::Price::Tiered,
242-
Orb::Price::TieredBps,
243-
Orb::Price::Bps,
244-
Orb::Price::BulkBps,
245-
Orb::Price::Bulk,
246-
Orb::Price::ThresholdTotalAmount,
247-
Orb::Price::TieredPackage,
248-
Orb::Price::GroupedTiered,
249-
Orb::Price::TieredWithMinimum,
250-
Orb::Price::TieredPackageWithMinimum,
251-
Orb::Price::PackageWithAllocation,
252-
Orb::Price::UnitWithPercent,
253-
Orb::Price::MatrixWithAllocation,
254-
Orb::Price::TieredWithProration,
255-
Orb::Price::UnitWithProration,
256-
Orb::Price::GroupedAllocation,
257-
Orb::Price::GroupedWithProratedMinimum,
258-
Orb::Price::GroupedWithMeteredMinimum,
259-
Orb::Price::MatrixWithDisplayName,
260-
Orb::Price::BulkWithProration,
261-
Orb::Price::GroupedTieredPackage,
262-
Orb::Price::MaxGroupTieredPackage,
263-
Orb::Price::ScalableMatrixWithUnitPricing,
264-
Orb::Price::ScalableMatrixWithTieredPricing,
265-
Orb::Price::CumulativeGroupedBulk
266-
),
203+
price: Orb::Price::Variants,
267204
price_id: String,
268205
subtotal: String,
269206
total: String,

rbi/orb/models/customers/cost_list_response.rbi

Lines changed: 2 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -116,40 +116,7 @@ module Orb
116116
end
117117

118118
# The price object
119-
sig do
120-
returns(
121-
T.any(
122-
Orb::Price::Unit,
123-
Orb::Price::Package,
124-
Orb::Price::Matrix,
125-
Orb::Price::Tiered,
126-
Orb::Price::TieredBps,
127-
Orb::Price::Bps,
128-
Orb::Price::BulkBps,
129-
Orb::Price::Bulk,
130-
Orb::Price::ThresholdTotalAmount,
131-
Orb::Price::TieredPackage,
132-
Orb::Price::GroupedTiered,
133-
Orb::Price::TieredWithMinimum,
134-
Orb::Price::TieredPackageWithMinimum,
135-
Orb::Price::PackageWithAllocation,
136-
Orb::Price::UnitWithPercent,
137-
Orb::Price::MatrixWithAllocation,
138-
Orb::Price::TieredWithProration,
139-
Orb::Price::UnitWithProration,
140-
Orb::Price::GroupedAllocation,
141-
Orb::Price::GroupedWithProratedMinimum,
142-
Orb::Price::GroupedWithMeteredMinimum,
143-
Orb::Price::MatrixWithDisplayName,
144-
Orb::Price::BulkWithProration,
145-
Orb::Price::GroupedTieredPackage,
146-
Orb::Price::MaxGroupTieredPackage,
147-
Orb::Price::ScalableMatrixWithUnitPricing,
148-
Orb::Price::ScalableMatrixWithTieredPricing,
149-
Orb::Price::CumulativeGroupedBulk
150-
)
151-
)
152-
end
119+
sig { returns(Orb::Price::Variants) }
153120
attr_accessor :price
154121

155122
# The price the cost is associated with
@@ -224,37 +191,7 @@ module Orb
224191
sig do
225192
override.returns(
226193
{
227-
price:
228-
T.any(
229-
Orb::Price::Unit,
230-
Orb::Price::Package,
231-
Orb::Price::Matrix,
232-
Orb::Price::Tiered,
233-
Orb::Price::TieredBps,
234-
Orb::Price::Bps,
235-
Orb::Price::BulkBps,
236-
Orb::Price::Bulk,
237-
Orb::Price::ThresholdTotalAmount,
238-
Orb::Price::TieredPackage,
239-
Orb::Price::GroupedTiered,
240-
Orb::Price::TieredWithMinimum,
241-
Orb::Price::TieredPackageWithMinimum,
242-
Orb::Price::PackageWithAllocation,
243-
Orb::Price::UnitWithPercent,
244-
Orb::Price::MatrixWithAllocation,
245-
Orb::Price::TieredWithProration,
246-
Orb::Price::UnitWithProration,
247-
Orb::Price::GroupedAllocation,
248-
Orb::Price::GroupedWithProratedMinimum,
249-
Orb::Price::GroupedWithMeteredMinimum,
250-
Orb::Price::MatrixWithDisplayName,
251-
Orb::Price::BulkWithProration,
252-
Orb::Price::GroupedTieredPackage,
253-
Orb::Price::MaxGroupTieredPackage,
254-
Orb::Price::ScalableMatrixWithUnitPricing,
255-
Orb::Price::ScalableMatrixWithTieredPricing,
256-
Orb::Price::CumulativeGroupedBulk
257-
),
194+
price: Orb::Price::Variants,
258195
price_id: String,
259196
subtotal: String,
260197
total: String,

rbi/orb/models/evaluate_price_group.rbi

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ module Orb
1111
attr_accessor :amount
1212

1313
# The values for the group in the order specified by `grouping_keys`
14-
sig { returns(T::Array[T.any(String, Float, T::Boolean)]) }
14+
sig do
15+
returns(T::Array[Orb::EvaluatePriceGroup::GroupingValue::Variants])
16+
end
1517
attr_accessor :grouping_values
1618

1719
# The price's usage quantity for the group
@@ -21,7 +23,8 @@ module Orb
2123
sig do
2224
params(
2325
amount: String,
24-
grouping_values: T::Array[T.any(String, Float, T::Boolean)],
26+
grouping_values:
27+
T::Array[Orb::EvaluatePriceGroup::GroupingValue::Variants],
2528
quantity: Float
2629
).returns(T.attached_class)
2730
end
@@ -39,7 +42,8 @@ module Orb
3942
override.returns(
4043
{
4144
amount: String,
42-
grouping_values: T::Array[T.any(String, Float, T::Boolean)],
45+
grouping_values:
46+
T::Array[Orb::EvaluatePriceGroup::GroupingValue::Variants],
4347
quantity: Float
4448
}
4549
)

0 commit comments

Comments
 (0)