Skip to content

Commit

Permalink
[CI] Auto-commit changed files from 'yarn openapi:generate'
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine committed Sep 11, 2024
1 parent 20199e0 commit 07ee306
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export class Client {
this.kbnClient = options.kbnClient;
this.log = options.log;
}
/**
* Create a new list.
*/
async createList(props: CreateListProps) {
this.log.info(`${new Date().toISOString()} Calling API CreateList`);
return this.kbnClient
Expand All @@ -90,6 +93,9 @@ export class Client {
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Create `.lists` and `.items` data streams in the relevant space.
*/
async createListIndex() {
this.log.info(`${new Date().toISOString()} Calling API CreateListIndex`);
return this.kbnClient
Expand All @@ -102,6 +108,14 @@ export class Client {
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Create a list item and associate it with the specified list.
All list items in the same list must be the same type. For example, each list item in an `ip` list must define a specific IP address.
> info
> Before creating a list item, you must create a list.
*/
async createListItem(props: CreateListItemProps) {
this.log.info(`${new Date().toISOString()} Calling API CreateListItem`);
return this.kbnClient
Expand All @@ -115,6 +129,12 @@ export class Client {
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Delete a list using the list ID.
> info
> When you delete a list, all of its list items are also deleted.
*/
async deleteList(props: DeleteListProps) {
this.log.info(`${new Date().toISOString()} Calling API DeleteList`);
return this.kbnClient
Expand All @@ -129,6 +149,9 @@ export class Client {
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Delete the `.lists` and `.items` data streams.
*/
async deleteListIndex() {
this.log.info(`${new Date().toISOString()} Calling API DeleteListIndex`);
return this.kbnClient
Expand All @@ -141,6 +164,9 @@ export class Client {
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Delete a list item using its `id`, or its `list_id` and `value` fields.
*/
async deleteListItem(props: DeleteListItemProps) {
this.log.info(`${new Date().toISOString()} Calling API DeleteListItem`);
return this.kbnClient
Expand All @@ -156,7 +182,7 @@ export class Client {
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Exports list item values from the specified list
* Export list item values from the specified list.
*/
async exportListItems(props: ExportListItemsProps) {
this.log.info(`${new Date().toISOString()} Calling API ExportListItems`);
Expand All @@ -172,6 +198,9 @@ export class Client {
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Get all list items in the specified list.
*/
async findListItems(props: FindListItemsProps) {
this.log.info(`${new Date().toISOString()} Calling API FindListItems`);
return this.kbnClient
Expand All @@ -186,6 +215,9 @@ export class Client {
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Get a paginated subset of lists. By default, the first page is returned, with 20 results per page.
*/
async findLists(props: FindListsProps) {
this.log.info(`${new Date().toISOString()} Calling API FindLists`);
return this.kbnClient
Expand All @@ -201,7 +233,7 @@ export class Client {
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Imports a list of items from a `.txt` or `.csv` file. The maximum file size is 9 million bytes.
* Import list items from a TXT or CSV file. The maximum file size is 9 million bytes.
You can import items to a new or existing list.
Expand All @@ -220,6 +252,9 @@ You can import items to a new or existing list.
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Update specific fields of an existing list using the list ID.
*/
async patchList(props: PatchListProps) {
this.log.info(`${new Date().toISOString()} Calling API PatchList`);
return this.kbnClient
Expand All @@ -233,6 +268,9 @@ You can import items to a new or existing list.
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Update specific fields of an existing list item using the list item ID.
*/
async patchListItem(props: PatchListItemProps) {
this.log.info(`${new Date().toISOString()} Calling API PatchListItem`);
return this.kbnClient
Expand All @@ -246,6 +284,9 @@ You can import items to a new or existing list.
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Get the details of a list using the list ID.
*/
async readList(props: ReadListProps) {
this.log.info(`${new Date().toISOString()} Calling API ReadList`);
return this.kbnClient
Expand All @@ -260,6 +301,9 @@ You can import items to a new or existing list.
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Verify that `.lists` and `.items` data streams exist.
*/
async readListIndex() {
this.log.info(`${new Date().toISOString()} Calling API ReadListIndex`);
return this.kbnClient
Expand All @@ -272,6 +316,9 @@ You can import items to a new or existing list.
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Get the details of a list item.
*/
async readListItem(props: ReadListItemProps) {
this.log.info(`${new Date().toISOString()} Calling API ReadListItem`);
return this.kbnClient
Expand All @@ -298,6 +345,12 @@ You can import items to a new or existing list.
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Update a list using the list ID. The original list is replaced, and all unspecified fields are deleted.
> info
> You cannot modify the `id` value.
*/
async updateList(props: UpdateListProps) {
this.log.info(`${new Date().toISOString()} Calling API UpdateList`);
return this.kbnClient
Expand All @@ -311,6 +364,12 @@ You can import items to a new or existing list.
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Update a list item using the list item ID. The original list item is replaced, and all unspecified fields are deleted.
> info
> You cannot modify the `id` value.
*/
async updateListItem(props: UpdateListItemProps) {
this.log.info(`${new Date().toISOString()} Calling API UpdateListItem`);
return this.kbnClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
const supertest = getService('supertest');

return {
/**
* Create a new list.
*/
createList(props: CreateListProps) {
return supertest
.post('/api/lists')
Expand All @@ -47,13 +50,24 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.send(props.body as object);
},
/**
* Create `.lists` and `.items` data streams in the relevant space.
*/
createListIndex() {
return supertest
.post('/api/lists/index')
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana');
},
/**
* Create a list item and associate it with the specified list.
All list items in the same list must be the same type. For example, each list item in an `ip` list must define a specific IP address.
> info
> Before creating a list item, you must create a list.
*/
createListItem(props: CreateListItemProps) {
return supertest
.post('/api/lists/items')
Expand All @@ -62,6 +76,12 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.send(props.body as object);
},
/**
* Delete a list using the list ID.
> info
> When you delete a list, all of its list items are also deleted.
*/
deleteList(props: DeleteListProps) {
return supertest
.delete('/api/lists')
Expand All @@ -70,13 +90,19 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.query(props.query);
},
/**
* Delete the `.lists` and `.items` data streams.
*/
deleteListIndex() {
return supertest
.delete('/api/lists/index')
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana');
},
/**
* Delete a list item using its `id`, or its `list_id` and `value` fields.
*/
deleteListItem(props: DeleteListItemProps) {
return supertest
.delete('/api/lists/items')
Expand All @@ -86,7 +112,7 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
.query(props.query);
},
/**
* Exports list item values from the specified list
* Export list item values from the specified list.
*/
exportListItems(props: ExportListItemsProps) {
return supertest
Expand All @@ -96,6 +122,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.query(props.query);
},
/**
* Get all list items in the specified list.
*/
findListItems(props: FindListItemsProps) {
return supertest
.get('/api/lists/items/_find')
Expand All @@ -104,6 +133,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.query(props.query);
},
/**
* Get a paginated subset of lists. By default, the first page is returned, with 20 results per page.
*/
findLists(props: FindListsProps) {
return supertest
.get('/api/lists/_find')
Expand All @@ -113,7 +145,7 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
.query(props.query);
},
/**
* Imports a list of items from a `.txt` or `.csv` file. The maximum file size is 9 million bytes.
* Import list items from a TXT or CSV file. The maximum file size is 9 million bytes.
You can import items to a new or existing list.
Expand All @@ -126,6 +158,9 @@ You can import items to a new or existing list.
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.query(props.query);
},
/**
* Update specific fields of an existing list using the list ID.
*/
patchList(props: PatchListProps) {
return supertest
.patch('/api/lists')
Expand All @@ -134,6 +169,9 @@ You can import items to a new or existing list.
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.send(props.body as object);
},
/**
* Update specific fields of an existing list item using the list item ID.
*/
patchListItem(props: PatchListItemProps) {
return supertest
.patch('/api/lists/items')
Expand All @@ -142,6 +180,9 @@ You can import items to a new or existing list.
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.send(props.body as object);
},
/**
* Get the details of a list using the list ID.
*/
readList(props: ReadListProps) {
return supertest
.get('/api/lists')
Expand All @@ -150,13 +191,19 @@ You can import items to a new or existing list.
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.query(props.query);
},
/**
* Verify that `.lists` and `.items` data streams exist.
*/
readListIndex() {
return supertest
.get('/api/lists/index')
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana');
},
/**
* Get the details of a list item.
*/
readListItem(props: ReadListItemProps) {
return supertest
.get('/api/lists/items')
Expand All @@ -172,6 +219,12 @@ You can import items to a new or existing list.
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana');
},
/**
* Update a list using the list ID. The original list is replaced, and all unspecified fields are deleted.
> info
> You cannot modify the `id` value.
*/
updateList(props: UpdateListProps) {
return supertest
.put('/api/lists')
Expand All @@ -180,6 +233,12 @@ You can import items to a new or existing list.
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.send(props.body as object);
},
/**
* Update a list item using the list item ID. The original list item is replaced, and all unspecified fields are deleted.
> info
> You cannot modify the `id` value.
*/
updateListItem(props: UpdateListItemProps) {
return supertest
.put('/api/lists/items')
Expand Down

0 comments on commit 07ee306

Please sign in to comment.