Skip to content

feat(api): OpenAPI spec update via Stainless API #340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 91
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-67c238400cda65d40994581c7d37ad182a7d737e8abf3accfbc5ac5b04f64f07.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-ad49a3b6fc150ac83a43f43b0b416847bbc36f3b9cb036d61e012ae8b0288c55.yml
24 changes: 24 additions & 0 deletions src/orb/resources/events/backfills.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def create(
timeframe_start: Union[str, datetime],
close_time: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
deprecation_filter: Optional[str] | NotGiven = NOT_GIVEN,
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
replace_existing_events: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -85,6 +86,12 @@ def create(
only affect events for that customer. If neither is specified, the backfill will
affect all customers.

When `replace_existing_events` is `true`, the field `filter` can be optionally
added which enables filtering using
[computed properties](../guides/extensibility/advanced-metrics#computed-properties).
The expressiveness of computed properties allows you to deprecate existing
events based on both a period of time and specific property values.

Args:
timeframe_end: The (exclusive) end of the usage timeframe affected by this backfill.

Expand All @@ -96,6 +103,10 @@ def create(

customer_id: The ID of the customer to which this backfill is scoped.

deprecation_filter: A boolean
[computed property](../guides/extensibility/advanced-metrics#computed-properties)
used to filter the set of events to deprecate

external_customer_id: The external customer ID of the customer to which this backfill is scoped.

replace_existing_events: If true, replaces all existing events in the timeframe with the newly ingested
Expand All @@ -119,6 +130,7 @@ def create(
"timeframe_start": timeframe_start,
"close_time": close_time,
"customer_id": customer_id,
"deprecation_filter": deprecation_filter,
"external_customer_id": external_customer_id,
"replace_existing_events": replace_existing_events,
},
Expand Down Expand Up @@ -329,6 +341,7 @@ async def create(
timeframe_start: Union[str, datetime],
close_time: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
deprecation_filter: Optional[str] | NotGiven = NOT_GIVEN,
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
replace_existing_events: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -370,6 +383,12 @@ async def create(
only affect events for that customer. If neither is specified, the backfill will
affect all customers.

When `replace_existing_events` is `true`, the field `filter` can be optionally
added which enables filtering using
[computed properties](../guides/extensibility/advanced-metrics#computed-properties).
The expressiveness of computed properties allows you to deprecate existing
events based on both a period of time and specific property values.

Args:
timeframe_end: The (exclusive) end of the usage timeframe affected by this backfill.

Expand All @@ -381,6 +400,10 @@ async def create(

customer_id: The ID of the customer to which this backfill is scoped.

deprecation_filter: A boolean
[computed property](../guides/extensibility/advanced-metrics#computed-properties)
used to filter the set of events to deprecate

external_customer_id: The external customer ID of the customer to which this backfill is scoped.

replace_existing_events: If true, replaces all existing events in the timeframe with the newly ingested
Expand All @@ -404,6 +427,7 @@ async def create(
"timeframe_start": timeframe_start,
"close_time": close_time,
"customer_id": customer_id,
"deprecation_filter": deprecation_filter,
"external_customer_id": external_customer_id,
"replace_existing_events": replace_existing_events,
},
Expand Down
8 changes: 4 additions & 4 deletions src/orb/resources/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1437,9 +1437,9 @@ def schedule_plan_change(

Args:
align_billing_with_plan_change_date: [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be
aligned with the plan changes effective date.
aligned with the plan change's effective date.

billing_cycle_alignment: Reset billing periods to be aligned with the plan changes effective date or
billing_cycle_alignment: Reset billing periods to be aligned with the plan change's effective date or
start of the month. Defaults to `unchanged` which keeps subscription's existing
billing cycle alignment.

Expand Down Expand Up @@ -3162,9 +3162,9 @@ async def schedule_plan_change(

Args:
align_billing_with_plan_change_date: [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be
aligned with the plan changes effective date.
aligned with the plan change's effective date.

billing_cycle_alignment: Reset billing periods to be aligned with the plan changes effective date or
billing_cycle_alignment: Reset billing periods to be aligned with the plan change's effective date or
start of the month. Defaults to `unchanged` which keeps subscription's existing
billing cycle alignment.

Expand Down
7 changes: 7 additions & 0 deletions src/orb/types/events/backfill_close_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@ class BackfillCloseResponse(BaseModel):
timeframe_end: datetime

timeframe_start: datetime

deprecation_filter: Optional[str] = None
"""
A boolean
[computed property](../guides/extensibility/advanced-metrics#computed-properties)
used to filter the set of events to deprecate
"""
7 changes: 7 additions & 0 deletions src/orb/types/events/backfill_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ class BackfillCreateParams(TypedDict, total=False):
customer_id: Optional[str]
"""The ID of the customer to which this backfill is scoped."""

deprecation_filter: Optional[str]
"""
A boolean
[computed property](../guides/extensibility/advanced-metrics#computed-properties)
used to filter the set of events to deprecate
"""

external_customer_id: Optional[str]
"""The external customer ID of the customer to which this backfill is scoped."""

Expand Down
7 changes: 7 additions & 0 deletions src/orb/types/events/backfill_create_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@ class BackfillCreateResponse(BaseModel):
timeframe_end: datetime

timeframe_start: datetime

deprecation_filter: Optional[str] = None
"""
A boolean
[computed property](../guides/extensibility/advanced-metrics#computed-properties)
used to filter the set of events to deprecate
"""
7 changes: 7 additions & 0 deletions src/orb/types/events/backfill_fetch_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@ class BackfillFetchResponse(BaseModel):
timeframe_end: datetime

timeframe_start: datetime

deprecation_filter: Optional[str] = None
"""
A boolean
[computed property](../guides/extensibility/advanced-metrics#computed-properties)
used to filter the set of events to deprecate
"""
7 changes: 7 additions & 0 deletions src/orb/types/events/backfill_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@ class BackfillListResponse(BaseModel):
timeframe_end: datetime

timeframe_start: datetime

deprecation_filter: Optional[str] = None
"""
A boolean
[computed property](../guides/extensibility/advanced-metrics#computed-properties)
used to filter the set of events to deprecate
"""
7 changes: 7 additions & 0 deletions src/orb/types/events/backfill_revert_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@ class BackfillRevertResponse(BaseModel):
timeframe_end: datetime

timeframe_start: datetime

deprecation_filter: Optional[str] = None
"""
A boolean
[computed property](../guides/extensibility/advanced-metrics#computed-properties)
used to filter the set of events to deprecate
"""
4 changes: 2 additions & 2 deletions src/orb/types/subscription_schedule_plan_change_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False):
align_billing_with_plan_change_date: Optional[bool]
"""[DEPRECATED] Use billing_cycle_alignment instead.

Reset billing periods to be aligned with the plan changes effective date.
Reset billing periods to be aligned with the plan change's effective date.
"""

billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]]
"""
Reset billing periods to be aligned with the plan changes effective date or
Reset billing periods to be aligned with the plan change's effective date or
start of the month. Defaults to `unchanged` which keeps subscription's existing
billing cycle alignment.
"""
Expand Down
2 changes: 2 additions & 0 deletions tests/api_resources/events/test_backfills.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
timeframe_start=parse_datetime("2019-12-27T18:11:19.117Z"),
close_time=parse_datetime("2019-12-27T18:11:19.117Z"),
customer_id="customer_id",
deprecation_filter="my_numeric_property > 100 AND my_other_property = 'bar'",
external_customer_id="external_customer_id",
replace_existing_events=True,
)
Expand Down Expand Up @@ -237,6 +238,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
timeframe_start=parse_datetime("2019-12-27T18:11:19.117Z"),
close_time=parse_datetime("2019-12-27T18:11:19.117Z"),
customer_id="customer_id",
deprecation_filter="my_numeric_property > 100 AND my_other_property = 'bar'",
external_customer_id="external_customer_id",
replace_existing_events=True,
)
Expand Down