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 .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.46.1"
".": "4.46.2"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 4.46.2 (2025-12-09)

Full Changelog: [v4.46.1...v4.46.2](https://github.com/orbcorp/orb-python/compare/v4.46.1...v4.46.2)

### Chores

* add missing docstrings ([073bfcb](https://github.com/orbcorp/orb-python/commit/073bfcb247316e483dc732908e7c0ab0d42a3551))

## 4.46.1 (2025-12-08)

Full Changelog: [v4.46.0...v4.46.1](https://github.com/orbcorp/orb-python/compare/v4.46.0...v4.46.1)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "orb-billing"
version = "4.46.1"
version = "4.46.2"
description = "The official Python library for the orb API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/orb/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "orb"
__version__ = "4.46.1" # x-release-please-version
__version__ = "4.46.2" # x-release-please-version
12 changes: 10 additions & 2 deletions src/orb/resources/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ def verify_signature(
now = datetime.now(tz=timezone.utc)

try:
timestamp = datetime.fromisoformat(msg_timestamp).astimezone()
timestamp = datetime.fromisoformat(msg_timestamp)
# If the timestamp doesn't have timezone info, assume it's UTC
if timestamp.tzinfo is None:
timestamp = timestamp.replace(tzinfo=timezone.utc)
timestamp = timestamp.astimezone()
except Exception as err:
raise ValueError("Invalid signature headers. Could not convert to timestamp") from err

Expand Down Expand Up @@ -140,7 +144,11 @@ def verify_signature(
now = datetime.now(tz=timezone.utc)

try:
timestamp = datetime.fromisoformat(msg_timestamp).astimezone()
timestamp = datetime.fromisoformat(msg_timestamp)
# If the timestamp doesn't have timezone info, assume it's UTC
if timestamp.tzinfo is None:
timestamp = timestamp.replace(tzinfo=timezone.utc)
timestamp = timestamp.astimezone()
except Exception as err:
raise ValueError("Invalid signature headers. Could not convert to timestamp") from err

Expand Down
13 changes: 13 additions & 0 deletions src/orb/types/alert.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@


class Metric(BaseModel):
"""The metric the alert applies to."""

id: str


class Plan(BaseModel):
"""The plan the alert applies to."""

id: Optional[str] = None

external_plan_id: Optional[str] = None
Expand All @@ -32,6 +36,8 @@ class Plan(BaseModel):


class BalanceAlertStatus(BaseModel):
"""Alert status is used to determine if an alert is currently in-alert or not."""

in_alert: bool
"""Whether the alert is currently in-alert or not."""

Expand All @@ -40,6 +46,13 @@ class BalanceAlertStatus(BaseModel):


class Alert(BaseModel):
"""
[Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
usage, or credit balance and trigger webhooks when a threshold is exceeded.

Alerts created through the API can be scoped to either customers or subscriptions.
"""

id: str
"""Also referred to as alert_id in this documentation."""

Expand Down
36 changes: 36 additions & 0 deletions src/orb/types/beta/external_plan_id_create_plan_version_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ class AddAdjustment(TypedDict, total=False):


class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False):
"""Configuration for a single property filter"""

property_key: Required[str]
"""Event property key to filter on"""

Expand All @@ -148,6 +150,8 @@ class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedD


class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False):
"""Configuration for a single bulk pricing tier"""

unit_amount: Required[str]
"""Amount per unit"""

Expand All @@ -156,6 +160,8 @@ class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDic


class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False):
"""Configuration for bulk_with_filters pricing"""

filters: Required[Iterable[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter]]
"""Property filters to apply (all must match)"""

Expand Down Expand Up @@ -250,6 +256,8 @@ class AddPricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False):


class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False):
"""Configuration for a single tiered with proration tier"""

tier_lower_bound: Required[str]
"""Inclusive tier starting value"""

Expand All @@ -258,6 +266,8 @@ class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(


class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False):
"""Configuration for tiered_with_proration pricing"""

tiers: Required[Iterable[AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier]]
"""
Tiers for rating based on total usage quantities into the specified tier with
Expand Down Expand Up @@ -352,6 +362,8 @@ class AddPricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False):


class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False):
"""Configuration for grouped_with_min_max_thresholds pricing"""

grouping_key: Required[str]
"""The event property used to group before applying thresholds"""

Expand Down Expand Up @@ -454,6 +466,8 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals


class AddPricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False):
"""Configuration for cumulative_grouped_allocation pricing"""

cumulative_allocation: Required[str]
"""The overall allocation across all groups"""

Expand Down Expand Up @@ -556,6 +570,8 @@ class AddPricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=Fals


class AddPricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False):
"""Configuration for percent pricing"""

percent: Required[float]
"""What percent of the component subtotals to charge"""

Expand Down Expand Up @@ -647,6 +663,8 @@ class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False):


class AddPricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False):
"""Configuration for event_output pricing"""

unit_rating_key: Required[str]
"""The key in the event data to extract the unit rate from."""

Expand Down Expand Up @@ -829,6 +847,8 @@ class ReplaceAdjustment(TypedDict, total=False):


class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False):
"""Configuration for a single property filter"""

property_key: Required[str]
"""Event property key to filter on"""

Expand All @@ -837,6 +857,8 @@ class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(Ty


class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False):
"""Configuration for a single bulk pricing tier"""

unit_amount: Required[str]
"""Amount per unit"""

Expand All @@ -845,6 +867,8 @@ class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(Type


class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False):
"""Configuration for bulk_with_filters pricing"""

filters: Required[Iterable[ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter]]
"""Property filters to apply (all must match)"""

Expand Down Expand Up @@ -939,6 +963,8 @@ class ReplacePricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False):


class ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False):
"""Configuration for a single tiered with proration tier"""

tier_lower_bound: Required[str]
"""Inclusive tier starting value"""

Expand All @@ -947,6 +973,8 @@ class ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigT


class ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False):
"""Configuration for tiered_with_proration pricing"""

tiers: Required[Iterable[ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier]]
"""
Tiers for rating based on total usage quantities into the specified tier with
Expand Down Expand Up @@ -1041,6 +1069,8 @@ class ReplacePricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False):


class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False):
"""Configuration for grouped_with_min_max_thresholds pricing"""

grouping_key: Required[str]
"""The event property used to group before applying thresholds"""

Expand Down Expand Up @@ -1143,6 +1173,8 @@ class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=


class ReplacePricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False):
"""Configuration for cumulative_grouped_allocation pricing"""

cumulative_allocation: Required[str]
"""The overall allocation across all groups"""

Expand Down Expand Up @@ -1245,6 +1277,8 @@ class ReplacePricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=


class ReplacePricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False):
"""Configuration for percent pricing"""

percent: Required[float]
"""What percent of the component subtotals to charge"""

Expand Down Expand Up @@ -1336,6 +1370,8 @@ class ReplacePricePriceNewPlanPercentCompositePrice(TypedDict, total=False):


class ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False):
"""Configuration for event_output pricing"""

unit_rating_key: Required[str]
"""The key in the event data to extract the unit rate from."""

Expand Down
Loading