@@ -22,7 +22,12 @@ Instantiate and use the client with the following:
22
22
``` python
23
23
from truefoundry_sdk import TrueFoundry
24
24
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
26
31
```
27
32
28
33
## Async Client
@@ -34,7 +39,13 @@ from truefoundry_sdk import AsyncTrueFoundry
34
39
import asyncio
35
40
client = AsyncTrueFoundry(api_key = " YOUR_API_KEY" , base_url = " https://yourhost.com/path/to/api" , )
36
41
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
38
49
asyncio.run(main())
39
50
```
40
51
@@ -46,7 +57,7 @@ will be thrown.
46
57
``` python
47
58
from truefoundry_sdk.core.api_error import ApiError
48
59
try :
49
- client.users.invite_user (... )
60
+ client.applications.list (... )
50
61
except ApiError as e:
51
62
print (e.status_code)
52
63
print (e.body)
@@ -77,7 +88,7 @@ The `.with_raw_response` property returns a "raw" client that can be used to acc
77
88
``` python
78
89
from truefoundry_sdk import TrueFoundry
79
90
client = TrueFoundry(... , )
80
- response = client.users .with_raw_response.invite_user (... )
91
+ response = client.applications .with_raw_response.list (... )
81
92
print (response.headers) # access the response headers
82
93
print (response.data) # access the underlying object
83
94
pager = client.users.list(... )
@@ -105,7 +116,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
105
116
Use the ` max_retries ` request option to configure this behavior.
106
117
107
118
``` python
108
- client.users.invite_user (... , request_options = {
119
+ client.applications.list (... , request_options = {
109
120
" max_retries" : 1
110
121
})
111
122
```
@@ -120,7 +131,7 @@ from truefoundry_sdk import TrueFoundry
120
131
client = TrueFoundry(... , timeout = 20.0 , )
121
132
122
133
# Override timeout for a specific method
123
- client.users.invite_user (... , request_options = {
134
+ client.applications.list (... , request_options = {
124
135
" timeout_in_seconds" : 1
125
136
})
126
137
```
0 commit comments