Skip to content

Commit 74ed000

Browse files
feat(api): api update
1 parent 183af0e commit 74ed000

29 files changed

Lines changed: 39364 additions & 13078 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 115
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-baf431485e9392b6fbff7c2f4d53d0dc3d1e49e2bec417501c924231c95dc09d.yml
3-
openapi_spec_hash: f80f4798ac7266ef21a9c069ccfef259
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-fee4c7438579fd72ae7c08ad11cc502da279ad3cccfe2235b18afcacc91ad0d9.yml
3+
openapi_spec_hash: dc9d553a388715ba22d873aee54a3ed1
44
config_hash: 1e2186b09e57d7d27b6ab5c8e6410b31

lib/orb/internal/type/union.rb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,16 @@ module Type
2424
# discount_type: :percentage,
2525
# percentage_discount: percentage_discount,
2626
# applies_to_price_ids: applies_to_price_ids,
27-
# reason: reason
27+
# filters: filters
2828
# }
2929
# puts(percentage_discount)
30-
# in {
31-
# discount_type: :trial,
32-
# applies_to_price_ids: applies_to_price_ids,
33-
# reason: reason,
34-
# trial_amount_discount: trial_amount_discount
35-
# }
30+
# in {discount_type: :trial, applies_to_price_ids: applies_to_price_ids, filters: filters, reason: reason}
3631
# puts(applies_to_price_ids)
3732
# in {
3833
# discount_type: :usage,
3934
# usage_discount: usage_discount,
4035
# applies_to_price_ids: applies_to_price_ids,
41-
# reason: reason
36+
# filters: filters
4237
# }
4338
# puts(usage_discount)
4439
# else

lib/orb/models/amount_discount.rb

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,18 @@ class AmountDiscount < Orb::Internal::Type::BaseModel
2121
# @return [Array<String>, nil]
2222
optional :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String], nil?: true
2323

24+
# @!attribute filters
25+
# The filters that determine which prices to apply this discount to.
26+
#
27+
# @return [Array<Orb::Models::AmountDiscount::Filter>, nil]
28+
optional :filters, -> { Orb::Internal::Type::ArrayOf[Orb::AmountDiscount::Filter] }, nil?: true
29+
2430
# @!attribute reason
2531
#
2632
# @return [String, nil]
2733
optional :reason, String, nil?: true
2834

29-
# @!method initialize(amount_discount:, discount_type:, applies_to_price_ids: nil, reason: nil)
35+
# @!method initialize(amount_discount:, discount_type:, applies_to_price_ids: nil, filters: nil, reason: nil)
3036
# Some parameter documentations has been truncated, see
3137
# {Orb::Models::AmountDiscount} for more details.
3238
#
@@ -36,6 +42,8 @@ class AmountDiscount < Orb::Internal::Type::BaseModel
3642
#
3743
# @param applies_to_price_ids [Array<String>, nil] List of price_ids that this discount applies to. For plan/plan phase discounts,
3844
#
45+
# @param filters [Array<Orb::Models::AmountDiscount::Filter>, nil] The filters that determine which prices to apply this discount to.
46+
#
3947
# @param reason [String, nil]
4048

4149
# @see Orb::Models::AmountDiscount#discount_type
@@ -47,6 +55,62 @@ module DiscountType
4755
# @!method self.values
4856
# @return [Array<Symbol>]
4957
end
58+
59+
class Filter < Orb::Internal::Type::BaseModel
60+
# @!attribute field
61+
# The property of the price to filter on.
62+
#
63+
# @return [Symbol, Orb::Models::AmountDiscount::Filter::Field]
64+
required :field, enum: -> { Orb::AmountDiscount::Filter::Field }
65+
66+
# @!attribute operator
67+
# Should prices that match the filter be included or excluded.
68+
#
69+
# @return [Symbol, Orb::Models::AmountDiscount::Filter::Operator]
70+
required :operator, enum: -> { Orb::AmountDiscount::Filter::Operator }
71+
72+
# @!attribute values
73+
# The IDs or values that match this filter.
74+
#
75+
# @return [Array<String>]
76+
required :values, Orb::Internal::Type::ArrayOf[String]
77+
78+
# @!method initialize(field:, operator:, values:)
79+
# @param field [Symbol, Orb::Models::AmountDiscount::Filter::Field] The property of the price to filter on.
80+
#
81+
# @param operator [Symbol, Orb::Models::AmountDiscount::Filter::Operator] Should prices that match the filter be included or excluded.
82+
#
83+
# @param values [Array<String>] The IDs or values that match this filter.
84+
85+
# The property of the price to filter on.
86+
#
87+
# @see Orb::Models::AmountDiscount::Filter#field
88+
module Field
89+
extend Orb::Internal::Type::Enum
90+
91+
PRICE_ID = :price_id
92+
ITEM_ID = :item_id
93+
PRICE_TYPE = :price_type
94+
CURRENCY = :currency
95+
PRICING_UNIT_ID = :pricing_unit_id
96+
97+
# @!method self.values
98+
# @return [Array<Symbol>]
99+
end
100+
101+
# Should prices that match the filter be included or excluded.
102+
#
103+
# @see Orb::Models::AmountDiscount::Filter#operator
104+
module Operator
105+
extend Orb::Internal::Type::Enum
106+
107+
INCLUDES = :includes
108+
EXCLUDES = :excludes
109+
110+
# @!method self.values
111+
# @return [Array<Symbol>]
112+
end
113+
end
50114
end
51115
end
52116
end

0 commit comments

Comments
 (0)