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 @@
{
".": "3.18.2"
".": "3.19.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 103
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-95a3d7780935a38e0cf076d4ad2d68bd1a5641bced8398d972db2e92751d364a.yml
openapi_spec_hash: 9ebe818c4ad4f2d9c4e473b5192d7544
config_hash: 54edf41f0377bc235f622fdaa7405f22
configured_endpoints: 106
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-e8dad7eee5621fe2ba948dfd00dabf170d9d92ce615a9f04b0f546f4d8bf39ba.yml
openapi_spec_hash: 3f6a98e3a1b3a47acebd67a960090ebf
config_hash: 7e523cf79552b8936bd772f2e1025e5f
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 3.19.0 (2025-04-08)

Full Changelog: [v3.18.2...v3.19.0](https://github.com/orbcorp/orb-python/compare/v3.18.2...v3.19.0)

### Features

* **api:** api update ([#614](https://github.com/orbcorp/orb-python/issues/614)) ([900d258](https://github.com/orbcorp/orb-python/commit/900d258b7af45e1c777b20b561373b9438e42abb))


### Chores

* **internal:** slight transform perf improvement ([#616](https://github.com/orbcorp/orb-python/issues/616)) ([de565f2](https://github.com/orbcorp/orb-python/commit/de565f252353fa7f951ad8cc10574f82919e35aa))
* **tests:** improve enum examples ([#617](https://github.com/orbcorp/orb-python/issues/617)) ([a0d4366](https://github.com/orbcorp/orb-python/commit/a0d4366a82d86555d6ac41a912ce22414b74dd50))

## 3.18.2 (2025-04-07)

Full Changelog: [v3.18.1...v3.18.2](https://github.com/orbcorp/orb-python/compare/v3.18.1...v3.18.2)
Expand Down
18 changes: 18 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,3 +410,21 @@ Methods:
Methods:

- <code title="get /dimensional_price_groups/external_dimensional_price_group_id/{external_dimensional_price_group_id}">client.dimensional_price_groups.external_dimensional_price_group_id.<a href="./src/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.py">retrieve</a>(external_dimensional_price_group_id) -> <a href="./src/orb/types/dimensional_price_group.py">DimensionalPriceGroup</a></code>

# SubscriptionChanges

Types:

```python
from orb.types import (
SubscriptionChangeRetrieveResponse,
SubscriptionChangeApplyResponse,
SubscriptionChangeCancelResponse,
)
```

Methods:

- <code title="get /subscription_changes/{subscription_change_id}">client.subscription_changes.<a href="./src/orb/resources/subscription_changes.py">retrieve</a>(subscription_change_id) -> <a href="./src/orb/types/subscription_change_retrieve_response.py">SubscriptionChangeRetrieveResponse</a></code>
- <code title="post /subscription_changes/{subscription_change_id}/apply">client.subscription_changes.<a href="./src/orb/resources/subscription_changes.py">apply</a>(subscription_change_id, \*\*<a href="src/orb/types/subscription_change_apply_params.py">params</a>) -> <a href="./src/orb/types/subscription_change_apply_response.py">SubscriptionChangeApplyResponse</a></code>
- <code title="post /subscription_changes/{subscription_change_id}/cancel">client.subscription_changes.<a href="./src/orb/resources/subscription_changes.py">cancel</a>(subscription_change_id) -> <a href="./src/orb/types/subscription_change_cancel_response.py">SubscriptionChangeCancelResponse</a></code>
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 = "3.18.2"
version = "3.19.0"
description = "The official Python library for the orb API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
15 changes: 15 additions & 0 deletions src/orb/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
credit_notes,
subscriptions,
invoice_line_items,
subscription_changes,
)
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import OrbError, APIStatusError
Expand Down Expand Up @@ -69,6 +70,7 @@ class Orb(SyncAPIClient):
webhooks: webhooks.Webhooks
alerts: alerts.Alerts
dimensional_price_groups: dimensional_price_groups.DimensionalPriceGroups
subscription_changes: subscription_changes.SubscriptionChanges
with_raw_response: OrbWithRawResponse
with_streaming_response: OrbWithStreamedResponse

Expand Down Expand Up @@ -151,6 +153,7 @@ def __init__(
self.webhooks = webhooks.Webhooks(self)
self.alerts = alerts.Alerts(self)
self.dimensional_price_groups = dimensional_price_groups.DimensionalPriceGroups(self)
self.subscription_changes = subscription_changes.SubscriptionChanges(self)
self.with_raw_response = OrbWithRawResponse(self)
self.with_streaming_response = OrbWithStreamedResponse(self)

Expand Down Expand Up @@ -325,6 +328,7 @@ class AsyncOrb(AsyncAPIClient):
webhooks: webhooks.AsyncWebhooks
alerts: alerts.AsyncAlerts
dimensional_price_groups: dimensional_price_groups.AsyncDimensionalPriceGroups
subscription_changes: subscription_changes.AsyncSubscriptionChanges
with_raw_response: AsyncOrbWithRawResponse
with_streaming_response: AsyncOrbWithStreamedResponse

Expand Down Expand Up @@ -407,6 +411,7 @@ def __init__(
self.webhooks = webhooks.AsyncWebhooks(self)
self.alerts = alerts.AsyncAlerts(self)
self.dimensional_price_groups = dimensional_price_groups.AsyncDimensionalPriceGroups(self)
self.subscription_changes = subscription_changes.AsyncSubscriptionChanges(self)
self.with_raw_response = AsyncOrbWithRawResponse(self)
self.with_streaming_response = AsyncOrbWithStreamedResponse(self)

Expand Down Expand Up @@ -583,6 +588,7 @@ def __init__(self, client: Orb) -> None:
self.dimensional_price_groups = dimensional_price_groups.DimensionalPriceGroupsWithRawResponse(
client.dimensional_price_groups
)
self.subscription_changes = subscription_changes.SubscriptionChangesWithRawResponse(client.subscription_changes)


class AsyncOrbWithRawResponse:
Expand All @@ -603,6 +609,9 @@ def __init__(self, client: AsyncOrb) -> None:
self.dimensional_price_groups = dimensional_price_groups.AsyncDimensionalPriceGroupsWithRawResponse(
client.dimensional_price_groups
)
self.subscription_changes = subscription_changes.AsyncSubscriptionChangesWithRawResponse(
client.subscription_changes
)


class OrbWithStreamedResponse:
Expand All @@ -623,6 +632,9 @@ def __init__(self, client: Orb) -> None:
self.dimensional_price_groups = dimensional_price_groups.DimensionalPriceGroupsWithStreamingResponse(
client.dimensional_price_groups
)
self.subscription_changes = subscription_changes.SubscriptionChangesWithStreamingResponse(
client.subscription_changes
)


class AsyncOrbWithStreamedResponse:
Expand All @@ -645,6 +657,9 @@ def __init__(self, client: AsyncOrb) -> None:
self.dimensional_price_groups = dimensional_price_groups.AsyncDimensionalPriceGroupsWithStreamingResponse(
client.dimensional_price_groups
)
self.subscription_changes = subscription_changes.AsyncSubscriptionChangesWithStreamingResponse(
client.subscription_changes
)


Client = Orb
Expand Down
22 changes: 22 additions & 0 deletions src/orb/_utils/_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ def _maybe_transform_key(key: str, type_: type) -> str:
return key


def _no_transform_needed(annotation: type) -> bool:
return annotation == float or annotation == int


def _transform_recursive(
data: object,
*,
Expand Down Expand Up @@ -184,6 +188,15 @@ def _transform_recursive(
return cast(object, data)

inner_type = extract_type_arg(stripped_type, 0)
if _no_transform_needed(inner_type):
# for some types there is no need to transform anything, so we can get a small
# perf boost from skipping that work.
#
# but we still need to convert to a list to ensure the data is json-serializable
if is_list(data):
return data
return list(data)

return [_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]

if is_union_type(stripped_type):
Expand Down Expand Up @@ -332,6 +345,15 @@ async def _async_transform_recursive(
return cast(object, data)

inner_type = extract_type_arg(stripped_type, 0)
if _no_transform_needed(inner_type):
# for some types there is no need to transform anything, so we can get a small
# perf boost from skipping that work.
#
# but we still need to convert to a list to ensure the data is json-serializable
if is_list(data):
return data
return list(data)

return [await _async_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]

if is_union_type(stripped_type):
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__ = "3.18.2" # x-release-please-version
__version__ = "3.19.0" # x-release-please-version
14 changes: 14 additions & 0 deletions src/orb/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@
InvoiceLineItemsWithStreamingResponse,
AsyncInvoiceLineItemsWithStreamingResponse,
)
from .subscription_changes import (
SubscriptionChanges,
AsyncSubscriptionChanges,
SubscriptionChangesWithRawResponse,
AsyncSubscriptionChangesWithRawResponse,
SubscriptionChangesWithStreamingResponse,
AsyncSubscriptionChangesWithStreamingResponse,
)
from .dimensional_price_groups import (
DimensionalPriceGroups,
AsyncDimensionalPriceGroups,
Expand Down Expand Up @@ -204,4 +212,10 @@
"AsyncDimensionalPriceGroupsWithRawResponse",
"DimensionalPriceGroupsWithStreamingResponse",
"AsyncDimensionalPriceGroupsWithStreamingResponse",
"SubscriptionChanges",
"AsyncSubscriptionChanges",
"SubscriptionChangesWithRawResponse",
"AsyncSubscriptionChangesWithRawResponse",
"SubscriptionChangesWithStreamingResponse",
"AsyncSubscriptionChangesWithStreamingResponse",
]
10 changes: 6 additions & 4 deletions src/orb/resources/invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ def create(
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

will_auto_issue: When true, this invoice will automatically be issued upon creation. When false,
the resulting invoice will require manual review to issue. Defaulted to false.
will_auto_issue: When true, this invoice will be submitted for issuance upon creation. When
false, the resulting invoice will require manual review to issue. Defaulted to
false.

extra_headers: Send extra headers

Expand Down Expand Up @@ -643,8 +644,9 @@ async def create(
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

will_auto_issue: When true, this invoice will automatically be issued upon creation. When false,
the resulting invoice will require manual review to issue. Defaulted to false.
will_auto_issue: When true, this invoice will be submitted for issuance upon creation. When
false, the resulting invoice will require manual review to issue. Defaulted to
false.

extra_headers: Send extra headers

Expand Down
Loading