Skip to content

Commit 97803ff

Browse files
feat(api): api update
1 parent e883731 commit 97803ff

File tree

13 files changed

+819
-13
lines changed

13 files changed

+819
-13
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-79664fa0b4ea00c978ae2516087d0ee591b0ef92ca8db29557a0424bde520e10.yml
3-
openapi_spec_hash: 1ff6eee9184312a3a0fd21eb589132f9
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-d1abf71a1a70a43bdcc4da7104dabcbd67aa7e2d3e6cf21e33f50904b6997bb2.yml
3+
openapi_spec_hash: 28b0b31a997588cf3692458889321e1b
44
config_hash: dd4343ce95871032ef6e0735a4ca038c

lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ class LedgerCreateEntryByExternalIDParams < Orb::Internal::Type::BaseModel
4949
# @return [Time, nil]
5050
optional :expiry_date, Time, nil?: true
5151

52+
# @!attribute filters
53+
# Optional filter to specify which items this credit block applies to. If not
54+
# specified, the block will apply to all items for the pricing unit.
55+
#
56+
# @return [Array<Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::Filter>, nil]
57+
optional :filters,
58+
-> {
59+
Orb::Internal::Type::ArrayOf[Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::Filter]
60+
},
61+
nil?: true
62+
5263
# @!attribute invoice_settings
5364
# Passing `invoice_settings` automatically generates an invoice for the newly
5465
# added credits. If `invoice_settings` is passed, you must specify
@@ -97,7 +108,7 @@ class LedgerCreateEntryByExternalIDParams < Orb::Internal::Type::BaseModel
97108
enum: -> { Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::VoidReason },
98109
nil?: true
99110

100-
# @!method initialize(amount:, entry_type:, target_expiry_date:, block_id:, currency: nil, description: nil, effective_date: nil, expiry_date: nil, invoice_settings: nil, metadata: nil, per_unit_cost_basis: nil, void_reason: nil, request_options: {})
111+
# @!method initialize(amount:, entry_type:, target_expiry_date:, block_id:, currency: nil, description: nil, effective_date: nil, expiry_date: nil, filters: nil, invoice_settings: nil, metadata: nil, per_unit_cost_basis: nil, void_reason: nil, request_options: {})
101112
# Some parameter documentations has been truncated, see
102113
# {Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams} for more
103114
# details.
@@ -118,6 +129,8 @@ class LedgerCreateEntryByExternalIDParams < Orb::Internal::Type::BaseModel
118129
#
119130
# @param expiry_date [Time, nil] An ISO 8601 format date that identifies the origination credit block to expire
120131
#
132+
# @param filters [Array<Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::Filter>, nil] Optional filter to specify which items this credit block applies to. If not spec
133+
#
121134
# @param invoice_settings [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings, nil] Passing `invoice_settings` automatically generates an invoice for the newly adde
122135
#
123136
# @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
@@ -137,6 +150,61 @@ module EntryType
137150
# @return [Array<Symbol>]
138151
end
139152

153+
class Filter < Orb::Internal::Type::BaseModel
154+
# @!attribute field
155+
# The property of the price the block applies to. Only item_id is supported.
156+
#
157+
# @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::Filter::Field]
158+
required :field, enum: -> { Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::Filter::Field }
159+
160+
# @!attribute operator
161+
# Should prices that match the filter be included or excluded.
162+
#
163+
# @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::Filter::Operator]
164+
required :operator,
165+
enum: -> { Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::Filter::Operator }
166+
167+
# @!attribute values
168+
# The IDs or values that match this filter.
169+
#
170+
# @return [Array<String>]
171+
required :values, Orb::Internal::Type::ArrayOf[String]
172+
173+
# @!method initialize(field:, operator:, values:)
174+
# A PriceFilter that only allows item_id field for block filters.
175+
#
176+
# @param field [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::Filter::Field] The property of the price the block applies to. Only item_id is supported.
177+
#
178+
# @param operator [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::Filter::Operator] Should prices that match the filter be included or excluded.
179+
#
180+
# @param values [Array<String>] The IDs or values that match this filter.
181+
182+
# The property of the price the block applies to. Only item_id is supported.
183+
#
184+
# @see Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::Filter#field
185+
module Field
186+
extend Orb::Internal::Type::Enum
187+
188+
ITEM_ID = :item_id
189+
190+
# @!method self.values
191+
# @return [Array<Symbol>]
192+
end
193+
194+
# Should prices that match the filter be included or excluded.
195+
#
196+
# @see Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::Filter#operator
197+
module Operator
198+
extend Orb::Internal::Type::Enum
199+
200+
INCLUDES = :includes
201+
EXCLUDES = :excludes
202+
203+
# @!method self.values
204+
# @return [Array<Symbol>]
205+
end
206+
end
207+
140208
class InvoiceSettings < Orb::Internal::Type::BaseModel
141209
# @!attribute auto_collection
142210
# Whether the credits purchase invoice should auto collect with the customer's

