Skip to content

release: 1.33.0 #68

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 7 commits into from
Nov 28, 2023
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 @@
{
".": "1.32.0"
".": "1.33.0"
}
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 1.33.0 (2023-11-28)

Full Changelog: [v1.32.0...v1.33.0](https://github.com/orbcorp/orb-python/compare/v1.32.0...v1.33.0)

### Features

* **api:** updates ([#73](https://github.com/orbcorp/orb-python/issues/73)) ([1e4d614](https://github.com/orbcorp/orb-python/commit/1e4d6148fcb859c095fd46e21841aff004475430))


### Chores

* **deps:** bump mypy to v1.7.1 ([#72](https://github.com/orbcorp/orb-python/issues/72)) ([e7f7b47](https://github.com/orbcorp/orb-python/commit/e7f7b47e99c4e1ae73c09de6c83d8879e0172bae))
* **internal:** options updates ([#67](https://github.com/orbcorp/orb-python/issues/67)) ([8f91e55](https://github.com/orbcorp/orb-python/commit/8f91e55e750372c77dfd98202cd445560343e747))
* **internal:** revert recent options change ([#70](https://github.com/orbcorp/orb-python/issues/70)) ([6ff55a6](https://github.com/orbcorp/orb-python/commit/6ff55a6bff7f7281b6288cb7a3042fd51e3a29f0))
* **internal:** send more detailed x-stainless headers ([#71](https://github.com/orbcorp/orb-python/issues/71)) ([7dd46f3](https://github.com/orbcorp/orb-python/commit/7dd46f3ed8ba12999cbb3376b48f01c12f7e80e3))


### Documentation

* **api:** update metadata docstrings ([#69](https://github.com/orbcorp/orb-python/issues/69)) ([cf25b7c](https://github.com/orbcorp/orb-python/commit/cf25b7c8280a5dae5796fc5506db794ccba3b425))

## 1.32.0 (2023-11-22)

Full Changelog: [v1.31.2...v1.32.0](https://github.com/orbcorp/orb-python/compare/v1.31.2...v1.32.0)
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "orb-billing"
version = "1.32.0"
version = "1.33.0"
description = "The official Python library for the orb API"
readme = "README.md"
license = "Apache-2.0"
Expand All @@ -13,6 +13,7 @@ dependencies = [
"typing-extensions>=4.5, <5",
"anyio>=3.5.0, <4",
"distro>=1.7.0, <2",
"sniffio",

]
requires-python = ">= 3.7"
Expand Down Expand Up @@ -46,7 +47,7 @@ Repository = "https://github.com/orbcorp/orb-python"
managed = true
dev-dependencies = [
"pyright==1.1.332",
"mypy==1.6.1",
"mypy==1.7.1",
"black==23.3.0",
"respx==0.19.2",
"pytest==7.1.1",
Expand Down
3 changes: 2 additions & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ httpx==0.23.0
idna==3.4
iniconfig==2.0.0
isort==5.10.1
mypy==1.6.1
mypy==1.7.1
mypy-extensions==1.0.0
nodeenv==1.8.0
nox==2023.4.22
Expand All @@ -41,6 +41,7 @@ pyright==1.1.332
pytest==7.1.1
pytest-asyncio==0.21.1
python-dateutil==2.8.2
pytz==2023.3.post1
respx==0.19.2
rfc3986==1.5.0
ruff==0.0.282
Expand Down
21 changes: 20 additions & 1 deletion src/orb/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
from ._qs import Querystring
from ._types import (
NOT_GIVEN,
Omit,
Timeout,
NotGiven,
Transport,
ProxiesTypes,
RequestOptions,
)
from ._utils import is_given, is_mapping
from ._utils import is_given, is_mapping, get_async_library
from ._version import __version__
from ._streaming import Stream as Stream
from ._streaming import AsyncStream as AsyncStream
Expand Down Expand Up @@ -133,6 +134,15 @@ def auth_headers(self) -> dict[str, str]:
api_key = self.api_key
return {"Authorization": f"Bearer {api_key}"}

@property
@override
def default_headers(self) -> dict[str, str | Omit]:
return {
**super().default_headers,
"X-Stainless-Async": "false",
**self._custom_headers,
}

def copy(
self,
*,
Expand Down Expand Up @@ -370,6 +380,15 @@ def auth_headers(self) -> dict[str, str]:
api_key = self.api_key
return {"Authorization": f"Bearer {api_key}"}

@property
@override
def default_headers(self) -> dict[str, str | Omit]:
return {
**super().default_headers,
"X-Stainless-Async": f"async:{get_async_library()}",
**self._custom_headers,
}

def copy(
self,
*,
Expand Down
1 change: 1 addition & 0 deletions src/orb/_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from ._utils import deepcopy_minimal as deepcopy_minimal
from ._utils import extract_type_arg as extract_type_arg
from ._utils import is_required_type as is_required_type
from ._utils import get_async_library as get_async_library
from ._utils import is_annotated_type as is_annotated_type
from ._utils import maybe_coerce_float as maybe_coerce_float
from ._utils import get_required_header as get_required_header
Expand Down
9 changes: 9 additions & 0 deletions src/orb/_utils/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
from pathlib import Path
from typing_extensions import Required, Annotated, TypeGuard, get_args, get_origin

import sniffio

from .._types import Headers, NotGiven, FileTypes, NotGivenOr, HeadersLike
from .._compat import is_union as _is_union
from .._compat import parse_date as parse_date
Expand Down Expand Up @@ -406,3 +408,10 @@ def get_required_header(headers: HeadersLike, header: str) -> str:
return value

raise ValueError(f"Could not find {header} header")


def get_async_library() -> str:
try:
return sniffio.current_async_library()
except Exception:
return "false"
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.

__title__ = "orb"
__version__ = "1.32.0" # x-release-please-version
__version__ = "1.33.0" # x-release-please-version
80 changes: 60 additions & 20 deletions src/orb/resources/customers/credits/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ def create_entry(
per_unit_cost_basis, as the calculation of the invoice total is done on that
basis.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

per_unit_cost_basis: Can only be specified when entry_type=increment. How much, in USD, a customer
paid for a single credit in this block
Expand Down Expand Up @@ -499,7 +501,9 @@ def create_entry(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

extra_headers: Send extra headers

Expand Down Expand Up @@ -662,7 +666,9 @@ def create_entry(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

extra_headers: Send extra headers

Expand Down Expand Up @@ -816,7 +822,9 @@ def create_entry(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

void_reason: Can only be specified when `entry_type=void`. The reason for the void.

Expand Down Expand Up @@ -971,7 +979,9 @@ def create_entry(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

extra_headers: Send extra headers

Expand Down Expand Up @@ -1207,7 +1217,9 @@ def create_entry_by_external_id(
per_unit_cost_basis, as the calculation of the invoice total is done on that
basis.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

per_unit_cost_basis: Can only be specified when entry_type=increment. How much, in USD, a customer
paid for a single credit in this block
Expand Down Expand Up @@ -1360,7 +1372,9 @@ def create_entry_by_external_id(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

extra_headers: Send extra headers

Expand Down Expand Up @@ -1523,7 +1537,9 @@ def create_entry_by_external_id(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

extra_headers: Send extra headers

Expand Down Expand Up @@ -1677,7 +1693,9 @@ def create_entry_by_external_id(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

void_reason: Can only be specified when `entry_type=void`. The reason for the void.

Expand Down Expand Up @@ -1832,7 +1850,9 @@ def create_entry_by_external_id(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

extra_headers: Send extra headers

Expand Down Expand Up @@ -2390,7 +2410,9 @@ async def create_entry(
per_unit_cost_basis, as the calculation of the invoice total is done on that
basis.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

per_unit_cost_basis: Can only be specified when entry_type=increment. How much, in USD, a customer
paid for a single credit in this block
Expand Down Expand Up @@ -2543,7 +2565,9 @@ async def create_entry(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

extra_headers: Send extra headers

Expand Down Expand Up @@ -2706,7 +2730,9 @@ async def create_entry(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

extra_headers: Send extra headers

Expand Down Expand Up @@ -2860,7 +2886,9 @@ async def create_entry(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

void_reason: Can only be specified when `entry_type=void`. The reason for the void.

Expand Down Expand Up @@ -3015,7 +3043,9 @@ async def create_entry(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

extra_headers: Send extra headers

Expand Down Expand Up @@ -3251,7 +3281,9 @@ async def create_entry_by_external_id(
per_unit_cost_basis, as the calculation of the invoice total is done on that
basis.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

per_unit_cost_basis: Can only be specified when entry_type=increment. How much, in USD, a customer
paid for a single credit in this block
Expand Down Expand Up @@ -3404,7 +3436,9 @@ async def create_entry_by_external_id(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

extra_headers: Send extra headers

Expand Down Expand Up @@ -3567,7 +3601,9 @@ async def create_entry_by_external_id(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

extra_headers: Send extra headers

Expand Down Expand Up @@ -3721,7 +3757,9 @@ async def create_entry_by_external_id(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

void_reason: Can only be specified when `entry_type=void`. The reason for the void.

Expand Down Expand Up @@ -3876,7 +3914,9 @@ async def create_entry_by_external_id(
For example, this can be used to note an increment refers to trial credits, or
for noting corrections as a result of an incident, etc.

metadata: User-specified key/value pairs for the resource.
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

extra_headers: Send extra headers

Expand Down
Loading