Skip to content

Commit 52c515e

Browse files
feat(api): Adding models
1 parent 4da6d66 commit 52c515e

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 11
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openint%2Fopenint-2ed699cc112b0ce03ebb276f5a62fc4ccaad5cca4463c76700025727fe7a71e4.yml
33
openapi_spec_hash: 0eefa3430c4685f99a613252d7d30d53
4-
config_hash: f81dc6b6d1369d87193817eff2c66447
4+
config_hash: 287d5109de5717d392756a2fbe488e49

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ import os
2828
from openint import Openint
2929

3030
client = Openint(
31-
token=os.environ.get(
32-
"OPENINT_API_KEY_OR_CUSTOMER_TOKEN_OR_CUSTOMER_API_KEY"
33-
), # This is the default and can be omitted
31+
token=os.environ.get("OPENINT_API_KEY"), # This is the default and can be omitted
3432
)
3533

3634
page = client.list_connections()
@@ -39,7 +37,7 @@ print(page.items)
3937

4038
While you can provide a `token` keyword argument,
4139
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
42-
to add `OPENINT_API_KEY_OR_CUSTOMER_TOKEN_OR_CUSTOMER_API_KEY="My Token"` to your `.env` file
40+
to add `OPENINT_API_KEY="My Token"` to your `.env` file
4341
so that your Token is not stored in source control.
4442

4543
## Async usage
@@ -52,9 +50,7 @@ import asyncio
5250
from openint import AsyncOpenint
5351

5452
client = AsyncOpenint(
55-
token=os.environ.get(
56-
"OPENINT_API_KEY_OR_CUSTOMER_TOKEN_OR_CUSTOMER_API_KEY"
57-
), # This is the default and can be omitted
53+
token=os.environ.get("OPENINT_API_KEY"), # This is the default and can be omitted
5854
)
5955

6056

src/openint/_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ def __init__(
102102
) -> None:
103103
"""Construct a new synchronous Openint client instance.
104104
105-
This automatically infers the `token` argument from the `OPENINT_API_KEY_OR_CUSTOMER_TOKEN_OR_CUSTOMER_API_KEY` environment variable if it is not provided.
105+
This automatically infers the `token` argument from the `OPENINT_API_KEY` environment variable if it is not provided.
106106
"""
107107
if token is None:
108-
token = os.environ.get("OPENINT_API_KEY_OR_CUSTOMER_TOKEN_OR_CUSTOMER_API_KEY")
108+
token = os.environ.get("OPENINT_API_KEY")
109109
self.token = token
110110

111111
if base_url is None:
@@ -1149,10 +1149,10 @@ def __init__(
11491149
) -> None:
11501150
"""Construct a new async AsyncOpenint client instance.
11511151
1152-
This automatically infers the `token` argument from the `OPENINT_API_KEY_OR_CUSTOMER_TOKEN_OR_CUSTOMER_API_KEY` environment variable if it is not provided.
1152+
This automatically infers the `token` argument from the `OPENINT_API_KEY` environment variable if it is not provided.
11531153
"""
11541154
if token is None:
1155-
token = os.environ.get("OPENINT_API_KEY_OR_CUSTOMER_TOKEN_OR_CUSTOMER_API_KEY")
1155+
token = os.environ.get("OPENINT_API_KEY")
11561156
self.token = token
11571157

11581158
if base_url is None:

tests/test_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def test_validate_headers(self) -> None:
317317
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
318318
assert request.headers.get("Authorization") == f"Bearer {token}"
319319

320-
with update_env(**{"OPENINT_API_KEY_OR_CUSTOMER_TOKEN_OR_CUSTOMER_API_KEY": Omit()}):
320+
with update_env(**{"OPENINT_API_KEY": Omit()}):
321321
client2 = Openint(base_url=base_url, token=None, _strict_response_validation=True)
322322

323323
with pytest.raises(
@@ -1055,7 +1055,7 @@ def test_validate_headers(self) -> None:
10551055
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
10561056
assert request.headers.get("Authorization") == f"Bearer {token}"
10571057

1058-
with update_env(**{"OPENINT_API_KEY_OR_CUSTOMER_TOKEN_OR_CUSTOMER_API_KEY": Omit()}):
1058+
with update_env(**{"OPENINT_API_KEY": Omit()}):
10591059
client2 = AsyncOpenint(base_url=base_url, token=None, _strict_response_validation=True)
10601060

10611061
with pytest.raises(

0 commit comments

Comments
 (0)