@@ -2376,6 +2376,76 @@ open class IngestionClient {
23762376 )
23772377 }
23782378
2379+ /// - parameter taskID: (path) Unique identifier of a task.
2380+ /// - parameter batchWriteParams: (body) Request body of a Search API `batch` request that will be pushed in the
2381+ /// Connectors pipeline.
2382+ /// - returns: RunResponse
2383+ @available ( macOS 10 . 15 , iOS 13 . 0 , tvOS 13 . 0 , watchOS 6 . 0 , * )
2384+ open func pushTask(
2385+ taskID: String ,
2386+ batchWriteParams: IngestionBatchWriteParams ,
2387+ requestOptions: RequestOptions ? = nil
2388+ ) async throws -> RunResponse {
2389+ let response : Response < RunResponse > = try await pushTaskWithHTTPInfo (
2390+ taskID: taskID,
2391+ batchWriteParams: batchWriteParams,
2392+ requestOptions: requestOptions
2393+ )
2394+
2395+ guard let body = response. body else {
2396+ throw AlgoliaError . missingData
2397+ }
2398+
2399+ return body
2400+ }
2401+
2402+ // Push a `batch` request payload through the Pipeline. You can check the status of task pushes with the
2403+ // observability endpoints.
2404+ // Required API Key ACLs:
2405+ // - addObject
2406+ // - deleteIndex
2407+ // - editSettings
2408+ //
2409+ // - parameter taskID: (path) Unique identifier of a task.
2410+ //
2411+ // - parameter batchWriteParams: (body) Request body of a Search API `batch` request that will be pushed in the
2412+ // Connectors pipeline.
2413+ // - returns: RequestBuilder<RunResponse>
2414+
2415+ open func pushTaskWithHTTPInfo(
2416+ taskID: String ,
2417+ batchWriteParams: IngestionBatchWriteParams ,
2418+ requestOptions userRequestOptions: RequestOptions ? = nil
2419+ ) async throws -> Response < RunResponse > {
2420+ guard !taskID. isEmpty else {
2421+ throw AlgoliaError . invalidArgument ( " taskID " , " pushTask " )
2422+ }
2423+
2424+ var resourcePath = " /2/tasks/{taskID}/push "
2425+ let taskIDPreEscape = " \( APIHelper . mapValueToPathItem ( taskID) ) "
2426+ let taskIDPostEscape = taskIDPreEscape
2427+ . addingPercentEncoding ( withAllowedCharacters: . urlPathAlgoliaAllowed) ?? " "
2428+ resourcePath = resourcePath. replacingOccurrences (
2429+ of: " {taskID} " ,
2430+ with: taskIDPostEscape,
2431+ options: . literal,
2432+ range: nil
2433+ )
2434+ let body = batchWriteParams
2435+ let queryParameters : [ String : Any ? ] ? = nil
2436+
2437+ let nillableHeaders : [ String : Any ? ] ? = nil
2438+
2439+ let headers = APIHelper . rejectNilHeaders ( nillableHeaders)
2440+
2441+ return try await self . transporter. send (
2442+ method: " POST " ,
2443+ path: resourcePath,
2444+ data: body,
2445+ requestOptions: RequestOptions ( headers: headers, queryParameters: queryParameters) + userRequestOptions
2446+ )
2447+ }
2448+
23792449 /// - parameter taskID: (path) Unique identifier of a task.
23802450 /// - returns: RunResponse
23812451 @available ( macOS 10 . 15 , iOS 13 . 0 , tvOS 13 . 0 , watchOS 6 . 0 , * )
0 commit comments