Skip to content

Commit 7a1f374

Browse files
committed
SDK regeneration
1 parent d3be25f commit 7a1f374

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

README.md

+17-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ Instantiate and use the client with the following:
2222
```python
2323
from truefoundry_sdk import TrueFoundry
2424
client = TrueFoundry(api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", )
25-
client.users.invite_user(accept_invite_client_url='<control plane url>/invite-accept', email='email', )
25+
response = client.applications.list(limit=10, offset=0, )
26+
for item in response:
27+
yield item
28+
# alternatively, you can paginate page-by-page
29+
for page in response.iter_pages():
30+
yield page
2631
```
2732

2833
## Async Client
@@ -34,7 +39,13 @@ from truefoundry_sdk import AsyncTrueFoundry
3439
import asyncio
3540
client = AsyncTrueFoundry(api_key="YOUR_API_KEY", base_url="https://yourhost.com/path/to/api", )
3641
async def main() -> None:
37-
await client.users.invite_user(accept_invite_client_url='<control plane url>/invite-accept', email='email', )
42+
response = await client.applications.list(limit=10, offset=0, )
43+
async for item in response:
44+
yield item
45+
46+
# alternatively, you can paginate page-by-page
47+
async for page in response.iter_pages():
48+
yield page
3849
asyncio.run(main())
3950
```
4051

@@ -46,7 +57,7 @@ will be thrown.
4657
```python
4758
from truefoundry_sdk.core.api_error import ApiError
4859
try:
49-
client.users.invite_user(...)
60+
client.applications.list(...)
5061
except ApiError as e:
5162
print(e.status_code)
5263
print(e.body)
@@ -77,7 +88,7 @@ The `.with_raw_response` property returns a "raw" client that can be used to acc
7788
```python
7889
from truefoundry_sdk import TrueFoundry
7990
client = TrueFoundry(..., )
80-
response = client.users.with_raw_response.invite_user(...)
91+
response = client.applications.with_raw_response.list(...)
8192
print(response.headers) # access the response headers
8293
print(response.data) # access the underlying object
8394
pager = client.users.list(...)
@@ -105,7 +116,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
105116
Use the `max_retries` request option to configure this behavior.
106117

107118
```python
108-
client.users.invite_user(..., request_options={
119+
client.applications.list(..., request_options={
109120
"max_retries": 1
110121
})
111122
```
@@ -120,7 +131,7 @@ from truefoundry_sdk import TrueFoundry
120131
client = TrueFoundry(..., timeout=20.0, )
121132

122133
# Override timeout for a specific method
123-
client.users.invite_user(..., request_options={
134+
client.applications.list(..., request_options={
124135
"timeout_in_seconds": 1
125136
})
126137
```

0 commit comments

Comments
 (0)