Skip to content
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: 101
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-c5fe55b056b10d6581c877beb0639a8f0a623e52fd9778e56fab8a86439bd31b.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-52bd3046e73f201c4d08edfa92756791c015be907691a7893f8e7782cc2aea6f.yml
12 changes: 8 additions & 4 deletions src/orb/resources/events/backfills.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ 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
When `replace_existing_events` is `true`, this indicates that existing events in
the timeframe should no longer be counted towards invoiced usage. In this
scenario, the parameter `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.
Expand Down Expand Up @@ -407,8 +409,10 @@ 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
When `replace_existing_events` is `true`, this indicates that existing events in
the timeframe should no longer be counted towards invoiced usage. In this
scenario, the parameter `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.
Expand Down
8 changes: 4 additions & 4 deletions src/orb/resources/events/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ def deprecate(
call to a payment gateway failed and the user should not be billed)

If you want to only change specific properties of an event, but keep the event
as part of the billing calculation, use the [Amend single event](amend-event)
endpoint instead.
as part of the billing calculation, use the [Amend event](amend-event) endpoint
instead.

This API is always audit-safe. The process will still retain the deprecated
event, though it will be ignored for billing calculations. For auditing and data
Expand Down Expand Up @@ -760,8 +760,8 @@ async def deprecate(
call to a payment gateway failed and the user should not be billed)

If you want to only change specific properties of an event, but keep the event
as part of the billing calculation, use the [Amend single event](amend-event)
endpoint instead.
as part of the billing calculation, use the [Amend event](amend-event) endpoint
instead.

This API is always audit-safe. The process will still retain the deprecated
event, though it will be ignored for billing calculations. For auditing and data
Expand Down
41 changes: 35 additions & 6 deletions src/orb/types/alert.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,41 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Dict, List, Optional
from typing import List, Optional
from datetime import datetime
from typing_extensions import Literal

from .._models import BaseModel

__all__ = ["Alert", "Threshold"]
__all__ = ["Alert", "Customer", "Metric", "Plan", "Subscription", "Threshold"]


class Customer(BaseModel):
id: str

external_customer_id: Optional[str] = None


class Metric(BaseModel):
id: str


class Plan(BaseModel):
id: Optional[str] = None

external_plan_id: Optional[str] = None
"""
An optional user-defined ID for this plan resource, used throughout the system
as an alias for this Plan. Use this field to identify a plan by an existing
identifier in your system.
"""

name: Optional[str] = None

plan_version: str


class Subscription(BaseModel):
id: str


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

customer: Optional[Dict[str, Optional[str]]] = None
customer: Optional[Customer] = None
"""The customer the alert applies to."""

enabled: bool
"""Whether the alert is enabled or disabled."""

metric: Optional[Dict[str, Optional[str]]] = None
metric: Optional[Metric] = None
"""The metric the alert applies to."""

plan: Optional[Dict[str, Optional[str]]] = None
plan: Optional[Plan] = None
"""The plan the alert applies to."""

subscription: Optional[Dict[str, Optional[str]]] = None
subscription: Optional[Subscription] = None
"""The subscription the alert applies to."""

thresholds: Optional[List[Threshold]] = None
Expand Down