syncsdk 0.1.9__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {syncsdk-0.1.9 → syncsdk-0.2.1}/PKG-INFO +2 -2
- {syncsdk-0.1.9 → syncsdk-0.2.1}/README.md +1 -1
- {syncsdk-0.1.9 → syncsdk-0.2.1}/pyproject.toml +1 -1
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/__init__.py +20 -1
- syncsdk-0.2.1/src/sync/batch/client.py +311 -0
- syncsdk-0.2.1/src/sync/batch/raw_client.py +537 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/client.py +4 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/__init__.py +24 -1
- syncsdk-0.2.1/src/sync/common/errors/__init__.py +17 -0
- syncsdk-0.2.1/src/sync/common/errors/payment_required_error.py +9 -0
- syncsdk-0.2.1/src/sync/common/errors/too_many_requests_error.py +9 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/__init__.py +14 -0
- syncsdk-0.2.1/src/sync/common/types/active_speaker.py +26 -0
- syncsdk-0.2.1/src/sync/common/types/batch_id.py +3 -0
- syncsdk-0.2.1/src/sync/common/types/batch_metrics.py +37 -0
- syncsdk-0.2.1/src/sync/common/types/batch_response.py +51 -0
- syncsdk-0.2.1/src/sync/common/types/batch_status.py +5 -0
- syncsdk-0.2.1/src/sync/common/types/create_batch_response.py +7 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/create_generation_dto.py +7 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/generation.py +7 -0
- syncsdk-0.2.1/src/sync/common/types/generation_options.py +39 -0
- syncsdk-0.2.1/src/sync/common/types/model.py +5 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/sync_mode.py +1 -1
- syncsdk-0.2.1/src/sync/common/types/validation_response.py +22 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/core/client_wrapper.py +2 -2
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/environment.py +1 -0
- syncsdk-0.2.1/src/sync/generations/__init__.py +2 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/generations/client.py +167 -4
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/generations/raw_client.py +217 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/webhooks/types/generation_notification.py +7 -0
- syncsdk-0.1.9/src/sync/common/errors/__init__.py +0 -8
- syncsdk-0.1.9/src/sync/common/types/generation_options.py +0 -58
- syncsdk-0.1.9/src/sync/common/types/model.py +0 -7
- {syncsdk-0.1.9/src/sync/generations → syncsdk-0.2.1/src/sync/batch}/__init__.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/errors/bad_request_error.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/errors/internal_server_error.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/errors/not_found_error.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/errors/unauthorized_error.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/audio.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/eleven_labs.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/estimated_generation_cost.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/generation_error.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/generation_error_message.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/generation_id.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/generation_status.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/input.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/segment_frames.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/segment_secs.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/tts.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/tts_provider_config.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/common/types/video.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/core/__init__.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/core/api_error.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/core/datetime_utils.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/core/file.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/core/http_client.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/core/http_response.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/core/jsonable_encoder.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/core/pydantic_utilities.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/core/query_encoder.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/core/remove_none_from_dict.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/core/request_options.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/core/serialization.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/core/unchecked_base_model.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/py.typed +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/version.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/webhooks/__init__.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/webhooks/types/__init__.py +0 -0
- {syncsdk-0.1.9 → syncsdk-0.2.1}/src/sync/webhooks/types/webhook_status.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: syncsdk
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary:
|
|
5
5
|
Requires-Python: >=3.8,<4.0
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
@@ -33,7 +33,7 @@ The Sync Python library provides convenient access to the Sync API from Python.
|
|
|
33
33
|
|
|
34
34
|
## Documentation
|
|
35
35
|
|
|
36
|
-
API reference documentation is available [here](https://
|
|
36
|
+
API reference documentation is available [here](https://docs.sync.so/api-reference).
|
|
37
37
|
|
|
38
38
|
## Installation
|
|
39
39
|
|
|
@@ -7,7 +7,7 @@ The Sync Python library provides convenient access to the Sync API from Python.
|
|
|
7
7
|
|
|
8
8
|
## Documentation
|
|
9
9
|
|
|
10
|
-
API reference documentation is available [here](https://
|
|
10
|
+
API reference documentation is available [here](https://docs.sync.so/api-reference).
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from . import common, generations, webhooks
|
|
3
|
+
from . import batch, common, generations, webhooks
|
|
4
4
|
from .client import AsyncSync, Sync
|
|
5
5
|
from .common import (
|
|
6
|
+
ActiveSpeaker,
|
|
6
7
|
Audio,
|
|
7
8
|
BadRequestError,
|
|
9
|
+
BatchId,
|
|
10
|
+
BatchMetrics,
|
|
11
|
+
BatchResponse,
|
|
12
|
+
BatchStatus,
|
|
13
|
+
CreateBatchResponse,
|
|
8
14
|
CreateGenerationDto,
|
|
9
15
|
ElevenLabs,
|
|
10
16
|
EstimatedGenerationCost,
|
|
@@ -18,12 +24,15 @@ from .common import (
|
|
|
18
24
|
InternalServerError,
|
|
19
25
|
Model,
|
|
20
26
|
NotFoundError,
|
|
27
|
+
PaymentRequiredError,
|
|
21
28
|
SegmentFrames,
|
|
22
29
|
SegmentSecs,
|
|
23
30
|
SyncMode,
|
|
31
|
+
TooManyRequestsError,
|
|
24
32
|
Tts,
|
|
25
33
|
TtsProviderConfig,
|
|
26
34
|
UnauthorizedError,
|
|
35
|
+
ValidationResponse,
|
|
27
36
|
Video,
|
|
28
37
|
)
|
|
29
38
|
from .environment import SyncEnvironment
|
|
@@ -31,9 +40,15 @@ from .version import __version__
|
|
|
31
40
|
from .webhooks import GenerationNotification, WebhookStatus
|
|
32
41
|
|
|
33
42
|
__all__ = [
|
|
43
|
+
"ActiveSpeaker",
|
|
34
44
|
"AsyncSync",
|
|
35
45
|
"Audio",
|
|
36
46
|
"BadRequestError",
|
|
47
|
+
"BatchId",
|
|
48
|
+
"BatchMetrics",
|
|
49
|
+
"BatchResponse",
|
|
50
|
+
"BatchStatus",
|
|
51
|
+
"CreateBatchResponse",
|
|
37
52
|
"CreateGenerationDto",
|
|
38
53
|
"ElevenLabs",
|
|
39
54
|
"EstimatedGenerationCost",
|
|
@@ -48,17 +63,21 @@ __all__ = [
|
|
|
48
63
|
"InternalServerError",
|
|
49
64
|
"Model",
|
|
50
65
|
"NotFoundError",
|
|
66
|
+
"PaymentRequiredError",
|
|
51
67
|
"SegmentFrames",
|
|
52
68
|
"SegmentSecs",
|
|
53
69
|
"Sync",
|
|
54
70
|
"SyncEnvironment",
|
|
55
71
|
"SyncMode",
|
|
72
|
+
"TooManyRequestsError",
|
|
56
73
|
"Tts",
|
|
57
74
|
"TtsProviderConfig",
|
|
58
75
|
"UnauthorizedError",
|
|
76
|
+
"ValidationResponse",
|
|
59
77
|
"Video",
|
|
60
78
|
"WebhookStatus",
|
|
61
79
|
"__version__",
|
|
80
|
+
"batch",
|
|
62
81
|
"common",
|
|
63
82
|
"generations",
|
|
64
83
|
"webhooks",
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from ..core.client_wrapper import SyncClientWrapper
|
|
5
|
+
from .raw_client import RawBatchClient
|
|
6
|
+
from .. import core
|
|
7
|
+
from ..core.request_options import RequestOptions
|
|
8
|
+
from ..common.types.create_batch_response import CreateBatchResponse
|
|
9
|
+
from ..common.types.batch_id import BatchId
|
|
10
|
+
from ..common.types.batch_response import BatchResponse
|
|
11
|
+
from ..common.types.batch_status import BatchStatus
|
|
12
|
+
import datetime as dt
|
|
13
|
+
from ..core.client_wrapper import AsyncClientWrapper
|
|
14
|
+
from .raw_client import AsyncRawBatchClient
|
|
15
|
+
|
|
16
|
+
# this is used as the default value for optional parameters
|
|
17
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class BatchClient:
|
|
21
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
22
|
+
self._raw_client = RawBatchClient(client_wrapper=client_wrapper)
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
def with_raw_response(self) -> RawBatchClient:
|
|
26
|
+
"""
|
|
27
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
28
|
+
|
|
29
|
+
Returns
|
|
30
|
+
-------
|
|
31
|
+
RawBatchClient
|
|
32
|
+
"""
|
|
33
|
+
return self._raw_client
|
|
34
|
+
|
|
35
|
+
def create(
|
|
36
|
+
self,
|
|
37
|
+
*,
|
|
38
|
+
input: core.File,
|
|
39
|
+
webhook_url: typing.Optional[str] = OMIT,
|
|
40
|
+
dry_run: typing.Optional[bool] = OMIT,
|
|
41
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
42
|
+
) -> CreateBatchResponse:
|
|
43
|
+
"""
|
|
44
|
+
API for [Batch Processing](/api-reference/guides/batch-processing). Available only for `Scale` and `Enterprise` plans.
|
|
45
|
+
|
|
46
|
+
Parameters
|
|
47
|
+
----------
|
|
48
|
+
input : core.File
|
|
49
|
+
See core.File for more documentation
|
|
50
|
+
|
|
51
|
+
webhook_url : typing.Optional[str]
|
|
52
|
+
Optional webhook URL to receive batch completion notifications. A POST request will be sent when the batch completes or fails.
|
|
53
|
+
|
|
54
|
+
dry_run : typing.Optional[bool]
|
|
55
|
+
When true, validates the input file without processing. Returns validation status without creating generations.
|
|
56
|
+
|
|
57
|
+
request_options : typing.Optional[RequestOptions]
|
|
58
|
+
Request-specific configuration.
|
|
59
|
+
|
|
60
|
+
Returns
|
|
61
|
+
-------
|
|
62
|
+
CreateBatchResponse
|
|
63
|
+
|
|
64
|
+
Examples
|
|
65
|
+
--------
|
|
66
|
+
from sync import Sync
|
|
67
|
+
|
|
68
|
+
client = Sync(
|
|
69
|
+
api_key="YOUR_API_KEY",
|
|
70
|
+
)
|
|
71
|
+
client.batch.create(
|
|
72
|
+
webhook_url="https://your-webhook-url.com/batch-webhook",
|
|
73
|
+
dry_run=False,
|
|
74
|
+
)
|
|
75
|
+
"""
|
|
76
|
+
response = self._raw_client.create(
|
|
77
|
+
input=input, webhook_url=webhook_url, dry_run=dry_run, request_options=request_options
|
|
78
|
+
)
|
|
79
|
+
return response.data
|
|
80
|
+
|
|
81
|
+
def get(self, id: BatchId, *, request_options: typing.Optional[RequestOptions] = None) -> BatchResponse:
|
|
82
|
+
"""
|
|
83
|
+
Retrieve details about a specific batch, including its current status, processing metrics, and output file URL when available.
|
|
84
|
+
|
|
85
|
+
Parameters
|
|
86
|
+
----------
|
|
87
|
+
id : BatchId
|
|
88
|
+
The unique identifier of the batch
|
|
89
|
+
|
|
90
|
+
request_options : typing.Optional[RequestOptions]
|
|
91
|
+
Request-specific configuration.
|
|
92
|
+
|
|
93
|
+
Returns
|
|
94
|
+
-------
|
|
95
|
+
BatchResponse
|
|
96
|
+
|
|
97
|
+
Examples
|
|
98
|
+
--------
|
|
99
|
+
from sync import Sync
|
|
100
|
+
|
|
101
|
+
client = Sync(
|
|
102
|
+
api_key="YOUR_API_KEY",
|
|
103
|
+
)
|
|
104
|
+
client.batch.get(
|
|
105
|
+
id="batch_abc123",
|
|
106
|
+
)
|
|
107
|
+
"""
|
|
108
|
+
response = self._raw_client.get(id, request_options=request_options)
|
|
109
|
+
return response.data
|
|
110
|
+
|
|
111
|
+
def list(
|
|
112
|
+
self,
|
|
113
|
+
*,
|
|
114
|
+
status: typing.Optional[BatchStatus] = None,
|
|
115
|
+
created_after: typing.Optional[dt.datetime] = None,
|
|
116
|
+
created_before: typing.Optional[dt.datetime] = None,
|
|
117
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
118
|
+
) -> typing.List[BatchResponse]:
|
|
119
|
+
"""
|
|
120
|
+
List all batches for your organization with optional filtering by status and creation date. Results are ordered by creation date (newest first).
|
|
121
|
+
|
|
122
|
+
Parameters
|
|
123
|
+
----------
|
|
124
|
+
status : typing.Optional[BatchStatus]
|
|
125
|
+
Filter batches by status
|
|
126
|
+
|
|
127
|
+
created_after : typing.Optional[dt.datetime]
|
|
128
|
+
Filter batches created after this datetime (ISO 8601 format)
|
|
129
|
+
|
|
130
|
+
created_before : typing.Optional[dt.datetime]
|
|
131
|
+
Filter batches created before this datetime (ISO 8601 format)
|
|
132
|
+
|
|
133
|
+
request_options : typing.Optional[RequestOptions]
|
|
134
|
+
Request-specific configuration.
|
|
135
|
+
|
|
136
|
+
Returns
|
|
137
|
+
-------
|
|
138
|
+
typing.List[BatchResponse]
|
|
139
|
+
|
|
140
|
+
Examples
|
|
141
|
+
--------
|
|
142
|
+
from sync import Sync
|
|
143
|
+
|
|
144
|
+
client = Sync(
|
|
145
|
+
api_key="YOUR_API_KEY",
|
|
146
|
+
)
|
|
147
|
+
client.batch.list()
|
|
148
|
+
"""
|
|
149
|
+
response = self._raw_client.list(
|
|
150
|
+
status=status, created_after=created_after, created_before=created_before, request_options=request_options
|
|
151
|
+
)
|
|
152
|
+
return response.data
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
class AsyncBatchClient:
|
|
156
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
157
|
+
self._raw_client = AsyncRawBatchClient(client_wrapper=client_wrapper)
|
|
158
|
+
|
|
159
|
+
@property
|
|
160
|
+
def with_raw_response(self) -> AsyncRawBatchClient:
|
|
161
|
+
"""
|
|
162
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
163
|
+
|
|
164
|
+
Returns
|
|
165
|
+
-------
|
|
166
|
+
AsyncRawBatchClient
|
|
167
|
+
"""
|
|
168
|
+
return self._raw_client
|
|
169
|
+
|
|
170
|
+
async def create(
|
|
171
|
+
self,
|
|
172
|
+
*,
|
|
173
|
+
input: core.File,
|
|
174
|
+
webhook_url: typing.Optional[str] = OMIT,
|
|
175
|
+
dry_run: typing.Optional[bool] = OMIT,
|
|
176
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
177
|
+
) -> CreateBatchResponse:
|
|
178
|
+
"""
|
|
179
|
+
API for [Batch Processing](/api-reference/guides/batch-processing). Available only for `Scale` and `Enterprise` plans.
|
|
180
|
+
|
|
181
|
+
Parameters
|
|
182
|
+
----------
|
|
183
|
+
input : core.File
|
|
184
|
+
See core.File for more documentation
|
|
185
|
+
|
|
186
|
+
webhook_url : typing.Optional[str]
|
|
187
|
+
Optional webhook URL to receive batch completion notifications. A POST request will be sent when the batch completes or fails.
|
|
188
|
+
|
|
189
|
+
dry_run : typing.Optional[bool]
|
|
190
|
+
When true, validates the input file without processing. Returns validation status without creating generations.
|
|
191
|
+
|
|
192
|
+
request_options : typing.Optional[RequestOptions]
|
|
193
|
+
Request-specific configuration.
|
|
194
|
+
|
|
195
|
+
Returns
|
|
196
|
+
-------
|
|
197
|
+
CreateBatchResponse
|
|
198
|
+
|
|
199
|
+
Examples
|
|
200
|
+
--------
|
|
201
|
+
import asyncio
|
|
202
|
+
|
|
203
|
+
from sync import AsyncSync
|
|
204
|
+
|
|
205
|
+
client = AsyncSync(
|
|
206
|
+
api_key="YOUR_API_KEY",
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
async def main() -> None:
|
|
211
|
+
await client.batch.create(
|
|
212
|
+
webhook_url="https://your-webhook-url.com/batch-webhook",
|
|
213
|
+
dry_run=False,
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
asyncio.run(main())
|
|
218
|
+
"""
|
|
219
|
+
response = await self._raw_client.create(
|
|
220
|
+
input=input, webhook_url=webhook_url, dry_run=dry_run, request_options=request_options
|
|
221
|
+
)
|
|
222
|
+
return response.data
|
|
223
|
+
|
|
224
|
+
async def get(self, id: BatchId, *, request_options: typing.Optional[RequestOptions] = None) -> BatchResponse:
|
|
225
|
+
"""
|
|
226
|
+
Retrieve details about a specific batch, including its current status, processing metrics, and output file URL when available.
|
|
227
|
+
|
|
228
|
+
Parameters
|
|
229
|
+
----------
|
|
230
|
+
id : BatchId
|
|
231
|
+
The unique identifier of the batch
|
|
232
|
+
|
|
233
|
+
request_options : typing.Optional[RequestOptions]
|
|
234
|
+
Request-specific configuration.
|
|
235
|
+
|
|
236
|
+
Returns
|
|
237
|
+
-------
|
|
238
|
+
BatchResponse
|
|
239
|
+
|
|
240
|
+
Examples
|
|
241
|
+
--------
|
|
242
|
+
import asyncio
|
|
243
|
+
|
|
244
|
+
from sync import AsyncSync
|
|
245
|
+
|
|
246
|
+
client = AsyncSync(
|
|
247
|
+
api_key="YOUR_API_KEY",
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
async def main() -> None:
|
|
252
|
+
await client.batch.get(
|
|
253
|
+
id="batch_abc123",
|
|
254
|
+
)
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
asyncio.run(main())
|
|
258
|
+
"""
|
|
259
|
+
response = await self._raw_client.get(id, request_options=request_options)
|
|
260
|
+
return response.data
|
|
261
|
+
|
|
262
|
+
async def list(
|
|
263
|
+
self,
|
|
264
|
+
*,
|
|
265
|
+
status: typing.Optional[BatchStatus] = None,
|
|
266
|
+
created_after: typing.Optional[dt.datetime] = None,
|
|
267
|
+
created_before: typing.Optional[dt.datetime] = None,
|
|
268
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
269
|
+
) -> typing.List[BatchResponse]:
|
|
270
|
+
"""
|
|
271
|
+
List all batches for your organization with optional filtering by status and creation date. Results are ordered by creation date (newest first).
|
|
272
|
+
|
|
273
|
+
Parameters
|
|
274
|
+
----------
|
|
275
|
+
status : typing.Optional[BatchStatus]
|
|
276
|
+
Filter batches by status
|
|
277
|
+
|
|
278
|
+
created_after : typing.Optional[dt.datetime]
|
|
279
|
+
Filter batches created after this datetime (ISO 8601 format)
|
|
280
|
+
|
|
281
|
+
created_before : typing.Optional[dt.datetime]
|
|
282
|
+
Filter batches created before this datetime (ISO 8601 format)
|
|
283
|
+
|
|
284
|
+
request_options : typing.Optional[RequestOptions]
|
|
285
|
+
Request-specific configuration.
|
|
286
|
+
|
|
287
|
+
Returns
|
|
288
|
+
-------
|
|
289
|
+
typing.List[BatchResponse]
|
|
290
|
+
|
|
291
|
+
Examples
|
|
292
|
+
--------
|
|
293
|
+
import asyncio
|
|
294
|
+
|
|
295
|
+
from sync import AsyncSync
|
|
296
|
+
|
|
297
|
+
client = AsyncSync(
|
|
298
|
+
api_key="YOUR_API_KEY",
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
async def main() -> None:
|
|
303
|
+
await client.batch.list()
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
asyncio.run(main())
|
|
307
|
+
"""
|
|
308
|
+
response = await self._raw_client.list(
|
|
309
|
+
status=status, created_after=created_after, created_before=created_before, request_options=request_options
|
|
310
|
+
)
|
|
311
|
+
return response.data
|