lib/orb/models/customers/credits/ledger_create_entry_params.rb

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ class LedgerCreateEntryParams < Orb::Internal::Type::BaseModel
4949
# @return [Time, nil]
5050
optional :expiry_date, Time, nil?: true
5151

52+
# @!attribute filters
53+
# Optional filter to specify which items this credit block applies to. If not
54+
# specified, the block will apply to all items for the pricing unit.
55+
#
56+
# @return [Array<Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter>, nil]
57+
optional :filters,
58+
-> {
59+
Orb::Internal::Type::ArrayOf[Orb::Customers::Credits::LedgerCreateEntryParams::Filter]
60+
},
61+
nil?: true
62+
5263
# @!attribute invoice_settings
5364
# Passing `invoice_settings` automatically generates an invoice for the newly
5465
# added credits. If `invoice_settings` is passed, you must specify
@@ -97,7 +108,7 @@ class LedgerCreateEntryParams < Orb::Internal::Type::BaseModel
97108
enum: -> { Orb::Customers::Credits::LedgerCreateEntryParams::VoidReason },
98109
nil?: true
99110

100-
# @!method initialize(amount:, entry_type:, target_expiry_date:, block_id:, currency: nil, description: nil, effective_date: nil, expiry_date: nil, invoice_settings: nil, metadata: nil, per_unit_cost_basis: nil, void_reason: nil, request_options: {})
111+
# @!method initialize(amount:, entry_type:, target_expiry_date:, block_id:, currency: nil, description: nil, effective_date: nil, expiry_date: nil, filters: nil, invoice_settings: nil, metadata: nil, per_unit_cost_basis: nil, void_reason: nil, request_options: {})
101112
# Some parameter documentations has been truncated, see
102113
# {Orb::Models::Customers::Credits::LedgerCreateEntryParams} for more details.
103114
#
@@ -117,6 +128,8 @@ class LedgerCreateEntryParams < Orb::Internal::Type::BaseModel
117128
#
118129
# @param expiry_date [Time, nil] An ISO 8601 format date that identifies the origination credit block to expire
119130
#
131+
# @param filters [Array<Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter>, nil] Optional filter to specify which items this credit block applies to. If not spec
132+
#
120133
# @param invoice_settings [Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings, nil] Passing `invoice_settings` automatically generates an invoice for the newly adde
121134
#
122135
# @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
@@ -136,6 +149,60 @@ module EntryType
136149
# @return [Array<Symbol>]
137150
end
138151

