Skip to content

Commit e055bad

Browse files
authored
Merge pull request #31 from team-monite/fern-bot/05-06-2025-1226PM
🌿 Fern Regeneration -- May 6, 2025
2 parents 3aff3de + 7bd295e commit e055bad

725 files changed

Lines changed: 95948 additions & 59367 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: ci
33
on: [push]
44
jobs:
55
compile:
6-
runs-on: ubuntu-20.04
6+
runs-on: ubuntu-latest
77
steps:
88
- name: Checkout repo
9-
uses: actions/checkout@v3
9+
uses: actions/checkout@v4
1010
- name: Set up python
1111
uses: actions/setup-python@v4
1212
with:
@@ -19,10 +19,10 @@ jobs:
1919
- name: Compile
2020
run: poetry run mypy .
2121
test:
22-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-latest
2323
steps:
2424
- name: Checkout repo
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626
- name: Set up python
2727
uses: actions/setup-python@v4
2828
with:
@@ -39,10 +39,10 @@ jobs:
3939
publish:
4040
needs: [compile, test]
4141
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
42-
runs-on: ubuntu-20.04
42+
runs-on: ubuntu-latest
4343
steps:
4444
- name: Checkout repo
45-
uses: actions/checkout@v3
45+
uses: actions/checkout@v4
4646
- name: Set up python
4747
uses: actions/setup-python@v4
4848
with:

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
dist/
21
.mypy_cache/
2+
.ruff_cache/
33
__pycache__/
4+
dist/
45
poetry.toml
5-
.ruff_cache/

README.md

Lines changed: 25 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -25,41 +25,21 @@ Instantiate and use the client with the following:
2525

2626
```python
2727
from monite import Monite
28-
29-
client = Monite(
30-
monite_version="YOUR_MONITE_VERSION",
31-
monite_entity_id="YOUR_MONITE_ENTITY_ID",
32-
token="YOUR_TOKEN",
33-
)
34-
client.products.create(
35-
name="name",
36-
)
28+
client = Monite(monite_version="YOUR_MONITE_VERSION", monite_entity_id="YOUR_MONITE_ENTITY_ID", token="YOUR_TOKEN", )
29+
client.products.create(name='name', )
3730
```
3831

3932
## Async Client
4033

4134
The SDK also exports an `async` client so that you can make non-blocking calls to our API.
4235

4336
```python
44-
import asyncio
45-
4637
from monite import AsyncMonite
47-
48-
client = AsyncMonite(
49-
monite_version="YOUR_MONITE_VERSION",
50-
monite_entity_id="YOUR_MONITE_ENTITY_ID",
51-
token="YOUR_TOKEN",
52-
)
53-
54-
38+
import asyncio
39+
client = AsyncMonite(monite_version="YOUR_MONITE_VERSION", monite_entity_id="YOUR_MONITE_ENTITY_ID", token="YOUR_TOKEN", )
5540
async def main() -> None:
56-
await client.products.create(
57-
name="name",
58-
)
59-
60-
61-
asyncio.run(main())
62-
```
41+
await client.products.create(name='name', )
42+
asyncio.run(main())```
6343

6444
## Exception Handling
6545

@@ -68,7 +48,6 @@ will be thrown.
6848

6949
```python
7050
from monite.core.api_error import ApiError
71-
7251
try:
7352
client.products.create(...)
7453
except ApiError as e:
@@ -78,13 +57,26 @@ except ApiError as e:
7857

7958
## Advanced
8059

60+
### Access Raw Response Data
61+
62+
The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
63+
The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
64+
65+
```python
66+
from monite import Monite
67+
client = Monite(..., )
68+
response = client.products.with_raw_response.create(...)
69+
print(response.headers) # access the response headers
70+
print(response.data) # access the underlying object
71+
```
72+
8173
### Retries
8274

8375
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
84-
as the request is deemed retriable and the number of retry attempts has not grown larger than the configured
76+
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
8577
retry limit (default: 2).
8678

87-
A request is deemed retriable when any of the following HTTP status codes is returned:
79+
A request is deemed retryable when any of the following HTTP status codes is returned:
8880

8981
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
9082
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
@@ -105,12 +97,7 @@ The SDK defaults to a 60 second timeout. You can configure this with a timeout o
10597
```python
10698

10799
from monite import Monite
108-
109-
client = Monite(
110-
...,
111-
timeout=20.0,
112-
)
113-
100+
client = Monite(..., timeout=20.0, )
114101

115102
# Override timeout for a specific method
116103
client.products.create(..., request_options={
@@ -122,18 +109,11 @@ client.products.create(..., request_options={
122109

123110
You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
124111
and transports.
112+
125113
```python
126-
import httpx
127114
from monite import Monite
128-
129-
client = Monite(
130-
...,
131-
httpx_client=httpx.Client(
132-
proxies="http://my.test.proxy.example.com",
133-
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
134-
),
135-
)
136-
```
115+
import httpx
116+
client = Monite(..., httpx_client=httpx.Client(proxies="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0"), ))```
137117

138118
## Contributing
139119

0 commit comments

Comments
 (0)