Skip to content

Commit 2f681f1

Browse files
authored
Merge pull request #650 from orbcorp/release-please--branches--main--changes--next
release: 4.12.0
2 parents 7cce38e + d39b8bb commit 2f681f1

File tree

155 files changed

+2600
-3002
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+2600
-3002
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "4.11.1"
2+
".": "4.12.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-4f31d46f5ba187fc4d702c9f9f1573dacb891edbd086f935707578d7c4f5fed8.yml
3-
openapi_spec_hash: 25b1019f20a47b8af665aae5f8fd0025
4-
config_hash: d8a0d696f3250ab096fac87b6b0eab53
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-6b2550b95f82872b3825619c109352352b9c92281c8b2470fce158e971142881.yml
3+
openapi_spec_hash: 379df18de1af6a9d0b50d3653aab4d44
4+
config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Changelog
22

3+
## 4.12.0 (2025-09-03)
4+
5+
Full Changelog: [v4.11.1...v4.12.0](https://github.com/orbcorp/orb-python/compare/v4.11.1...v4.12.0)
6+
7+
### ⚠ BREAKING CHANGES
8+
9+
* **api:** define shared model ConversionRateConfig
10+
11+
### Features
12+
13+
* **api:** api update ([9f4c932](https://github.com/orbcorp/orb-python/commit/9f4c9321d5fd23eafbca5a91411976d1ea73fc1c))
14+
* **api:** define shared model ConversionRateConfig ([fe3cedb](https://github.com/orbcorp/orb-python/commit/fe3cedb638aeda208d325e7ea78d7db90f596857))
15+
* extract minimum composite to type ([4dba245](https://github.com/orbcorp/orb-python/commit/4dba2455ca1d390b7079a462cc03dddc2ce89b01))
16+
* **types:** replace List[str] with SequenceNotStr in params ([7a4eb7b](https://github.com/orbcorp/orb-python/commit/7a4eb7bcce5a2db055a7bfa27b074311c310aecc))
17+
18+
19+
### Chores
20+
21+
* **internal:** add Sequence related utils ([8427f8a](https://github.com/orbcorp/orb-python/commit/8427f8ae3bb00a9af89dd42b5c70479452350070))
22+
* **internal:** codegen related update ([4a2abd9](https://github.com/orbcorp/orb-python/commit/4a2abd95d4b6771171ca0f7de99a390c8b268dd9))
23+
324
## 4.11.1 (2025-08-29)
425

526
Full Changelog: [v4.11.0...v4.11.1](https://github.com/orbcorp/orb-python/compare/v4.11.0...v4.11.1)

api.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ from orb.types import (
1212
BillingCycleAnchorConfiguration,
1313
BillingCycleConfiguration,
1414
BillingCycleRelativeDate,
15-
BPSConfig,
16-
BPSTier,
17-
BulkBPSConfig,
18-
BulkBPSTier,
1915
BulkConfig,
2016
BulkTier,
2117
ChangedSubscriptionResources,
@@ -53,8 +49,6 @@ from orb.types import (
5349
NewAmountDiscount,
5450
NewBillingCycleConfiguration,
5551
NewDimensionalPriceConfiguration,
56-
NewFloatingBPSPrice,
57-
NewFloatingBulkBPSPrice,
5852
NewFloatingBulkPrice,
5953
NewFloatingBulkWithProrationPrice,
6054
NewFloatingCumulativeGroupedBulkPrice,
@@ -67,12 +61,12 @@ from orb.types import (
6761
NewFloatingMatrixWithAllocationPrice,
6862
NewFloatingMatrixWithDisplayNamePrice,
6963
NewFloatingMaxGroupTieredPackagePrice,
64+
NewFloatingMinimumCompositePrice,
7065
NewFloatingPackagePrice,
7166
NewFloatingPackageWithAllocationPrice,
7267
NewFloatingScalableMatrixWithTieredPricingPrice,
7368
NewFloatingScalableMatrixWithUnitPricingPrice,
7469
NewFloatingThresholdTotalAmountPrice,
75-
NewFloatingTieredBPSPrice,
7670
NewFloatingTieredPackagePrice,
7771
NewFloatingTieredPackageWithMinimumPrice,
7872
NewFloatingTieredPrice,
@@ -84,8 +78,6 @@ from orb.types import (
8478
NewMaximum,
8579
NewMinimum,
8680
NewPercentageDiscount,
87-
NewPlanBPSPrice,
88-
NewPlanBulkBPSPrice,
8981
NewPlanBulkPrice,
9082
NewPlanBulkWithProrationPrice,
9183
NewPlanCumulativeGroupedBulkPrice,
@@ -98,13 +90,13 @@ from orb.types import (
9890
NewPlanMatrixWithAllocationPrice,
9991
NewPlanMatrixWithDisplayNamePrice,
10092
NewPlanMaxGroupTieredPackagePrice,
93+
NewPlanMinimumCompositePrice,
10194
NewPlanPackagePrice,
10295
NewPlanPackageWithAllocationPrice,
10396
NewPlanScalableMatrixWithTieredPricingPrice,
10497
NewPlanScalableMatrixWithUnitPricingPrice,
10598
NewPlanThresholdTotalAmountPrice,
10699
NewPlanTierWithProrationPrice,
107-
NewPlanTieredBPSPrice,
108100
NewPlanTieredPackagePrice,
109101
NewPlanTieredPackageWithMinimumPrice,
110102
NewPlanTieredPrice,
@@ -135,7 +127,6 @@ from orb.types import (
135127
Tier,
136128
TierConfig,
137129
TierSubLineItem,
138-
TieredBPSConfig,
139130
TieredConfig,
140131
TieredConversionRateConfig,
141132
TransformPriceFilter,
@@ -506,8 +497,6 @@ Types:
506497
```python
507498
from orb.types import (
508499
DiscountOverride,
509-
NewSubscriptionBPSPrice,
510-
NewSubscriptionBulkBPSPrice,
511500
NewSubscriptionBulkPrice,
512501
NewSubscriptionBulkWithProrationPrice,
513502
NewSubscriptionCumulativeGroupedBulkPrice,
@@ -520,13 +509,13 @@ from orb.types import (
520509
NewSubscriptionMatrixWithAllocationPrice,
521510
NewSubscriptionMatrixWithDisplayNamePrice,
522511
NewSubscriptionMaxGroupTieredPackagePrice,
512+
NewSubscriptionMinimumCompositePrice,
523513
NewSubscriptionPackagePrice,
524514
NewSubscriptionPackageWithAllocationPrice,
525515
NewSubscriptionScalableMatrixWithTieredPricingPrice,
526516
NewSubscriptionScalableMatrixWithUnitPricingPrice,
527517
NewSubscriptionThresholdTotalAmountPrice,
528518
NewSubscriptionTierWithProrationPrice,
529-
NewSubscriptionTieredBPSPrice,
530519
NewSubscriptionTieredPackagePrice,
531520
NewSubscriptionTieredPackageWithMinimumPrice,
532521
NewSubscriptionTieredPrice,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "orb-billing"
3-
version = "4.11.1"
3+
version = "4.12.0"
44
description = "The official Python library for the orb API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/orb/_types.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,21 @@
1313
Mapping,
1414
TypeVar,
1515
Callable,
16+
Iterator,
1617
Optional,
1718
Sequence,
1819
)
19-
from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable
20+
from typing_extensions import (
21+
Set,
22+
Literal,
23+
Protocol,
24+
TypeAlias,
25+
TypedDict,
26+
SupportsIndex,
27+
overload,
28+
override,
29+
runtime_checkable,
30+
)
2031

2132
import httpx
2233
import pydantic
@@ -219,3 +230,26 @@ class _GenericAlias(Protocol):
219230
class HttpxSendArgs(TypedDict, total=False):
220231
auth: httpx.Auth
221232
follow_redirects: bool
233+
234+
235+
_T_co = TypeVar("_T_co", covariant=True)
236+
237+
238+
if TYPE_CHECKING:
239+
# This works because str.__contains__ does not accept object (either in typeshed or at runtime)
240+
# https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285
241+
class SequenceNotStr(Protocol[_T_co]):
242+
@overload
243+
def __getitem__(self, index: SupportsIndex, /) -> _T_co: ...
244+
@overload
245+
def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ...
246+
def __contains__(self, value: object, /) -> bool: ...
247+
def __len__(self) -> int: ...
248+
def __iter__(self) -> Iterator[_T_co]: ...
249+
def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ...
250+
def count(self, value: Any, /) -> int: ...
251+
def __reversed__(self) -> Iterator[_T_co]: ...
252+
else:
253+
# just point this to a normal `Sequence` at runtime to avoid having to special case
254+
# deserializing our custom sequence type
255+
SequenceNotStr = Sequence

src/orb/_utils/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
extract_type_arg as extract_type_arg,
3939
is_iterable_type as is_iterable_type,
4040
is_required_type as is_required_type,
41+
is_sequence_type as is_sequence_type,
4142
is_annotated_type as is_annotated_type,
4243
is_type_alias_type as is_type_alias_type,
4344
strip_annotated_type as strip_annotated_type,

src/orb/_utils/_transform.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
lru_cache,
1717
is_mapping,
1818
is_iterable,
19+
is_sequence,
1920
)
2021
from .._files import is_base64_file_input
2122
from ._typing import (
@@ -24,6 +25,7 @@
2425
extract_type_arg,
2526
is_iterable_type,
2627
is_required_type,
28+
is_sequence_type,
2729
is_annotated_type,
2830
strip_annotated_type,
2931
)
@@ -184,6 +186,8 @@ def _transform_recursive(
184186
(is_list_type(stripped_type) and is_list(data))
185187
# Iterable[T]
186188
or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str))
189+
# Sequence[T]
190+
or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str))
187191
):
188192
# dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually
189193
# intended as an iterable, so we don't transform it.
@@ -346,6 +350,8 @@ async def _async_transform_recursive(
346350
(is_list_type(stripped_type) and is_list(data))
347351
# Iterable[T]
348352
or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str))
353+
# Sequence[T]
354+
or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str))
349355
):
350356
# dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually
351357
# intended as an iterable, so we don't transform it.

src/orb/_utils/_typing.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ def is_list_type(typ: type) -> bool:
2626
return (get_origin(typ) or typ) == list
2727

2828

29+
def is_sequence_type(typ: type) -> bool:
30+
origin = get_origin(typ) or typ
31+
return origin == typing_extensions.Sequence or origin == typing.Sequence or origin == _c_abc.Sequence
32+
33+
2934
def is_iterable_type(typ: type) -> bool:
3035
"""If the given type is `typing.Iterable[T]`"""
3136
origin = get_origin(typ) or typ

src/orb/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "orb"
4-
__version__ = "4.11.1" # x-release-please-version
4+
__version__ = "4.12.0" # x-release-please-version

0 commit comments

Comments
 (0)