Skip to content

Commit be6584b

Browse files
feat(api): api update (#440)
1 parent ccc1c4e commit be6584b

File tree

5 files changed

+49
-1
lines changed

5 files changed

+49
-1
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 97
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0f43f737c6520ed2a2407628511350362959997f89a868c50aa38d47d5791171.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-40a4e23dd482299a046fb62fd2b5a1e03d455156cb8cd4573e92e4132d74b243.yml

src/orb/resources/subscriptions.py

+28
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def create(
9595
external_marketplace: Optional[Literal["google", "aws", "azure"]] | NotGiven = NOT_GIVEN,
9696
external_marketplace_reporting_id: Optional[str] | NotGiven = NOT_GIVEN,
9797
external_plan_id: Optional[str] | NotGiven = NOT_GIVEN,
98+
filter: Optional[str] | NotGiven = NOT_GIVEN,
9899
initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN,
99100
invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN,
100101
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
@@ -395,6 +396,11 @@ def create(
395396
external_plan_id: The external_plan_id of the plan that the given subscription should be switched
396397
to. Note that either this property or `plan_id` must be specified.
397398
399+
filter: An additional filter to apply to usage queries. This filter must be expressed as
400+
a boolean
401+
[computed property](../guides/extensibility/advanced-metrics#computed-properties).
402+
If null, usage queries will not include any additional filter.
403+
398404
initial_phase_order: The phase of the plan to start with
399405
400406
invoicing_threshold: When this subscription's accrued usage reaches this threshold, an invoice will
@@ -463,6 +469,7 @@ def create(
463469
"external_marketplace": external_marketplace,
464470
"external_marketplace_reporting_id": external_marketplace_reporting_id,
465471
"external_plan_id": external_plan_id,
472+
"filter": filter,
466473
"initial_phase_order": initial_phase_order,
467474
"invoicing_threshold": invoicing_threshold,
468475
"metadata": metadata,
@@ -1345,6 +1352,7 @@ def schedule_plan_change(
13451352
credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN,
13461353
default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN,
13471354
external_plan_id: Optional[str] | NotGiven = NOT_GIVEN,
1355+
filter: Optional[str] | NotGiven = NOT_GIVEN,
13481356
initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN,
13491357
invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN,
13501358
net_terms: Optional[int] | NotGiven = NOT_GIVEN,
@@ -1582,6 +1590,11 @@ def schedule_plan_change(
15821590
external_plan_id: The external_plan_id of the plan that the given subscription should be switched
15831591
to. Note that either this property or `plan_id` must be specified.
15841592
1593+
filter: An additional filter to apply to usage queries. This filter must be expressed as
1594+
a boolean
1595+
[computed property](../guides/extensibility/advanced-metrics#computed-properties).
1596+
If null, usage queries will not include any additional filter.
1597+
15851598
initial_phase_order: The phase of the plan to start with
15861599
15871600
invoicing_threshold: When this subscription's accrued usage reaches this threshold, an invoice will
@@ -1645,6 +1658,7 @@ def schedule_plan_change(
16451658
"credits_overage_rate": credits_overage_rate,
16461659
"default_invoice_memo": default_invoice_memo,
16471660
"external_plan_id": external_plan_id,
1661+
"filter": filter,
16481662
"initial_phase_order": initial_phase_order,
16491663
"invoicing_threshold": invoicing_threshold,
16501664
"net_terms": net_terms,
@@ -2044,6 +2058,7 @@ async def create(
20442058
external_marketplace: Optional[Literal["google", "aws", "azure"]] | NotGiven = NOT_GIVEN,
20452059
external_marketplace_reporting_id: Optional[str] | NotGiven = NOT_GIVEN,
20462060
external_plan_id: Optional[str] | NotGiven = NOT_GIVEN,
2061+
filter: Optional[str] | NotGiven = NOT_GIVEN,
20472062
initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN,
20482063
invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN,
20492064
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
@@ -2344,6 +2359,11 @@ async def create(
23442359
external_plan_id: The external_plan_id of the plan that the given subscription should be switched
23452360
to. Note that either this property or `plan_id` must be specified.
23462361
2362+
filter: An additional filter to apply to usage queries. This filter must be expressed as
2363+
a boolean
2364+
[computed property](../guides/extensibility/advanced-metrics#computed-properties).
2365+
If null, usage queries will not include any additional filter.
2366+
23472367
initial_phase_order: The phase of the plan to start with
23482368
23492369
invoicing_threshold: When this subscription's accrued usage reaches this threshold, an invoice will
@@ -2412,6 +2432,7 @@ async def create(
24122432
"external_marketplace": external_marketplace,
24132433
"external_marketplace_reporting_id": external_marketplace_reporting_id,
24142434
"external_plan_id": external_plan_id,
2435+
"filter": filter,
24152436
"initial_phase_order": initial_phase_order,
24162437
"invoicing_threshold": invoicing_threshold,
24172438
"metadata": metadata,
@@ -3294,6 +3315,7 @@ async def schedule_plan_change(
32943315
credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN,
32953316
default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN,
32963317
external_plan_id: Optional[str] | NotGiven = NOT_GIVEN,
3318+
filter: Optional[str] | NotGiven = NOT_GIVEN,
32973319
initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN,
32983320
invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN,
32993321
net_terms: Optional[int] | NotGiven = NOT_GIVEN,
@@ -3531,6 +3553,11 @@ async def schedule_plan_change(
35313553
external_plan_id: The external_plan_id of the plan that the given subscription should be switched
35323554
to. Note that either this property or `plan_id` must be specified.
35333555
3556+
filter: An additional filter to apply to usage queries. This filter must be expressed as
3557+
a boolean
3558+
[computed property](../guides/extensibility/advanced-metrics#computed-properties).
3559+
If null, usage queries will not include any additional filter.
3560+
35343561
initial_phase_order: The phase of the plan to start with
35353562
35363563
invoicing_threshold: When this subscription's accrued usage reaches this threshold, an invoice will
@@ -3594,6 +3621,7 @@ async def schedule_plan_change(
35943621
"credits_overage_rate": credits_overage_rate,
35953622
"default_invoice_memo": default_invoice_memo,
35963623
"external_plan_id": external_plan_id,
3624+
"filter": filter,
35973625
"initial_phase_order": initial_phase_order,
35983626
"invoicing_threshold": invoicing_threshold,
35993627
"net_terms": net_terms,

src/orb/types/subscription_create_params.py

+8
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,14 @@ class SubscriptionCreateParams(TypedDict, total=False):
228228
to. Note that either this property or `plan_id` must be specified.
229229
"""
230230

231+
filter: Optional[str]
232+
"""An additional filter to apply to usage queries.
233+
234+
This filter must be expressed as a boolean
235+
[computed property](../guides/extensibility/advanced-metrics#computed-properties).
236+
If null, usage queries will not include any additional filter.
237+
"""
238+
231239
initial_phase_order: Optional[int]
232240
"""The phase of the plan to start with"""
233241

src/orb/types/subscription_schedule_plan_change_params.py

+8
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,14 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False):
235235
to. Note that either this property or `plan_id` must be specified.
236236
"""
237237

238+
filter: Optional[str]
239+
"""An additional filter to apply to usage queries.
240+
241+
This filter must be expressed as a boolean
242+
[computed property](../guides/extensibility/advanced-metrics#computed-properties).
243+
If null, usage queries will not include any additional filter.
244+
"""
245+
238246
initial_phase_order: Optional[int]
239247
"""The phase of the plan to start with"""
240248

tests/api_resources/test_subscriptions.py

+4
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
114114
external_marketplace="google",
115115
external_marketplace_reporting_id="external_marketplace_reporting_id",
116116
external_plan_id="ZMwNQefe7J3ecf7W",
117+
filter="my_property > 100 AND my_other_property = 'bar'",
117118
initial_phase_order=2,
118119
invoicing_threshold="10.00",
119120
metadata={"foo": "string"},
@@ -759,6 +760,7 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None:
759760
credits_overage_rate=0,
760761
default_invoice_memo="default_invoice_memo",
761762
external_plan_id="ZMwNQefe7J3ecf7W",
763+
filter="my_property > 100 AND my_other_property = 'bar'",
762764
initial_phase_order=2,
763765
invoicing_threshold="10.00",
764766
net_terms=0,
@@ -1219,6 +1221,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
12191221
external_marketplace="google",
12201222
external_marketplace_reporting_id="external_marketplace_reporting_id",
12211223
external_plan_id="ZMwNQefe7J3ecf7W",
1224+
filter="my_property > 100 AND my_other_property = 'bar'",
12221225
initial_phase_order=2,
12231226
invoicing_threshold="10.00",
12241227
metadata={"foo": "string"},
@@ -1864,6 +1867,7 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A
18641867
credits_overage_rate=0,
18651868
default_invoice_memo="default_invoice_memo",
18661869
external_plan_id="ZMwNQefe7J3ecf7W",
1870+
filter="my_property > 100 AND my_other_property = 'bar'",
18671871
initial_phase_order=2,
18681872
invoicing_threshold="10.00",
18691873
net_terms=0,

0 commit comments

Comments
 (0)