You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
118
+
returned response object will have a `Next` method that can be called to pull down the next group of results. If the
119
+
return value of `Next` is `None`, then there are no more pages to be fetched.
120
+
121
+
Here's an example of one such pagination call:
122
+
<!-- End Pagination -->
123
+
124
+
125
+
126
+
<!-- Start Error Handling -->
127
+
# Error Handling
128
+
129
+
Handling errors in your SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.
130
+
<!-- End Error Handling -->
131
+
132
+
133
+
134
+
<!-- Start Server Selection -->
135
+
# Server Selection
136
+
137
+
## Select Server by Index
138
+
139
+
You can override the default server globally by passing a server index to the `server_idx: int` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
140
+
141
+
| # | Server | Variables |
142
+
| - | ------ | --------- |
143
+
| 0 |`https://entity.sls.epilot.io`| None |
144
+
145
+
For example:
146
+
147
+
148
+
```python
149
+
import epilot
150
+
from epilot.models import operations, shared
151
+
152
+
s = epilot.Epilot(
153
+
security=shared.Security(
154
+
epilot_auth="",
155
+
),
156
+
server_idx=0
157
+
)
158
+
159
+
req = operations.AttachActivityRequest(
160
+
entities=[
161
+
'ee1dee63-2954-4671-8246-751c43fec091',
162
+
],
163
+
id='01F130Q52Q6MWSNS8N2AVXV4JN',
164
+
)
165
+
166
+
res = s.activity.attach_activity(req)
167
+
168
+
if res.activity_item isnotNone:
169
+
# handle response
170
+
pass
171
+
```
172
+
173
+
174
+
## Override Server URL Per-Client
175
+
176
+
The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
177
+
178
+
179
+
```python
180
+
import epilot
181
+
from epilot.models import operations, shared
182
+
183
+
s = epilot.Epilot(
184
+
security=shared.Security(
185
+
epilot_auth="",
186
+
),
187
+
server_url="https://entity.sls.epilot.io"
188
+
)
189
+
190
+
req = operations.AttachActivityRequest(
191
+
entities=[
192
+
'ee1dee63-2954-4671-8246-751c43fec091',
193
+
],
194
+
id='01F130Q52Q6MWSNS8N2AVXV4JN',
195
+
)
196
+
197
+
res = s.activity.attach_activity(req)
198
+
199
+
if res.activity_item isnotNone:
200
+
# handle response
201
+
pass
202
+
```
203
+
<!-- End Server Selection -->
204
+
205
+
206
+
207
+
<!-- Start Custom HTTP Client -->
208
+
# Custom HTTP Client
209
+
210
+
The Python SDK makes API calls using the (requests)[https://pypi.org/project/requests/] HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object.
211
+
212
+
213
+
For example, you could specify a header for every request that your sdk makes as follows:
0 commit comments