152+
class Filter < Orb::Internal::Type::BaseModel
153+
# @!attribute field
154+
# The property of the price the block applies to. Only item_id is supported.
155+
#
156+
# @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter::Field]
157+
required :field, enum: -> { Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Field }
158+
159+
# @!attribute operator
160+
# Should prices that match the filter be included or excluded.
161+
#
162+
# @return [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter::Operator]
163+
required :operator, enum: -> { Orb::Customers::Credits::LedgerCreateEntryParams::Filter::Operator }
164+
165+
# @!attribute values
166+
# The IDs or values that match this filter.
167+
#
168+
# @return [Array<String>]
169+
required :values, Orb::Internal::Type::ArrayOf[String]
170+
171+
# @!method initialize(field:, operator:, values:)
172+
# A PriceFilter that only allows item_id field for block filters.
173+
#
174+
# @param field [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter::Field] The property of the price the block applies to. Only item_id is supported.
175+
#
176+
# @param operator [Symbol, Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter::Operator] Should prices that match the filter be included or excluded.
177+
#
178+
# @param values [Array<String>] The IDs or values that match this filter.
179+
180+
# The property of the price the block applies to. Only item_id is supported.
181+
#
182+
# @see Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter#field
183+
module Field
184+
extend Orb::Internal::Type::Enum
185+
186+
ITEM_ID = :item_id
187+
188+
# @!method self.values
189+
# @return [Array<Symbol>]
190+
end
191+
192+
# Should prices that match the filter be included or excluded.
193+
#
194+
# @see Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter#operator
195+
module Operator
196+
extend Orb::Internal::Type::Enum
197+
198+
INCLUDES = :includes
199+
EXCLUDES = :excludes
200+
201+
# @!method self.values
202+
# @return [Array<Symbol>]
203+
end
204+
end
205+
139206
class InvoiceSettings < Orb::Internal::Type::BaseModel
140207
# @!attribute auto_collection
141208
# Whether the credits purchase invoice should auto collect with the customer's

lib/orb/models/new_allocation_price.rb

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ class NewAllocationPrice < Orb::Internal::Type::BaseModel
3535
# @return [Boolean, nil]
3636
optional :expires_at_end_of_cadence, Orb::Internal::Type::Boolean, nil?: true
3737

38-
# @!method initialize(amount:, cadence:, currency:, custom_expiration: nil, expires_at_end_of_cadence: nil)
38+
# @!attribute filters
39+
# The filters that determine which items the allocation applies to.
40+
#
41+
# @return [Array<Orb::Models::NewAllocationPrice::Filter>, nil]
42+
optional :filters, -> { Orb::Internal::Type::ArrayOf[Orb::NewAllocationPrice::Filter] }, nil?: true
43+
44+
# @!method initialize(amount:, cadence:, currency:, custom_expiration: nil, expires_at_end_of_cadence: nil, filters: nil)
3945
# Some parameter documentations has been truncated, see
4046
# {Orb::Models::NewAllocationPrice} for more details.
4147
#
@@ -48,6 +54,8 @@ class NewAllocationPrice < Orb::Internal::Type::BaseModel
4854
# @param custom_expiration [Orb::Models::CustomExpiration, nil] The custom expiration for the allocation.
4955
#
5056
# @param expires_at_end_of_cadence [Boolean, nil] Whether the allocated amount should expire at the end of the cadence or roll ove
57+
#
58+
# @param filters [Array<Orb::Models::NewAllocationPrice::Filter>, nil] The filters that determine which items the allocation applies to.
5159

5260
# The cadence at which to allocate the amount to the customer.
5361
#
@@ -64,6 +72,60 @@ module Cadence
6472
# @!method self.values
6573
# @return [Array<Symbol>]
6674
end
75+
76+
class Filter < Orb::Internal::Type::BaseModel
77+
# @!attribute field
78+
# The property of the price the block applies to. Only item_id is supported.
79+
#
80+
# @return [Symbol, Orb::Models::NewAllocationPrice::Filter::Field]
81+
required :field, enum: -> { Orb::NewAllocationPrice::Filter::Field }
82+
83+
# @!attribute operator
84+
# Should prices that match the filter be included or excluded.
85+
#
86+
# @return [Symbol, Orb::Models::NewAllocationPrice::Filter::Operator]
87+
required :operator, enum: -> { Orb::NewAllocationPrice::Filter::Operator }
88+
89+
# @!attribute values
90+
# The IDs or values that match this filter.
91+
#
92+
# @return [Array<String>]
93+
required :values, Orb::Internal::Type::ArrayOf[String]
94+
95+
# @!method initialize(field:, operator:, values:)
96+
# A PriceFilter that only allows item_id field for block filters.
97+
#
98+
# @param field [Symbol, Orb::Models::NewAllocationPrice::Filter::Field] The property of the price the block applies to. Only item_id is supported.
99+
#
100+
# @param operator [Symbol, Orb::Models::NewAllocationPrice::Filter::Operator] Should prices that match the filter be included or excluded.
101+
#
102+
# @param values [Array<String>] The IDs or values that match this filter.
103+
104+
# The property of the price the block applies to. Only item_id is supported.
105+
#
106+
# @see Orb::Models::NewAllocationPrice::Filter#field
107+
module Field
108+
extend Orb::Internal::Type::Enum
109+
110+
ITEM_ID = :item_id
111+
112+
# @!method self.values
113+
# @return [Array<Symbol>]
114+
end
115+
116+
# Should prices that match the filter be included or excluded.
117+
#
118+
# @see Orb::Models::NewAllocationPrice::Filter#operator
119+
module Operator
120+
extend Orb::Internal::Type::Enum
121+
122+
INCLUDES = :includes
123+
EXCLUDES = :excludes
124+
125+
# @!method self.values
126+
# @return [Array<Symbol>]
127+
end
128+
end
67129
end
68130
end
69131
end

