Skip to content

Commit 632a6bd

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#340)
1 parent 77590c3 commit 632a6bd

11 files changed

+75
-7
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 91
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-67c238400cda65d40994581c7d37ad182a7d737e8abf3accfbc5ac5b04f64f07.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-ad49a3b6fc150ac83a43f43b0b416847bbc36f3b9cb036d61e012ae8b0288c55.yml

src/orb/resources/events/backfills.py

+24
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def create(
4444
timeframe_start: Union[str, datetime],
4545
close_time: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
4646
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
47+
deprecation_filter: Optional[str] | NotGiven = NOT_GIVEN,
4748
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
4849
replace_existing_events: bool | NotGiven = NOT_GIVEN,
4950
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -85,6 +86,12 @@ def create(
8586
only affect events for that customer. If neither is specified, the backfill will
8687
affect all customers.
8788
89+
When `replace_existing_events` is `true`, the field `filter` can be optionally
90+
added which enables filtering using
91+
[computed properties](../guides/extensibility/advanced-metrics#computed-properties).
92+
The expressiveness of computed properties allows you to deprecate existing
93+
events based on both a period of time and specific property values.
94+
8895
Args:
8996
timeframe_end: The (exclusive) end of the usage timeframe affected by this backfill.
9097
@@ -96,6 +103,10 @@ def create(
96103
97104
customer_id: The ID of the customer to which this backfill is scoped.
98105
106+
deprecation_filter: A boolean
107+
[computed property](../guides/extensibility/advanced-metrics#computed-properties)
108+
used to filter the set of events to deprecate
109+
99110
external_customer_id: The external customer ID of the customer to which this backfill is scoped.
100111
101112
replace_existing_events: If true, replaces all existing events in the timeframe with the newly ingested
@@ -119,6 +130,7 @@ def create(
119130
"timeframe_start": timeframe_start,
120131
"close_time": close_time,
121132
"customer_id": customer_id,
133+
"deprecation_filter": deprecation_filter,
122134
"external_customer_id": external_customer_id,
123135
"replace_existing_events": replace_existing_events,
124136
},
@@ -329,6 +341,7 @@ async def create(
329341
timeframe_start: Union[str, datetime],
330342
close_time: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
331343
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
344+
deprecation_filter: Optional[str] | NotGiven = NOT_GIVEN,
332345
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
333346
replace_existing_events: bool | NotGiven = NOT_GIVEN,
334347
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -370,6 +383,12 @@ async def create(
370383
only affect events for that customer. If neither is specified, the backfill will
371384
affect all customers.
372385
386+
When `replace_existing_events` is `true`, the field `filter` can be optionally
387+
added which enables filtering using
388+
[computed properties](../guides/extensibility/advanced-metrics#computed-properties).
389+
The expressiveness of computed properties allows you to deprecate existing
390+
events based on both a period of time and specific property values.
391+
373392
Args:
374393
timeframe_end: The (exclusive) end of the usage timeframe affected by this backfill.
375394
@@ -381,6 +400,10 @@ async def create(
381400
382401
customer_id: The ID of the customer to which this backfill is scoped.
383402
403+
deprecation_filter: A boolean
404+
[computed property](../guides/extensibility/advanced-metrics#computed-properties)
405+
used to filter the set of events to deprecate
406+
384407
external_customer_id: The external customer ID of the customer to which this backfill is scoped.
385408
386409
replace_existing_events: If true, replaces all existing events in the timeframe with the newly ingested
@@ -404,6 +427,7 @@ async def create(
404427
"timeframe_start": timeframe_start,
405428
"close_time": close_time,
406429
"customer_id": customer_id,
430+
"deprecation_filter": deprecation_filter,
407431
"external_customer_id": external_customer_id,
408432
"replace_existing_events": replace_existing_events,
409433
},

src/orb/resources/subscriptions.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1437,9 +1437,9 @@ def schedule_plan_change(
14371437
14381438
Args:
14391439
align_billing_with_plan_change_date: [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be
1440-
aligned with the plan changes effective date.
1440+
aligned with the plan change's effective date.
14411441
1442-
billing_cycle_alignment: Reset billing periods to be aligned with the plan changes effective date or
1442+
billing_cycle_alignment: Reset billing periods to be aligned with the plan change's effective date or
14431443
start of the month. Defaults to `unchanged` which keeps subscription's existing
14441444
billing cycle alignment.
14451445
@@ -3162,9 +3162,9 @@ async def schedule_plan_change(
31623162
31633163
Args:
31643164
align_billing_with_plan_change_date: [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be
3165-
aligned with the plan changes effective date.
3165+
aligned with the plan change's effective date.
31663166
3167-
billing_cycle_alignment: Reset billing periods to be aligned with the plan changes effective date or
3167+
billing_cycle_alignment: Reset billing periods to be aligned with the plan change's effective date or
31683168
start of the month. Defaults to `unchanged` which keeps subscription's existing
31693169
billing cycle alignment.
31703170

src/orb/types/events/backfill_close_response.py

+7
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,10 @@ class BackfillCloseResponse(BaseModel):
3838
timeframe_end: datetime
3939

4040
timeframe_start: datetime
41+
42+
deprecation_filter: Optional[str] = None
43+
"""
44+
A boolean
45+
[computed property](../guides/extensibility/advanced-metrics#computed-properties)
46+
used to filter the set of events to deprecate
47+
"""

src/orb/types/events/backfill_create_params.py

+7
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ class BackfillCreateParams(TypedDict, total=False):
2929
customer_id: Optional[str]
3030
"""The ID of the customer to which this backfill is scoped."""
3131

32+
deprecation_filter: Optional[str]
33+
"""
34+
A boolean
35+
[computed property](../guides/extensibility/advanced-metrics#computed-properties)
36+
used to filter the set of events to deprecate
37+
"""
38+
3239
external_customer_id: Optional[str]
3340
"""The external customer ID of the customer to which this backfill is scoped."""
3441

src/orb/types/events/backfill_create_response.py

+7
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,10 @@ class BackfillCreateResponse(BaseModel):
3838
timeframe_end: datetime
3939

4040
timeframe_start: datetime
41+
42+
deprecation_filter: Optional[str] = None
43+
"""
44+
A boolean
45+
[computed property](../guides/extensibility/advanced-metrics#computed-properties)
46+
used to filter the set of events to deprecate
47+
"""

src/orb/types/events/backfill_fetch_response.py

+7
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,10 @@ class BackfillFetchResponse(BaseModel):
3838
timeframe_end: datetime
3939

4040
timeframe_start: datetime
41+
42+
deprecation_filter: Optional[str] = None
43+
"""
44+
A boolean
45+
[computed property](../guides/extensibility/advanced-metrics#computed-properties)
46+
used to filter the set of events to deprecate
47+
"""

src/orb/types/events/backfill_list_response.py

+7
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,10 @@ class BackfillListResponse(BaseModel):
3838
timeframe_end: datetime
3939

4040
timeframe_start: datetime
41+
42+
deprecation_filter: Optional[str] = None
43+
"""
44+
A boolean
45+
[computed property](../guides/extensibility/advanced-metrics#computed-properties)
46+
used to filter the set of events to deprecate
47+
"""

src/orb/types/events/backfill_revert_response.py

+7
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,10 @@ class BackfillRevertResponse(BaseModel):
3838
timeframe_end: datetime
3939

4040
timeframe_start: datetime
41+
42+
deprecation_filter: Optional[str] = None
43+
"""
44+
A boolean
45+
[computed property](../guides/extensibility/advanced-metrics#computed-properties)
46+
used to filter the set of events to deprecate
47+
"""

src/orb/types/subscription_schedule_plan_change_params.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False):
5959
align_billing_with_plan_change_date: Optional[bool]
6060
"""[DEPRECATED] Use billing_cycle_alignment instead.
6161
62-
Reset billing periods to be aligned with the plan changes effective date.
62+
Reset billing periods to be aligned with the plan change's effective date.
6363
"""
6464

6565
billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]]
6666
"""
67-
Reset billing periods to be aligned with the plan changes effective date or
67+
Reset billing periods to be aligned with the plan change's effective date or
6868
start of the month. Defaults to `unchanged` which keeps subscription's existing
6969
billing cycle alignment.
7070
"""

tests/api_resources/events/test_backfills.py

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
4040
timeframe_start=parse_datetime("2019-12-27T18:11:19.117Z"),
4141
close_time=parse_datetime("2019-12-27T18:11:19.117Z"),
4242
customer_id="customer_id",
43+
deprecation_filter="my_numeric_property > 100 AND my_other_property = 'bar'",
4344
external_customer_id="external_customer_id",
4445
replace_existing_events=True,
4546
)
@@ -237,6 +238,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
237238
timeframe_start=parse_datetime("2019-12-27T18:11:19.117Z"),
238239
close_time=parse_datetime("2019-12-27T18:11:19.117Z"),
239240
customer_id="customer_id",
241+
deprecation_filter="my_numeric_property > 100 AND my_other_property = 'bar'",
240242
external_customer_id="external_customer_id",
241243
replace_existing_events=True,
242244
)

0 commit comments

Comments
 (0)