Skip to content

Commit d2fb2aa

Browse files
feat(api): api update (#474)
1 parent c24985f commit d2fb2aa

File tree

4 files changed

+48
-15
lines changed

4 files changed

+48
-15
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 101
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-c5fe55b056b10d6581c877beb0639a8f0a623e52fd9778e56fab8a86439bd31b.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-52bd3046e73f201c4d08edfa92756791c015be907691a7893f8e7782cc2aea6f.yml

src/orb/resources/events/backfills.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ def create(
9797
only affect events for that customer. If neither is specified, the backfill will
9898
affect all customers.
9999
100-
When `replace_existing_events` is `true`, the field `filter` can be optionally
101-
added which enables filtering using
100+
When `replace_existing_events` is `true`, this indicates that existing events in
101+
the timeframe should no longer be counted towards invoiced usage. In this
102+
scenario, the parameter `filter` can be optionally added which enables filtering
103+
using
102104
[computed properties](../guides/extensibility/advanced-metrics#computed-properties).
103105
The expressiveness of computed properties allows you to deprecate existing
104106
events based on both a period of time and specific property values.
@@ -407,8 +409,10 @@ async def create(
407409
only affect events for that customer. If neither is specified, the backfill will
408410
affect all customers.
409411
410-
When `replace_existing_events` is `true`, the field `filter` can be optionally
411-
added which enables filtering using
412+
When `replace_existing_events` is `true`, this indicates that existing events in
413+
the timeframe should no longer be counted towards invoiced usage. In this
414+
scenario, the parameter `filter` can be optionally added which enables filtering
415+
using
412416
[computed properties](../guides/extensibility/advanced-metrics#computed-properties).
413417
The expressiveness of computed properties allows you to deprecate existing
414418
events based on both a period of time and specific property values.

src/orb/resources/events/events.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ def deprecate(
211211
call to a payment gateway failed and the user should not be billed)
212212
213213
If you want to only change specific properties of an event, but keep the event
214-
as part of the billing calculation, use the [Amend single event](amend-event)
215-
endpoint instead.
214+
as part of the billing calculation, use the [Amend event](amend-event) endpoint
215+
instead.
216216
217217
This API is always audit-safe. The process will still retain the deprecated
218218
event, though it will be ignored for billing calculations. For auditing and data
@@ -760,8 +760,8 @@ async def deprecate(
760760
call to a payment gateway failed and the user should not be billed)
761761
762762
If you want to only change specific properties of an event, but keep the event
763-
as part of the billing calculation, use the [Amend single event](amend-event)
764-
endpoint instead.
763+
as part of the billing calculation, use the [Amend event](amend-event) endpoint
764+
instead.
765765
766766
This API is always audit-safe. The process will still retain the deprecated
767767
event, though it will be ignored for billing calculations. For auditing and data

src/orb/types/alert.py

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,41 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Dict, List, Optional
3+
from typing import List, Optional
44
from datetime import datetime
55
from typing_extensions import Literal
66

77
from .._models import BaseModel
88

9-
__all__ = ["Alert", "Threshold"]
9+
__all__ = ["Alert", "Customer", "Metric", "Plan", "Subscription", "Threshold"]
10+
11+
12+
class Customer(BaseModel):
13+
id: str
14+
15+
external_customer_id: Optional[str] = None
16+
17+
18+
class Metric(BaseModel):
19+
id: str
20+
21+
22+
class Plan(BaseModel):
23+
id: Optional[str] = None
24+
25+
external_plan_id: Optional[str] = None
26+
"""
27+
An optional user-defined ID for this plan resource, used throughout the system
28+
as an alias for this Plan. Use this field to identify a plan by an existing
29+
identifier in your system.
30+
"""
31+
32+
name: Optional[str] = None
33+
34+
plan_version: str
35+
36+
37+
class Subscription(BaseModel):
38+
id: str
1039

1140

1241
class Threshold(BaseModel):
@@ -28,19 +57,19 @@ class Alert(BaseModel):
2857
currency: Optional[str] = None
2958
"""The name of the currency the credit balance or invoice cost is denominated in."""
3059

31-
customer: Optional[Dict[str, Optional[str]]] = None
60+
customer: Optional[Customer] = None
3261
"""The customer the alert applies to."""
3362

3463
enabled: bool
3564
"""Whether the alert is enabled or disabled."""
3665

37-
metric: Optional[Dict[str, Optional[str]]] = None
66+
metric: Optional[Metric] = None
3867
"""The metric the alert applies to."""
3968

40-
plan: Optional[Dict[str, Optional[str]]] = None
69+
plan: Optional[Plan] = None
4170
"""The plan the alert applies to."""
4271

43-
subscription: Optional[Dict[str, Optional[str]]] = None
72+
subscription: Optional[Subscription] = None
4473
"""The subscription the alert applies to."""
4574

4675
thresholds: Optional[List[Threshold]] = None

0 commit comments

Comments
 (0)