Skip to content

Commit c13dfd2

Browse files
feat(api): OpenAPI spec update via Stainless API (#365)
1 parent 1f39044 commit c13dfd2

File tree

184 files changed

+4419
-3068
lines changed

Some content is hidden

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

184 files changed

+4419
-3068
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 93
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-af2e129bdcee200185e3fb82837268c03686680beafec3e04b3b17ba32782b48.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-7ae6544b3567d683dd64c5caff02b49ffc0dc4897d0a91738b0162f36a7ddee7.yml

README.md

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,12 @@ client = AsyncOrb(
5656
api_key=os.environ.get("ORB_API_KEY"),
5757
)
5858

59-
6059
async def main() -> None:
61-
customer = await client.customers.create(
62-
63-
name="My Customer",
64-
)
65-
print(customer.id)
66-
60+
customer = await client.customers.create(
61+
62+
name="My Customer",
63+
)
64+
print(customer.id)
6765

6866
asyncio.run(main())
6967
```
@@ -106,15 +104,13 @@ from orb import AsyncOrb
106104

107105
client = AsyncOrb()
108106

109-
110107
async def main() -> None:
111108
all_coupons = []
112109
# Iterate through items across all pages, issuing requests as needed.
113110
async for coupon in client.coupons.list():
114111
all_coupons.append(coupon)
115112
print(all_coupons)
116113

117-
118114
asyncio.run(main())
119115
```
120116

@@ -135,9 +131,7 @@ Or just work directly with the returned data:
135131
```python
136132
first_page = await client.coupons.list()
137133

138-
print(
139-
f"next page cursor: {first_page.pagination_metadata.next_cursor}"
140-
) # => "next page cursor: ..."
134+
print(f"next page cursor: {first_page.pagination_metadata.next_cursor}") # => "next page cursor: ..."
141135
for coupon in first_page.data:
142136
print(coupon.id)
143137

@@ -187,7 +181,7 @@ try:
187181
)
188182
except orb.APIConnectionError as e:
189183
print("The server could not be reached")
190-
print(e.__cause__) # an underlying Exception, likely raised within httpx.
184+
print(e.__cause__) # an underlying Exception, likely raised within httpx.
191185
except orb.RateLimitError as e:
192186
print("A 429 status code was received; we should back off a bit.")
193187
except orb.APIStatusError as e:
@@ -227,7 +221,7 @@ client = Orb(
227221
)
228222

229223
# Or, configure per-request:
230-
client.with_options(max_retries=5).customers.create(
224+
client.with_options(max_retries = 5).customers.create(
231225
232226
name="My Customer",
233227
)
@@ -253,7 +247,7 @@ client = Orb(
253247
)
254248

255249
# Override per-request:
256-
client.with_options(timeout=5.0).customers.create(
250+
client.with_options(timeout = 5.0).customers.create(
257251
258252
name="My Customer",
259253
)
@@ -326,11 +320,11 @@ As such, `.with_streaming_response` methods return a different [`APIResponse`](h
326320
with client.customers.with_streaming_response.create(
327321
328322
name="My Customer",
329-
) as response:
330-
print(response.headers.get("X-My-Header"))
323+
) as response :
324+
print(response.headers.get('X-My-Header'))
331325

332326
for line in response.iter_lines():
333-
print(line)
327+
print(line)
334328
```
335329

336330
The context manager is required so that the response will reliably be closed.
@@ -384,10 +378,7 @@ from orb import Orb, DefaultHttpxClient
384378
client = Orb(
385379
# Or use the `ORB_BASE_URL` env var
386380
base_url="http://my.test.server.example.com:8083",
387-
http_client=DefaultHttpxClient(
388-
proxies="http://my.test.proxy.example.com",
389-
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
390-
),
381+
http_client=DefaultHttpxClient(proxies="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),
391382
)
392383
```
393384

api.md

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,7 @@ Methods:
9999
Types:
100100

101101
```python
102-
from orb.types.customers.credits import (
103-
LedgerListResponse,
104-
LedgerCreateEntryResponse,
105-
LedgerCreateEntryByExternalIDResponse,
106-
LedgerListByExternalIDResponse,
107-
)
102+
from orb.types.customers.credits import LedgerListResponse, LedgerCreateEntryResponse, LedgerCreateEntryByExternalIDResponse, LedgerListByExternalIDResponse
108103
```
109104

110105
Methods:
@@ -119,12 +114,7 @@ Methods:
119114
Types:
120115

121116
```python
122-
from orb.types.customers.credits import (
123-
TopUpCreateResponse,
124-
TopUpListResponse,
125-
TopUpCreateByExternalIDResponse,
126-
TopUpListByExternalIDResponse,
127-
)
117+
from orb.types.customers.credits import TopUpCreateResponse, TopUpListResponse, TopUpCreateByExternalIDResponse, TopUpListByExternalIDResponse
128118
```
129119

130120
Methods:
@@ -154,12 +144,7 @@ Methods:
154144
Types:
155145

156146
```python
157-
from orb.types import (
158-
EventUpdateResponse,
159-
EventDeprecateResponse,
160-
EventIngestResponse,
161-
EventSearchResponse,
162-
)
147+
from orb.types import EventUpdateResponse, EventDeprecateResponse, EventIngestResponse, EventSearchResponse
163148
```
164149

165150
Methods:
@@ -174,13 +159,7 @@ Methods:
174159
Types:
175160

176161
```python
177-
from orb.types.events import (
178-
BackfillCreateResponse,
179-
BackfillListResponse,
180-
BackfillCloseResponse,
181-
BackfillFetchResponse,
182-
BackfillRevertResponse,
183-
)
162+
from orb.types.events import BackfillCreateResponse, BackfillListResponse, BackfillCloseResponse, BackfillFetchResponse, BackfillRevertResponse
184163
```
185164

186165
Methods:
@@ -302,13 +281,7 @@ Methods:
302281
Types:
303282

304283
```python
305-
from orb.types import (
306-
Subscription,
307-
SubscriptionUsage,
308-
Subscriptions,
309-
SubscriptionFetchCostsResponse,
310-
SubscriptionFetchScheduleResponse,
311-
)
284+
from orb.types import Subscription, SubscriptionUsage, Subscriptions, SubscriptionFetchCostsResponse, SubscriptionFetchScheduleResponse
312285
```
313286

314287
Methods:

src/orb/__init__.py

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

33
from . import types
4-
from ._types import NOT_GIVEN, NoneType, NotGiven, Transport, ProxiesTypes
5-
from ._utils import file_from_path
6-
from ._client import Orb, Client, Stream, Timeout, AsyncOrb, Transport, AsyncClient, AsyncStream, RequestOptions
7-
from ._models import BaseModel
8-
from ._version import __title__, __version__
9-
from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse
10-
from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS
4+
from ._version import __version__, __title__
5+
from ._client import Timeout, Transport, RequestOptions, Client, AsyncClient, Stream, AsyncStream, Orb, AsyncOrb
116
from ._exceptions import (
12-
APIError,
137
OrbError,
14-
URLNotFound,
15-
ConflictError,
16-
NotFoundError,
8+
APIError,
179
APIStatusError,
18-
RateLimitError,
1910
APITimeoutError,
20-
BadRequestError,
21-
RequestTooLarge,
22-
TooManyRequests,
23-
ResourceConflict,
24-
ResourceNotFound,
25-
ResourceTooLarge,
2611
APIConnectionError,
12+
APIResponseValidationError,
13+
BadRequestError,
2714
AuthenticationError,
28-
ConstraintViolation,
29-
FeatureNotAvailable,
30-
InternalServerError,
3115
PermissionDeniedError,
32-
OrbAuthenticationError,
33-
OrbInternalServerError,
34-
RequestValidationError,
16+
NotFoundError,
17+
ConflictError,
3518
UnprocessableEntityError,
19+
RateLimitError,
20+
InternalServerError,
21+
ConstraintViolation,
3622
DuplicateResourceCreation,
37-
APIResponseValidationError,
23+
RequestValidationError,
24+
OrbAuthenticationError,
25+
FeatureNotAvailable,
26+
ResourceNotFound,
27+
URLNotFound,
28+
ResourceConflict,
29+
RequestTooLarge,
30+
ResourceTooLarge,
31+
TooManyRequests,
32+
OrbInternalServerError,
3833
)
34+
from ._types import NoneType, Transport, ProxiesTypes, NotGiven, NOT_GIVEN
35+
from ._utils import file_from_path
36+
from ._models import BaseModel
37+
from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS
3938
from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient
4039
from ._utils._logs import setup_logging as _setup_logging
40+
from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse
4141

4242
__all__ = [
4343
"types",
@@ -101,7 +101,7 @@
101101
for __name in __all__:
102102
if not __name.startswith("__"):
103103
try:
104-
__locals[__name].__module__ = "orb"
104+
setattr(__locals[__name], "__module__", "orb")
105105
except (TypeError, AttributeError):
106106
# Some of our exported symbols are builtins which we can't set attributes for.
107107
pass

src/orb/_client.py

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,67 @@
22

33
from __future__ import annotations
44

5+
import httpx
6+
7+
import os
8+
9+
from ._streaming import AsyncStream as AsyncStream, Stream as Stream
10+
11+
from ._exceptions import OrbError, APIStatusError
12+
13+
from typing_extensions import override, Self
14+
15+
from typing import Any
16+
17+
from ._utils import is_mapping, get_async_library
18+
19+
from . import _exceptions
20+
521
import os
6-
from typing import Any, Union, Mapping
7-
from typing_extensions import Self, override
22+
import asyncio
23+
import warnings
24+
from typing import Optional, Union, Dict, Any, Mapping, overload, cast
25+
from typing_extensions import Literal
826

927
import httpx
1028

11-
from . import resources, _exceptions
29+
from ._version import __version__
1230
from ._qs import Querystring
31+
from ._utils import (
32+
extract_files,
33+
maybe_transform,
34+
required_args,
35+
deepcopy_minimal,
36+
maybe_coerce_integer,
37+
maybe_coerce_float,
38+
maybe_coerce_boolean,
39+
is_given,
40+
)
1341
from ._types import (
14-
NOT_GIVEN,
1542
Omit,
16-
Timeout,
1743
NotGiven,
44+
Timeout,
1845
Transport,
1946
ProxiesTypes,
2047
RequestOptions,
48+
Headers,
49+
NoneType,
50+
Query,
51+
Body,
52+
NOT_GIVEN,
2153
)
22-
from ._utils import (
23-
is_given,
24-
is_mapping,
25-
get_async_library,
26-
)
27-
from ._version import __version__
28-
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
29-
from ._exceptions import OrbError, APIStatusError
3054
from ._base_client import (
55+
DEFAULT_CONNECTION_LIMITS,
56+
DEFAULT_TIMEOUT,
3157
DEFAULT_MAX_RETRIES,
58+
ResponseT,
59+
SyncHttpxClientWrapper,
60+
AsyncHttpxClientWrapper,
3261
SyncAPIClient,
3362
AsyncAPIClient,
63+
make_request_options,
3464
)
65+
from . import resources
3566

3667
__all__ = [
3768
"Timeout",

0 commit comments

Comments
 (0)