Skip to content

Commit 1aa736a

Browse files
algolia-botshortcutsmillotp
committed
fix(specs): ingestion push task payload [skip-bc] (generated)
algolia/api-clients-automation#3607 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent f997468 commit 1aa736a

File tree

5 files changed

+22
-23
lines changed

5 files changed

+22
-23
lines changed

packages/ingestion/model/clientMethodProps.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type { ActionType } from './actionType';
44
import type { AuthenticationSortKeys } from './authenticationSortKeys';
55
import type { AuthenticationType } from './authenticationType';
66
import type { AuthenticationUpdate } from './authenticationUpdate';
7-
import type { BatchWriteParams } from './batchWriteParams';
87
import type { DestinationSortKeys } from './destinationSortKeys';
98
import type { DestinationType } from './destinationType';
109
import type { DestinationUpdate } from './destinationUpdate';
@@ -13,6 +12,7 @@ import type { EventStatus } from './eventStatus';
1312
import type { EventType } from './eventType';
1413
import type { OrderKeys } from './orderKeys';
1514
import type { PlatformWithNone } from './platformWithNone';
15+
import type { PushTaskPayload } from './pushTaskPayload';
1616
import type { RunSortKeys } from './runSortKeys';
1717
import type { RunSourcePayload } from './runSourcePayload';
1818
import type { RunStatus } from './runStatus';
@@ -567,7 +567,7 @@ export type PushTaskProps = {
567567
/**
568568
* Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
569569
*/
570-
batchWriteParams: BatchWriteParams;
570+
pushTaskPayload: PushTaskPayload;
571571
};
572572

573573
/**

packages/ingestion/model/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ export * from './authenticationSortKeys';
2424
export * from './authenticationType';
2525
export * from './authenticationUpdate';
2626
export * from './authenticationUpdateResponse';
27-
export * from './batchRequest';
28-
export * from './batchWriteParams';
2927
export * from './bigCommerceChannel';
3028
export * from './bigCommerceMetafield';
3129
export * from './bigQueryDataType';
@@ -76,6 +74,8 @@ export * from './pagination';
7674
export * from './platform';
7775
export * from './platformNone';
7876
export * from './platformWithNone';
77+
export * from './pushTaskPayload';
78+
export * from './pushTaskRecords';
7979
export * from './recordType';
8080
export * from './run';
8181
export * from './runListResponse';
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
22

33
import type { Action } from './action';
4+
import type { PushTaskRecords } from './pushTaskRecords';
45

5-
export type BatchRequest = {
6+
export type PushTaskPayload = {
67
action: Action;
78

8-
/**
9-
* Operation arguments (varies with specified `action`).
10-
*/
11-
body: Record<string, unknown>;
9+
records: PushTaskRecords[];
1210
};
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
22

3-
import type { BatchRequest } from './batchRequest';
4-
5-
/**
6-
* Batch parameters.
7-
*/
8-
export type BatchWriteParams = {
9-
requests: BatchRequest[];
3+
export type PushTaskRecords = Record<string, any> & {
4+
/**
5+
* Unique record identifier.
6+
*/
7+
objectID: string;
108
};

packages/ingestion/src/ingestionClient.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,20 +1707,23 @@ export function createIngestionClient({
17071707
*
17081708
* @param pushTask - The pushTask object.
17091709
* @param pushTask.taskID - Unique identifier of a task.
1710-
* @param pushTask.batchWriteParams - Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
1710+
* @param pushTask.pushTaskPayload - Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
17111711
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
17121712
*/
1713-
pushTask({ taskID, batchWriteParams }: PushTaskProps, requestOptions?: RequestOptions): Promise<RunResponse> {
1713+
pushTask({ taskID, pushTaskPayload }: PushTaskProps, requestOptions?: RequestOptions): Promise<RunResponse> {
17141714
if (!taskID) {
17151715
throw new Error('Parameter `taskID` is required when calling `pushTask`.');
17161716
}
17171717

1718-
if (!batchWriteParams) {
1719-
throw new Error('Parameter `batchWriteParams` is required when calling `pushTask`.');
1718+
if (!pushTaskPayload) {
1719+
throw new Error('Parameter `pushTaskPayload` is required when calling `pushTask`.');
17201720
}
17211721

1722-
if (!batchWriteParams.requests) {
1723-
throw new Error('Parameter `batchWriteParams.requests` is required when calling `pushTask`.');
1722+
if (!pushTaskPayload.action) {
1723+
throw new Error('Parameter `pushTaskPayload.action` is required when calling `pushTask`.');
1724+
}
1725+
if (!pushTaskPayload.records) {
1726+
throw new Error('Parameter `pushTaskPayload.records` is required when calling `pushTask`.');
17241727
}
17251728

17261729
const requestPath = '/2/tasks/{taskID}/push'.replace('{taskID}', encodeURIComponent(taskID));
@@ -1732,7 +1735,7 @@ export function createIngestionClient({
17321735
path: requestPath,
17331736
queryParameters,
17341737
headers,
1735-
data: batchWriteParams,
1738+
data: pushTaskPayload,
17361739
};
17371740

17381741
return transporter.request(request, requestOptions);

0 commit comments

Comments
 (0)