lib/orb/resources/customers/credits/ledger.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def list(customer_id, params = {})
250250
# that was originally decremented from, and `amount` indicates how many credits to
251251
# return to the customer, up to the block's initial balance.
252252
#
253-
# @overload create_entry(customer_id, amount:, entry_type:, target_expiry_date:, block_id:, currency: nil, description: nil, effective_date: nil, expiry_date: nil, invoice_settings: nil, metadata: nil, per_unit_cost_basis: nil, void_reason: nil, request_options: {})
253+
# @overload create_entry(customer_id, amount:, entry_type:, target_expiry_date:, block_id:, currency: nil, description: nil, effective_date: nil, expiry_date: nil, filters: nil, invoice_settings: nil, metadata: nil, per_unit_cost_basis: nil, void_reason: nil, request_options: {})
254254
#
255255
# @param customer_id [String]
256256
#
@@ -270,6 +270,8 @@ def list(customer_id, params = {})
270270
#
271271
# @param expiry_date [Time, nil] An ISO 8601 format date that identifies the origination credit block to expire
272272
#
273+
# @param filters [Array<Orb::Models::Customers::Credits::LedgerCreateEntryParams::Filter>, nil] Optional filter to specify which items this credit block applies to. If not spec
274+
#
273275
# @param invoice_settings [Orb::Models::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings, nil] Passing `invoice_settings` automatically generates an invoice for the newly adde
274276
#
275277
# @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
@@ -409,7 +411,7 @@ def create_entry(customer_id, params)
409411
# that was originally decremented from, and `amount` indicates how many credits to
410412
# return to the customer, up to the block's initial balance.
411413
#
412-
# @overload create_entry_by_external_id(external_customer_id, amount:, entry_type:, target_expiry_date:, block_id:, currency: nil, description: nil, effective_date: nil, expiry_date: nil, invoice_settings: nil, metadata: nil, per_unit_cost_basis: nil, void_reason: nil, request_options: {})
414+
# @overload create_entry_by_external_id(external_customer_id, amount:, entry_type:, target_expiry_date:, block_id:, currency: nil, description: nil, effective_date: nil, expiry_date: nil, filters: nil, invoice_settings: nil, metadata: nil, per_unit_cost_basis: nil, void_reason: nil, request_options: {})
413415
#
414416
# @param external_customer_id [String]
415417
#
@@ -429,6 +431,8 @@ def create_entry(customer_id, params)
429431
#
430432
# @param expiry_date [Time, nil] An ISO 8601 format date that identifies the origination credit block to expire
431433
#
434+
# @param filters [Array<Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::Filter>, nil] Optional filter to specify which items this credit block applies to. If not spec
435+
#
432436
# @param invoice_settings [Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings, nil] Passing `invoice_settings` automatically generates an invoice for the newly adde
433437
#
434438
# @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed

0 commit comments

Comments
 (0)