Skip to content

Commit e54b331

Browse files
algolia-botmillotp
andcommitted
chore: generated code for commit 3739451a. [skip ci]
algolia/api-clients-automation@3739451 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent e7ee37d commit e54b331

File tree

5 files changed

+35
-63
lines changed

5 files changed

+35
-63
lines changed

packages/ingestion/model/clientMethodProps.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import type { AuthenticationType } from './authenticationType';
55
import type { AuthenticationUpdate } from './authenticationUpdate';
66
import type { DestinationType } from './destinationType';
77
import type { DestinationUpdate } from './destinationUpdate';
8+
import type { EventStatus } from './eventStatus';
9+
import type { EventType } from './eventType';
810
import type { PlatformWithNone } from './platformWithNone';
11+
import type { RunStatus } from './runStatus';
912
import type { SourceType } from './sourceType';
1013
import type { SourceUpdate } from './sourceUpdate';
1114
import type { TaskUpdate } from './taskUpdate';
@@ -165,6 +168,14 @@ export type GetEventsProps = {
165168
* The page number to fetch, starting at 1.
166169
*/
167170
page?: number;
171+
/**
172+
* Filter the status of the events.
173+
*/
174+
status?: EventStatus[];
175+
/**
176+
* Filter the type of the events.
177+
*/
178+
type?: EventType[];
168179
};
169180

170181
/**
@@ -189,24 +200,14 @@ export type GetRunsProps = {
189200
* The page number to fetch, starting at 1.
190201
*/
191202
page?: number;
192-
};
193-
194-
/**
195-
* Properties for the `getRunsByTaskID` method.
196-
*/
197-
export type GetRunsByTaskIDProps = {
198203
/**
199-
* The task uuid.
200-
*/
201-
taskID: string;
202-
/**
203-
* The number of items per page to return.
204+
* Filter the status of the runs.
204205
*/
205-
itemsPerPage?: number;
206+
status?: RunStatus[];
206207
/**
207-
* The page number to fetch, starting at 1.
208+
* Filter by taskID.
208209
*/
209-
page?: number;
210+
taskID?: string;
210211
};
211212

212213
/**

packages/ingestion/model/eventType.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
22

3-
export type EventType = 'fetch' | 'internal' | 'record';
3+
export type EventType = 'fetch' | 'log' | 'record';
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
22

33
import type { Event } from './event';
4-
import type { Pagination } from './pagination';
54

65
export type ListEventsResponse = {
76
events: Event[];
8-
9-
pagination: Pagination;
107
};

packages/ingestion/model/runStatus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
22

3-
export type RunStatus = 'created' | 'finished' | 'started';
3+
export type RunStatus = 'created' | 'finished' | 'idled' | 'started';

packages/ingestion/src/ingestionClient.ts

Lines changed: 18 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import type {
3535
GetEventsProps,
3636
GetRunProps,
3737
GetRunsProps,
38-
GetRunsByTaskIDProps,
3938
GetSourceProps,
4039
GetSourcesProps,
4140
GetTaskProps,
@@ -719,10 +718,12 @@ export function createIngestionClient({
719718
* @param getEvents.runID - The run uuid.
720719
* @param getEvents.itemsPerPage - The number of items per page to return.
721720
* @param getEvents.page - The page number to fetch, starting at 1.
721+
* @param getEvents.status - Filter the status of the events.
722+
* @param getEvents.type - Filter the type of the events.
722723
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
723724
*/
724725
getEvents(
725-
{ runID, itemsPerPage, page }: GetEventsProps,
726+
{ runID, itemsPerPage, page, status, type }: GetEventsProps,
726727
requestOptions?: RequestOptions
727728
): Promise<ListEventsResponse> {
728729
if (!runID) {
@@ -746,6 +747,14 @@ export function createIngestionClient({
746747
queryParameters.page = page.toString();
747748
}
748749

750+
if (status !== undefined) {
751+
queryParameters.status = status.toString();
752+
}
753+
754+
if (type !== undefined) {
755+
queryParameters.type = type.toString();
756+
}
757+
749758
const request: Request = {
750759
method: 'GET',
751760
path: requestPath,
@@ -796,10 +805,12 @@ export function createIngestionClient({
796805
* @param getRuns - The getRuns object.
797806
* @param getRuns.itemsPerPage - The number of items per page to return.
798807
* @param getRuns.page - The page number to fetch, starting at 1.
808+
* @param getRuns.status - Filter the status of the runs.
809+
* @param getRuns.taskID - Filter by taskID.
799810
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
800811
*/
801812
getRuns(
802-
{ itemsPerPage, page }: GetRunsProps = {},
813+
{ itemsPerPage, page, status, taskID }: GetRunsProps = {},
803814
requestOptions: RequestOptions | undefined = undefined
804815
): Promise<RunListResponse> {
805816
const requestPath = '/1/runs';
@@ -814,49 +825,12 @@ export function createIngestionClient({
814825
queryParameters.page = page.toString();
815826
}
816827

817-
const request: Request = {
818-
method: 'GET',
819-
path: requestPath,
820-
queryParameters,
821-
headers,
822-
};
823-
824-
return transporter.request(request, requestOptions);
825-
},
826-
827-
/**
828-
* Get a list of runs associated with a taskID.
829-
*
830-
* @summary Get a list of runs associated with a taskID.
831-
* @param getRunsByTaskID - The getRunsByTaskID object.
832-
* @param getRunsByTaskID.taskID - The task uuid.
833-
* @param getRunsByTaskID.itemsPerPage - The number of items per page to return.
834-
* @param getRunsByTaskID.page - The page number to fetch, starting at 1.
835-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
836-
*/
837-
getRunsByTaskID(
838-
{ taskID, itemsPerPage, page }: GetRunsByTaskIDProps,
839-
requestOptions?: RequestOptions
840-
): Promise<RunListResponse> {
841-
if (!taskID) {
842-
throw new Error(
843-
'Parameter `taskID` is required when calling `getRunsByTaskID`.'
844-
);
845-
}
846-
847-
const requestPath = '/1/runs/tasks/{taskID}'.replace(
848-
'{taskID}',
849-
encodeURIComponent(taskID)
850-
);
851-
const headers: Headers = {};
852-
const queryParameters: QueryParameters = {};
853-
854-
if (itemsPerPage !== undefined) {
855-
queryParameters.itemsPerPage = itemsPerPage.toString();
828+
if (status !== undefined) {
829+
queryParameters.status = status.toString();
856830
}
857831

858-
if (page !== undefined) {
859-
queryParameters.page = page.toString();
832+
if (taskID !== undefined) {
833+
queryParameters.taskID = taskID.toString();
860834
}
861835

862836
const request: Request = {

0 commit comments

Comments
 (0)