|
34 | 34 | from algoliasearch.ingestion.models.authentication_update_response import (
|
35 | 35 | AuthenticationUpdateResponse,
|
36 | 36 | )
|
| 37 | +from algoliasearch.ingestion.models.batch_write_params import BatchWriteParams |
37 | 38 | from algoliasearch.ingestion.models.delete_response import DeleteResponse
|
38 | 39 | from algoliasearch.ingestion.models.destination import Destination
|
39 | 40 | from algoliasearch.ingestion.models.destination_create import DestinationCreate
|
@@ -3220,6 +3221,95 @@ async def list_transformations(
|
3220 | 3221 | await self.list_transformations_with_http_info(sort, order, request_options)
|
3221 | 3222 | ).deserialize(ListTransformationsResponse)
|
3222 | 3223 |
|
| 3224 | + async def push_task_with_http_info( |
| 3225 | + self, |
| 3226 | + task_id: Annotated[ |
| 3227 | + StrictStr, Field(description="Unique identifier of a task.") |
| 3228 | + ], |
| 3229 | + batch_write_params: Annotated[ |
| 3230 | + BatchWriteParams, |
| 3231 | + Field( |
| 3232 | + description="Request body of a Search API `batch` request that will be pushed in the Connectors pipeline." |
| 3233 | + ), |
| 3234 | + ], |
| 3235 | + request_options: Optional[Union[dict, RequestOptions]] = None, |
| 3236 | + ) -> ApiResponse[str]: |
| 3237 | + """ |
| 3238 | + Push a `batch` request payload through the Pipeline. You can check the status of task pushes with the observability endpoints. |
| 3239 | +
|
| 3240 | + Required API Key ACLs: |
| 3241 | + - addObject |
| 3242 | + - deleteIndex |
| 3243 | + - editSettings |
| 3244 | +
|
| 3245 | + :param task_id: Unique identifier of a task. (required) |
| 3246 | + :type task_id: str |
| 3247 | + :param batch_write_params: Request body of a Search API `batch` request that will be pushed in the Connectors pipeline. (required) |
| 3248 | + :type batch_write_params: BatchWriteParams |
| 3249 | + :param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional) |
| 3250 | + :return: Returns the raw algoliasearch 'APIResponse' object. |
| 3251 | + """ |
| 3252 | + |
| 3253 | + if task_id is None: |
| 3254 | + raise ValueError( |
| 3255 | + "Parameter `task_id` is required when calling `push_task`." |
| 3256 | + ) |
| 3257 | + |
| 3258 | + if batch_write_params is None: |
| 3259 | + raise ValueError( |
| 3260 | + "Parameter `batch_write_params` is required when calling `push_task`." |
| 3261 | + ) |
| 3262 | + |
| 3263 | + _data = {} |
| 3264 | + if batch_write_params is not None: |
| 3265 | + _data = batch_write_params |
| 3266 | + |
| 3267 | + return await self._transporter.request( |
| 3268 | + verb=Verb.POST, |
| 3269 | + path="/2/tasks/{taskID}/push".replace( |
| 3270 | + "{taskID}", quote(str(task_id), safe="") |
| 3271 | + ), |
| 3272 | + request_options=self._request_options.merge( |
| 3273 | + data=dumps(bodySerializer(_data)), |
| 3274 | + user_request_options=request_options, |
| 3275 | + ), |
| 3276 | + use_read_transporter=False, |
| 3277 | + ) |
| 3278 | + |
| 3279 | + async def push_task( |
| 3280 | + self, |
| 3281 | + task_id: Annotated[ |
| 3282 | + StrictStr, Field(description="Unique identifier of a task.") |
| 3283 | + ], |
| 3284 | + batch_write_params: Annotated[ |
| 3285 | + BatchWriteParams, |
| 3286 | + Field( |
| 3287 | + description="Request body of a Search API `batch` request that will be pushed in the Connectors pipeline." |
| 3288 | + ), |
| 3289 | + ], |
| 3290 | + request_options: Optional[Union[dict, RequestOptions]] = None, |
| 3291 | + ) -> RunResponse: |
| 3292 | + """ |
| 3293 | + Push a `batch` request payload through the Pipeline. You can check the status of task pushes with the observability endpoints. |
| 3294 | +
|
| 3295 | + Required API Key ACLs: |
| 3296 | + - addObject |
| 3297 | + - deleteIndex |
| 3298 | + - editSettings |
| 3299 | +
|
| 3300 | + :param task_id: Unique identifier of a task. (required) |
| 3301 | + :type task_id: str |
| 3302 | + :param batch_write_params: Request body of a Search API `batch` request that will be pushed in the Connectors pipeline. (required) |
| 3303 | + :type batch_write_params: BatchWriteParams |
| 3304 | + :param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional) |
| 3305 | + :return: Returns the deserialized response in a 'RunResponse' result object. |
| 3306 | + """ |
| 3307 | + return ( |
| 3308 | + await self.push_task_with_http_info( |
| 3309 | + task_id, batch_write_params, request_options |
| 3310 | + ) |
| 3311 | + ).deserialize(RunResponse) |
| 3312 | + |
3223 | 3313 | async def run_task_with_http_info(
|
3224 | 3314 | self,
|
3225 | 3315 | task_id: Annotated[
|
|
0 commit comments