From f609271107e26ab41e9e850df86524c9c26ce0d6 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Wed, 7 Aug 2024 02:31:05 +1000 Subject: [PATCH] Auto-generated code for 8.15 (#2322) --- docs/reference.asciidoc | 477 ++++++++++++- src/api/api/connector.ts | 1318 +++++++++++++++++++++++++++++++++++ src/api/index.ts | 8 + src/api/types.ts | 83 ++- src/api/typesWithBodyKey.ts | 83 ++- 5 files changed, 1942 insertions(+), 27 deletions(-) create mode 100644 src/api/api/connector.ts diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index d03f09cd3..8aacbc5a4 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -2756,6 +2756,481 @@ client.cluster.stats({ ... }) If a node does not respond before its timeout expires, the response does not include its stats. However, timed out nodes are included in the response’s `_nodes.failed` property. Defaults to no timeout. +[discrete] +=== connector +[discrete] +==== check_in +Updates the last_seen field in the connector, and sets it to current timestamp + +{ref}/check-in-connector-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.checkIn({ connector_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (string)*: The unique identifier of the connector to be checked in + +[discrete] +==== delete +Deletes a connector. + +{ref}/delete-connector-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.delete({ connector_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (string)*: The unique identifier of the connector to be deleted +** *`delete_sync_jobs` (Optional, boolean)*: A flag indicating if associated sync jobs should be also removed. Defaults to false. + +[discrete] +==== get +Retrieves a connector. + +{ref}/get-connector-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.get({ connector_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (string)*: The unique identifier of the connector + +[discrete] +==== list +Returns existing connectors. + +{ref}/list-connector-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.list({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`from` (Optional, number)*: Starting offset (default: 0) +** *`size` (Optional, number)*: Specifies a max number of results to get +** *`index_name` (Optional, string | string[])*: A list of connector index names to fetch connector documents for +** *`connector_name` (Optional, string | string[])*: A list of connector names to fetch connector documents for +** *`service_type` (Optional, string | string[])*: A list of connector service types to fetch connector documents for +** *`query` (Optional, string)*: A wildcard query string that filters connectors with matching name, description or index name + +[discrete] +==== post +Creates a connector. + +{ref}/create-connector-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.post({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`description` (Optional, string)* +** *`index_name` (Optional, string)* +** *`is_native` (Optional, boolean)* +** *`language` (Optional, string)* +** *`name` (Optional, string)* +** *`service_type` (Optional, string)* + +[discrete] +==== put +Creates or updates a connector. + +{ref}/create-connector-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.put({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (Optional, string)*: The unique identifier of the connector to be created or updated. ID is auto-generated if not provided. +** *`description` (Optional, string)* +** *`index_name` (Optional, string)* +** *`is_native` (Optional, boolean)* +** *`language` (Optional, string)* +** *`name` (Optional, string)* +** *`service_type` (Optional, string)* + +[discrete] +==== sync_job_cancel +Cancels a connector sync job. + +{ref}/cancel-connector-sync-job-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.syncJobCancel({ connector_sync_job_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_sync_job_id` (string)*: The unique identifier of the connector sync job + +[discrete] +==== sync_job_check_in +Checks in a connector sync job (refreshes 'last_seen'). + +{ref}/check-in-connector-sync-job-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.syncJobCheckIn() +---- + + +[discrete] +==== sync_job_claim +Claims a connector sync job. +[source,ts] +---- +client.connector.syncJobClaim() +---- + + +[discrete] +==== sync_job_delete +Deletes a connector sync job. + +{ref}/delete-connector-sync-job-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.syncJobDelete({ connector_sync_job_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_sync_job_id` (string)*: The unique identifier of the connector sync job to be deleted + +[discrete] +==== sync_job_error +Sets an error for a connector sync job. + +{ref}/set-connector-sync-job-error-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.syncJobError() +---- + + +[discrete] +==== sync_job_get +Retrieves a connector sync job. + +{ref}/get-connector-sync-job-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.syncJobGet({ connector_sync_job_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_sync_job_id` (string)*: The unique identifier of the connector sync job + +[discrete] +==== sync_job_list +Lists connector sync jobs. + +{ref}/list-connector-sync-jobs-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.syncJobList({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`from` (Optional, number)*: Starting offset (default: 0) +** *`size` (Optional, number)*: Specifies a max number of results to get +** *`status` (Optional, Enum("canceling" | "canceled" | "completed" | "error" | "in_progress" | "pending" | "suspended"))*: A sync job status to fetch connector sync jobs for +** *`connector_id` (Optional, string)*: A connector id to fetch connector sync jobs for +** *`job_type` (Optional, Enum("full" | "incremental" | "access_control") | Enum("full" | "incremental" | "access_control")[])*: A list of job types to fetch the sync jobs for + +[discrete] +==== sync_job_post +Creates a connector sync job. + +{ref}/create-connector-sync-job-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.syncJobPost({ id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`id` (string)*: The id of the associated connector +** *`job_type` (Optional, Enum("full" | "incremental" | "access_control"))* +** *`trigger_method` (Optional, Enum("on_demand" | "scheduled"))* + +[discrete] +==== sync_job_update_stats +Updates the stats fields in the connector sync job document. + +{ref}/set-connector-sync-job-stats-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.syncJobUpdateStats() +---- + + +[discrete] +==== update_active_filtering +Activates the valid draft filtering for a connector. + +{ref}/update-connector-filtering-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.updateActiveFiltering({ connector_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (string)*: The unique identifier of the connector to be updated + +[discrete] +==== update_api_key_id +Updates the API key id in the connector document + +{ref}/update-connector-api-key-id-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.updateApiKeyId({ connector_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (string)*: The unique identifier of the connector to be updated +** *`api_key_id` (Optional, string)* +** *`api_key_secret_id` (Optional, string)* + +[discrete] +==== update_configuration +Updates the configuration field in the connector document + +{ref}/update-connector-configuration-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.updateConfiguration({ connector_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (string)*: The unique identifier of the connector to be updated +** *`configuration` (Optional, Record)* +** *`values` (Optional, Record)* + +[discrete] +==== update_error +Updates the filtering field in the connector document + +{ref}/update-connector-error-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.updateError({ connector_id, error }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (string)*: The unique identifier of the connector to be updated +** *`error` (T | null)* + +[discrete] +==== update_features +Updates the connector features in the connector document. + +{ref}/update-connector-features-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.updateFeatures() +---- + + +[discrete] +==== update_filtering +Updates the filtering field in the connector document + +{ref}/update-connector-filtering-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.updateFiltering({ connector_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (string)*: The unique identifier of the connector to be updated +** *`filtering` (Optional, { active, domain, draft }[])* +** *`rules` (Optional, { created_at, field, id, order, policy, rule, updated_at, value }[])* +** *`advanced_snippet` (Optional, { created_at, updated_at, value })* + +[discrete] +==== update_filtering_validation +Updates the draft filtering validation info for a connector. +[source,ts] +---- +client.connector.updateFilteringValidation({ connector_id, validation }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (string)*: The unique identifier of the connector to be updated +** *`validation` ({ errors, state })* + +[discrete] +==== update_index_name +Updates the index_name in the connector document + +{ref}/update-connector-index-name-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.updateIndexName({ connector_id, index_name }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (string)*: The unique identifier of the connector to be updated +** *`index_name` (T | null)* + +[discrete] +==== update_name +Updates the name and description fields in the connector document + +{ref}/update-connector-name-description-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.updateName({ connector_id }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (string)*: The unique identifier of the connector to be updated +** *`name` (Optional, string)* +** *`description` (Optional, string)* + +[discrete] +==== update_native +Updates the is_native flag in the connector document +[source,ts] +---- +client.connector.updateNative({ connector_id, is_native }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (string)*: The unique identifier of the connector to be updated +** *`is_native` (boolean)* + +[discrete] +==== update_pipeline +Updates the pipeline field in the connector document + +{ref}/update-connector-pipeline-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.updatePipeline({ connector_id, pipeline }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (string)*: The unique identifier of the connector to be updated +** *`pipeline` ({ extract_binary_content, name, reduce_whitespace, run_ml_inference })* + +[discrete] +==== update_scheduling +Updates the scheduling field in the connector document + +{ref}/update-connector-scheduling-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.updateScheduling({ connector_id, scheduling }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (string)*: The unique identifier of the connector to be updated +** *`scheduling` ({ access_control, full, incremental })* + +[discrete] +==== update_service_type +Updates the service type of the connector + +{ref}/update-connector-service-type-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.updateServiceType({ connector_id, service_type }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (string)*: The unique identifier of the connector to be updated +** *`service_type` (string)* + +[discrete] +==== update_status +Updates the status of the connector + +{ref}/update-connector-status-api.html[Endpoint documentation] +[source,ts] +---- +client.connector.updateStatus({ connector_id, status }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`connector_id` (string)*: The unique identifier of the connector to be updated +** *`status` (Enum("created" | "needs_configuration" | "configured" | "connected" | "error"))* + [discrete] === dangling_indices [discrete] @@ -8999,7 +9474,7 @@ client.security.putPrivileges({ ... }) ==== Arguments * *Request (object):* -** *`privileges` (Optional, Record>)* +** *`privileges` (Optional, Record>)* ** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. [discrete] diff --git a/src/api/api/connector.ts b/src/api/api/connector.ts new file mode 100644 index 000000000..e76484682 --- /dev/null +++ b/src/api/api/connector.ts @@ -0,0 +1,1318 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-misused-new */ +/* eslint-disable @typescript-eslint/no-extraneous-class */ +/* eslint-disable @typescript-eslint/no-unused-vars */ + +// This file was automatically generated by elastic/elastic-client-generator-js +// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file, +// and elastic/elastic-client-generator-js to regenerate this file again. + +import { + Transport, + TransportRequestMetadata, + TransportRequestOptions, + TransportRequestOptionsWithMeta, + TransportRequestOptionsWithOutMeta, + TransportResult +} from '@elastic/transport' +import * as T from '../types' +import * as TB from '../typesWithBodyKey' +interface That { transport: Transport } + +export default class Connector { + transport: Transport + constructor (transport: Transport) { + this.transport = transport + } + + /** + * Updates the last_seen field in the connector, and sets it to current timestamp + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/check-in-connector-api.html | Elasticsearch API documentation} + */ + async checkIn (this: That, params: T.ConnectorCheckInRequest | TB.ConnectorCheckInRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async checkIn (this: That, params: T.ConnectorCheckInRequest | TB.ConnectorCheckInRequest, options?: TransportRequestOptionsWithMeta): Promise> + async checkIn (this: That, params: T.ConnectorCheckInRequest | TB.ConnectorCheckInRequest, options?: TransportRequestOptions): Promise + async checkIn (this: That, params: T.ConnectorCheckInRequest | TB.ConnectorCheckInRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_check_in` + const meta: TransportRequestMetadata = { + name: 'connector.check_in', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Deletes a connector. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/delete-connector-api.html | Elasticsearch API documentation} + */ + async delete (this: That, params: T.ConnectorDeleteRequest | TB.ConnectorDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async delete (this: That, params: T.ConnectorDeleteRequest | TB.ConnectorDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> + async delete (this: That, params: T.ConnectorDeleteRequest | TB.ConnectorDeleteRequest, options?: TransportRequestOptions): Promise + async delete (this: That, params: T.ConnectorDeleteRequest | TB.ConnectorDeleteRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'DELETE' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}` + const meta: TransportRequestMetadata = { + name: 'connector.delete', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Retrieves a connector. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/get-connector-api.html | Elasticsearch API documentation} + */ + async get (this: That, params: T.ConnectorGetRequest | TB.ConnectorGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async get (this: That, params: T.ConnectorGetRequest | TB.ConnectorGetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async get (this: That, params: T.ConnectorGetRequest | TB.ConnectorGetRequest, options?: TransportRequestOptions): Promise + async get (this: That, params: T.ConnectorGetRequest | TB.ConnectorGetRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}` + const meta: TransportRequestMetadata = { + name: 'connector.get', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Updates last sync stats in the connector document + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/update-connector-last-sync-api.html | Elasticsearch API documentation} + */ + async lastSync (this: That, params: T.ConnectorLastSyncRequest | TB.ConnectorLastSyncRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async lastSync (this: That, params: T.ConnectorLastSyncRequest | TB.ConnectorLastSyncRequest, options?: TransportRequestOptionsWithMeta): Promise> + async lastSync (this: That, params: T.ConnectorLastSyncRequest | TB.ConnectorLastSyncRequest, options?: TransportRequestOptions): Promise + async lastSync (this: That, params: T.ConnectorLastSyncRequest | TB.ConnectorLastSyncRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const acceptedBody: string[] = ['last_access_control_sync_error', 'last_access_control_sync_scheduled_at', 'last_access_control_sync_status', 'last_deleted_document_count', 'last_incremental_sync_scheduled_at', 'last_indexed_document_count', 'last_seen', 'last_sync_error', 'last_sync_scheduled_at', 'last_sync_status', 'last_synced', 'sync_cursor'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_last_sync` + const meta: TransportRequestMetadata = { + name: 'connector.last_sync', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Returns existing connectors. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/list-connector-api.html | Elasticsearch API documentation} + */ + async list (this: That, params?: T.ConnectorListRequest | TB.ConnectorListRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async list (this: That, params?: T.ConnectorListRequest | TB.ConnectorListRequest, options?: TransportRequestOptionsWithMeta): Promise> + async list (this: That, params?: T.ConnectorListRequest | TB.ConnectorListRequest, options?: TransportRequestOptions): Promise + async list (this: That, params?: T.ConnectorListRequest | TB.ConnectorListRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = '/_connector' + const meta: TransportRequestMetadata = { + name: 'connector.list' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Creates a connector. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/create-connector-api.html | Elasticsearch API documentation} + */ + async post (this: That, params?: T.ConnectorPostRequest | TB.ConnectorPostRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async post (this: That, params?: T.ConnectorPostRequest | TB.ConnectorPostRequest, options?: TransportRequestOptionsWithMeta): Promise> + async post (this: That, params?: T.ConnectorPostRequest | TB.ConnectorPostRequest, options?: TransportRequestOptions): Promise + async post (this: That, params?: T.ConnectorPostRequest | TB.ConnectorPostRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const acceptedBody: string[] = ['description', 'index_name', 'is_native', 'language', 'name', 'service_type'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + params = params ?? {} + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'POST' + const path = '/_connector' + const meta: TransportRequestMetadata = { + name: 'connector.post' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Creates or updates a connector. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/create-connector-api.html | Elasticsearch API documentation} + */ + async put (this: That, params?: T.ConnectorPutRequest | TB.ConnectorPutRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async put (this: That, params?: T.ConnectorPutRequest | TB.ConnectorPutRequest, options?: TransportRequestOptionsWithMeta): Promise> + async put (this: That, params?: T.ConnectorPutRequest | TB.ConnectorPutRequest, options?: TransportRequestOptions): Promise + async put (this: That, params?: T.ConnectorPutRequest | TB.ConnectorPutRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const acceptedBody: string[] = ['description', 'index_name', 'is_native', 'language', 'name', 'service_type'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + params = params ?? {} + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + let method = '' + let path = '' + if (params.connector_id != null) { + method = 'PUT' + path = `/_connector/${encodeURIComponent(params.connector_id.toString())}` + } else { + method = 'PUT' + path = '/_connector' + } + const meta: TransportRequestMetadata = { + name: 'connector.put', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Deletes a connector secret. + */ + async secretDelete (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async secretDelete (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async secretDelete (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async secretDelete (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'DELETE' + const path = `/_connector/_secret/${encodeURIComponent(params.id.toString())}` + const meta: TransportRequestMetadata = { + name: 'connector.secret_delete', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Retrieves a secret stored by Connectors. + */ + async secretGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async secretGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async secretGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async secretGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = `/_connector/_secret/${encodeURIComponent(params.id.toString())}` + const meta: TransportRequestMetadata = { + name: 'connector.secret_get', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Creates a secret for a Connector. + */ + async secretPost (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async secretPost (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async secretPost (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async secretPost (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'POST' + const path = '/_connector/_secret' + const meta: TransportRequestMetadata = { + name: 'connector.secret_post' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Creates or updates a secret for a Connector. + */ + async secretPut (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async secretPut (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async secretPut (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async secretPut (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['id'] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/_secret/${encodeURIComponent(params.id.toString())}` + const meta: TransportRequestMetadata = { + name: 'connector.secret_put', + pathParts: { + id: params.id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Cancels a connector sync job. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/cancel-connector-sync-job-api.html | Elasticsearch API documentation} + */ + async syncJobCancel (this: That, params: T.ConnectorSyncJobCancelRequest | TB.ConnectorSyncJobCancelRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobCancel (this: That, params: T.ConnectorSyncJobCancelRequest | TB.ConnectorSyncJobCancelRequest, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobCancel (this: That, params: T.ConnectorSyncJobCancelRequest | TB.ConnectorSyncJobCancelRequest, options?: TransportRequestOptions): Promise + async syncJobCancel (this: That, params: T.ConnectorSyncJobCancelRequest | TB.ConnectorSyncJobCancelRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_sync_job_id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/_sync_job/${encodeURIComponent(params.connector_sync_job_id.toString())}/_cancel` + const meta: TransportRequestMetadata = { + name: 'connector.sync_job_cancel', + pathParts: { + connector_sync_job_id: params.connector_sync_job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Checks in a connector sync job (refreshes 'last_seen'). + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/check-in-connector-sync-job-api.html | Elasticsearch API documentation} + */ + async syncJobCheckIn (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobCheckIn (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobCheckIn (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async syncJobCheckIn (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_sync_job_id'] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/_sync_job/${encodeURIComponent(params.connector_sync_job_id.toString())}/_check_in` + const meta: TransportRequestMetadata = { + name: 'connector.sync_job_check_in', + pathParts: { + connector_sync_job_id: params.connector_sync_job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Claims a connector sync job. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/claim-connector-sync-job-api.html | Elasticsearch API documentation} + */ + async syncJobClaim (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobClaim (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobClaim (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async syncJobClaim (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_sync_job_id'] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/_sync_job/${encodeURIComponent(params.connector_sync_job_id.toString())}/_claim` + const meta: TransportRequestMetadata = { + name: 'connector.sync_job_claim', + pathParts: { + connector_sync_job_id: params.connector_sync_job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Deletes a connector sync job. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/delete-connector-sync-job-api.html | Elasticsearch API documentation} + */ + async syncJobDelete (this: That, params: T.ConnectorSyncJobDeleteRequest | TB.ConnectorSyncJobDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobDelete (this: That, params: T.ConnectorSyncJobDeleteRequest | TB.ConnectorSyncJobDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobDelete (this: That, params: T.ConnectorSyncJobDeleteRequest | TB.ConnectorSyncJobDeleteRequest, options?: TransportRequestOptions): Promise + async syncJobDelete (this: That, params: T.ConnectorSyncJobDeleteRequest | TB.ConnectorSyncJobDeleteRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_sync_job_id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'DELETE' + const path = `/_connector/_sync_job/${encodeURIComponent(params.connector_sync_job_id.toString())}` + const meta: TransportRequestMetadata = { + name: 'connector.sync_job_delete', + pathParts: { + connector_sync_job_id: params.connector_sync_job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Sets an error for a connector sync job. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/set-connector-sync-job-error-api.html | Elasticsearch API documentation} + */ + async syncJobError (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobError (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobError (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async syncJobError (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_sync_job_id'] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/_sync_job/${encodeURIComponent(params.connector_sync_job_id.toString())}/_error` + const meta: TransportRequestMetadata = { + name: 'connector.sync_job_error', + pathParts: { + connector_sync_job_id: params.connector_sync_job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Retrieves a connector sync job. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/get-connector-sync-job-api.html | Elasticsearch API documentation} + */ + async syncJobGet (this: That, params: T.ConnectorSyncJobGetRequest | TB.ConnectorSyncJobGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobGet (this: That, params: T.ConnectorSyncJobGetRequest | TB.ConnectorSyncJobGetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobGet (this: That, params: T.ConnectorSyncJobGetRequest | TB.ConnectorSyncJobGetRequest, options?: TransportRequestOptions): Promise + async syncJobGet (this: That, params: T.ConnectorSyncJobGetRequest | TB.ConnectorSyncJobGetRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_sync_job_id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = `/_connector/_sync_job/${encodeURIComponent(params.connector_sync_job_id.toString())}` + const meta: TransportRequestMetadata = { + name: 'connector.sync_job_get', + pathParts: { + connector_sync_job_id: params.connector_sync_job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Lists connector sync jobs. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/list-connector-sync-jobs-api.html | Elasticsearch API documentation} + */ + async syncJobList (this: That, params?: T.ConnectorSyncJobListRequest | TB.ConnectorSyncJobListRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobList (this: That, params?: T.ConnectorSyncJobListRequest | TB.ConnectorSyncJobListRequest, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobList (this: That, params?: T.ConnectorSyncJobListRequest | TB.ConnectorSyncJobListRequest, options?: TransportRequestOptions): Promise + async syncJobList (this: That, params?: T.ConnectorSyncJobListRequest | TB.ConnectorSyncJobListRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = '/_connector/_sync_job' + const meta: TransportRequestMetadata = { + name: 'connector.sync_job_list' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Creates a connector sync job. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/create-connector-sync-job-api.html | Elasticsearch API documentation} + */ + async syncJobPost (this: That, params: T.ConnectorSyncJobPostRequest | TB.ConnectorSyncJobPostRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobPost (this: That, params: T.ConnectorSyncJobPostRequest | TB.ConnectorSyncJobPostRequest, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobPost (this: That, params: T.ConnectorSyncJobPostRequest | TB.ConnectorSyncJobPostRequest, options?: TransportRequestOptions): Promise + async syncJobPost (this: That, params: T.ConnectorSyncJobPostRequest | TB.ConnectorSyncJobPostRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = [] + const acceptedBody: string[] = ['id', 'job_type', 'trigger_method'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'POST' + const path = '/_connector/_sync_job' + const meta: TransportRequestMetadata = { + name: 'connector.sync_job_post' + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Updates the stats fields in the connector sync job document. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/set-connector-sync-job-stats-api.html | Elasticsearch API documentation} + */ + async syncJobUpdateStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobUpdateStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobUpdateStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async syncJobUpdateStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_sync_job_id'] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/_sync_job/${encodeURIComponent(params.connector_sync_job_id.toString())}/_stats` + const meta: TransportRequestMetadata = { + name: 'connector.sync_job_update_stats', + pathParts: { + connector_sync_job_id: params.connector_sync_job_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Activates the valid draft filtering for a connector. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/update-connector-filtering-api.html | Elasticsearch API documentation} + */ + async updateActiveFiltering (this: That, params: T.ConnectorUpdateActiveFilteringRequest | TB.ConnectorUpdateActiveFilteringRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateActiveFiltering (this: That, params: T.ConnectorUpdateActiveFilteringRequest | TB.ConnectorUpdateActiveFilteringRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateActiveFiltering (this: That, params: T.ConnectorUpdateActiveFilteringRequest | TB.ConnectorUpdateActiveFilteringRequest, options?: TransportRequestOptions): Promise + async updateActiveFiltering (this: That, params: T.ConnectorUpdateActiveFilteringRequest | TB.ConnectorUpdateActiveFilteringRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const querystring: Record = {} + const body = undefined + + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_filtering/_activate` + const meta: TransportRequestMetadata = { + name: 'connector.update_active_filtering', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Updates the API key id in the connector document + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/update-connector-api-key-id-api.html | Elasticsearch API documentation} + */ + async updateApiKeyId (this: That, params: T.ConnectorUpdateApiKeyIdRequest | TB.ConnectorUpdateApiKeyIdRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateApiKeyId (this: That, params: T.ConnectorUpdateApiKeyIdRequest | TB.ConnectorUpdateApiKeyIdRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateApiKeyId (this: That, params: T.ConnectorUpdateApiKeyIdRequest | TB.ConnectorUpdateApiKeyIdRequest, options?: TransportRequestOptions): Promise + async updateApiKeyId (this: That, params: T.ConnectorUpdateApiKeyIdRequest | TB.ConnectorUpdateApiKeyIdRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const acceptedBody: string[] = ['api_key_id', 'api_key_secret_id'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_api_key_id` + const meta: TransportRequestMetadata = { + name: 'connector.update_api_key_id', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Updates the configuration field in the connector document + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/update-connector-configuration-api.html | Elasticsearch API documentation} + */ + async updateConfiguration (this: That, params: T.ConnectorUpdateConfigurationRequest | TB.ConnectorUpdateConfigurationRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateConfiguration (this: That, params: T.ConnectorUpdateConfigurationRequest | TB.ConnectorUpdateConfigurationRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateConfiguration (this: That, params: T.ConnectorUpdateConfigurationRequest | TB.ConnectorUpdateConfigurationRequest, options?: TransportRequestOptions): Promise + async updateConfiguration (this: That, params: T.ConnectorUpdateConfigurationRequest | TB.ConnectorUpdateConfigurationRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const acceptedBody: string[] = ['configuration', 'values'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_configuration` + const meta: TransportRequestMetadata = { + name: 'connector.update_configuration', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Updates the filtering field in the connector document + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/update-connector-error-api.html | Elasticsearch API documentation} + */ + async updateError (this: That, params: T.ConnectorUpdateErrorRequest | TB.ConnectorUpdateErrorRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateError (this: That, params: T.ConnectorUpdateErrorRequest | TB.ConnectorUpdateErrorRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateError (this: That, params: T.ConnectorUpdateErrorRequest | TB.ConnectorUpdateErrorRequest, options?: TransportRequestOptions): Promise + async updateError (this: That, params: T.ConnectorUpdateErrorRequest | TB.ConnectorUpdateErrorRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const acceptedBody: string[] = ['error'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_error` + const meta: TransportRequestMetadata = { + name: 'connector.update_error', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Updates the connector features in the connector document. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/update-connector-features-api.html | Elasticsearch API documentation} + */ + async updateFeatures (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async updateFeatures (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async updateFeatures (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise + async updateFeatures (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const querystring: Record = {} + const body = undefined + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_features` + const meta: TransportRequestMetadata = { + name: 'connector.update_features', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Updates the filtering field in the connector document + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/update-connector-filtering-api.html | Elasticsearch API documentation} + */ + async updateFiltering (this: That, params: T.ConnectorUpdateFilteringRequest | TB.ConnectorUpdateFilteringRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateFiltering (this: That, params: T.ConnectorUpdateFilteringRequest | TB.ConnectorUpdateFilteringRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateFiltering (this: That, params: T.ConnectorUpdateFilteringRequest | TB.ConnectorUpdateFilteringRequest, options?: TransportRequestOptions): Promise + async updateFiltering (this: That, params: T.ConnectorUpdateFilteringRequest | TB.ConnectorUpdateFilteringRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const acceptedBody: string[] = ['filtering', 'rules', 'advanced_snippet'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_filtering` + const meta: TransportRequestMetadata = { + name: 'connector.update_filtering', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Updates the draft filtering validation info for a connector. + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/update-connector-filtering-validation-api.html | Elasticsearch API documentation} + */ + async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest | TB.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest | TB.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest | TB.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptions): Promise + async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest | TB.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const acceptedBody: string[] = ['validation'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_filtering/_validation` + const meta: TransportRequestMetadata = { + name: 'connector.update_filtering_validation', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Updates the index_name in the connector document + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/update-connector-index-name-api.html | Elasticsearch API documentation} + */ + async updateIndexName (this: That, params: T.ConnectorUpdateIndexNameRequest | TB.ConnectorUpdateIndexNameRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateIndexName (this: That, params: T.ConnectorUpdateIndexNameRequest | TB.ConnectorUpdateIndexNameRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateIndexName (this: That, params: T.ConnectorUpdateIndexNameRequest | TB.ConnectorUpdateIndexNameRequest, options?: TransportRequestOptions): Promise + async updateIndexName (this: That, params: T.ConnectorUpdateIndexNameRequest | TB.ConnectorUpdateIndexNameRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const acceptedBody: string[] = ['index_name'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_index_name` + const meta: TransportRequestMetadata = { + name: 'connector.update_index_name', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Updates the name and description fields in the connector document + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/update-connector-name-description-api.html | Elasticsearch API documentation} + */ + async updateName (this: That, params: T.ConnectorUpdateNameRequest | TB.ConnectorUpdateNameRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateName (this: That, params: T.ConnectorUpdateNameRequest | TB.ConnectorUpdateNameRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateName (this: That, params: T.ConnectorUpdateNameRequest | TB.ConnectorUpdateNameRequest, options?: TransportRequestOptions): Promise + async updateName (this: That, params: T.ConnectorUpdateNameRequest | TB.ConnectorUpdateNameRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const acceptedBody: string[] = ['name', 'description'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_name` + const meta: TransportRequestMetadata = { + name: 'connector.update_name', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Updates the is_native flag in the connector document + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/update-connector-native-api.html | Elasticsearch API documentation} + */ + async updateNative (this: That, params: T.ConnectorUpdateNativeRequest | TB.ConnectorUpdateNativeRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateNative (this: That, params: T.ConnectorUpdateNativeRequest | TB.ConnectorUpdateNativeRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateNative (this: That, params: T.ConnectorUpdateNativeRequest | TB.ConnectorUpdateNativeRequest, options?: TransportRequestOptions): Promise + async updateNative (this: That, params: T.ConnectorUpdateNativeRequest | TB.ConnectorUpdateNativeRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const acceptedBody: string[] = ['is_native'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_native` + const meta: TransportRequestMetadata = { + name: 'connector.update_native', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Updates the pipeline field in the connector document + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/update-connector-pipeline-api.html | Elasticsearch API documentation} + */ + async updatePipeline (this: That, params: T.ConnectorUpdatePipelineRequest | TB.ConnectorUpdatePipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updatePipeline (this: That, params: T.ConnectorUpdatePipelineRequest | TB.ConnectorUpdatePipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updatePipeline (this: That, params: T.ConnectorUpdatePipelineRequest | TB.ConnectorUpdatePipelineRequest, options?: TransportRequestOptions): Promise + async updatePipeline (this: That, params: T.ConnectorUpdatePipelineRequest | TB.ConnectorUpdatePipelineRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const acceptedBody: string[] = ['pipeline'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_pipeline` + const meta: TransportRequestMetadata = { + name: 'connector.update_pipeline', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Updates the scheduling field in the connector document + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/update-connector-scheduling-api.html | Elasticsearch API documentation} + */ + async updateScheduling (this: That, params: T.ConnectorUpdateSchedulingRequest | TB.ConnectorUpdateSchedulingRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateScheduling (this: That, params: T.ConnectorUpdateSchedulingRequest | TB.ConnectorUpdateSchedulingRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateScheduling (this: That, params: T.ConnectorUpdateSchedulingRequest | TB.ConnectorUpdateSchedulingRequest, options?: TransportRequestOptions): Promise + async updateScheduling (this: That, params: T.ConnectorUpdateSchedulingRequest | TB.ConnectorUpdateSchedulingRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const acceptedBody: string[] = ['scheduling'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_scheduling` + const meta: TransportRequestMetadata = { + name: 'connector.update_scheduling', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Updates the service type of the connector + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/update-connector-service-type-api.html | Elasticsearch API documentation} + */ + async updateServiceType (this: That, params: T.ConnectorUpdateServiceTypeRequest | TB.ConnectorUpdateServiceTypeRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateServiceType (this: That, params: T.ConnectorUpdateServiceTypeRequest | TB.ConnectorUpdateServiceTypeRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateServiceType (this: That, params: T.ConnectorUpdateServiceTypeRequest | TB.ConnectorUpdateServiceTypeRequest, options?: TransportRequestOptions): Promise + async updateServiceType (this: That, params: T.ConnectorUpdateServiceTypeRequest | TB.ConnectorUpdateServiceTypeRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const acceptedBody: string[] = ['service_type'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_service_type` + const meta: TransportRequestMetadata = { + name: 'connector.update_service_type', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Updates the status of the connector + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.15/update-connector-status-api.html | Elasticsearch API documentation} + */ + async updateStatus (this: That, params: T.ConnectorUpdateStatusRequest | TB.ConnectorUpdateStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateStatus (this: That, params: T.ConnectorUpdateStatusRequest | TB.ConnectorUpdateStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateStatus (this: That, params: T.ConnectorUpdateStatusRequest | TB.ConnectorUpdateStatusRequest, options?: TransportRequestOptions): Promise + async updateStatus (this: That, params: T.ConnectorUpdateStatusRequest | TB.ConnectorUpdateStatusRequest, options?: TransportRequestOptions): Promise { + const acceptedPath: string[] = ['connector_id'] + const acceptedBody: string[] = ['status'] + const querystring: Record = {} + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + + for (const key in params) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'PUT' + const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_status` + const meta: TransportRequestMetadata = { + name: 'connector.update_status', + pathParts: { + connector_id: params.connector_id + } + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } +} diff --git a/src/api/index.ts b/src/api/index.ts index e2ef990bb..f69eb473d 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -35,6 +35,7 @@ import CcrApi from './api/ccr' import clearScrollApi from './api/clear_scroll' import closePointInTimeApi from './api/close_point_in_time' import ClusterApi from './api/cluster' +import ConnectorApi from './api/connector' import countApi from './api/count' import createApi from './api/create' import DanglingIndicesApi from './api/dangling_indices' @@ -123,6 +124,7 @@ export default interface API { clearScroll: typeof clearScrollApi closePointInTime: typeof closePointInTimeApi cluster: ClusterApi + connector: ConnectorApi count: typeof countApi create: typeof createApi danglingIndices: DanglingIndicesApi @@ -206,6 +208,7 @@ const kAutoscaling = Symbol('Autoscaling') const kCat = Symbol('Cat') const kCcr = Symbol('Ccr') const kCluster = Symbol('Cluster') +const kConnector = Symbol('Connector') const kDanglingIndices = Symbol('DanglingIndices') const kEnrich = Symbol('Enrich') const kEql = Symbol('Eql') @@ -248,6 +251,7 @@ export default class API { [kCat]: symbol | null [kCcr]: symbol | null [kCluster]: symbol | null + [kConnector]: symbol | null [kDanglingIndices]: symbol | null [kEnrich]: symbol | null [kEql]: symbol | null @@ -289,6 +293,7 @@ export default class API { this[kCat] = null this[kCcr] = null this[kCluster] = null + this[kConnector] = null this[kDanglingIndices] = null this[kEnrich] = null this[kEql] = null @@ -389,6 +394,9 @@ Object.defineProperties(API.prototype, { cluster: { get () { return this[kCluster] === null ? (this[kCluster] = new ClusterApi(this.transport)) : this[kCluster] } }, + connector: { + get () { return this[kConnector] === null ? (this[kConnector] = new ConnectorApi(this.transport)) : this[kConnector] } + }, danglingIndices: { get () { return this[kDanglingIndices] === null ? (this[kDanglingIndices] = new DanglingIndicesApi(this.transport)) : this[kDanglingIndices] } }, diff --git a/src/api/types.ts b/src/api/types.ts index 369313a46..71720b2d0 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -9125,9 +9125,9 @@ export interface ConnectorConnectorConfigProperties { required: boolean sensitive: boolean tooltip?: string | null - type: ConnectorConnectorFieldType - ui_restrictions: string[] - validations: ConnectorValidation[] + type?: ConnectorConnectorFieldType + ui_restrictions?: string[] + validations?: ConnectorValidation[] value: any } @@ -9971,22 +9971,51 @@ export interface GraphExploreResponse { vertices: GraphVertex[] } -export type IlmActions = any - -export interface IlmConfigurations { - rollover?: IndicesRolloverRolloverConditions - forcemerge?: IlmForceMergeConfiguration - shrink?: IlmShrinkConfiguration +export interface IlmActions { + allocate?: IlmAllocateAction + delete?: IlmDeleteAction + downsample?: IlmDownsampleAction + freeze?: EmptyObject + forcemerge?: IlmForceMergeAction + migrate?: IlmMigrateAction + readonly?: EmptyObject + rollover?: IlmRolloverAction + set_priority?: IlmSetPriorityAction + searchable_snapshot?: IlmSearchableSnapshotAction + shrink?: IlmShrinkAction + unfollow?: EmptyObject + wait_for_snapshot?: IlmWaitForSnapshotAction } -export interface IlmForceMergeConfiguration { +export interface IlmAllocateAction { + number_of_replicas?: integer + total_shards_per_node?: integer + include?: Record + exclude?: Record + require?: Record +} + +export interface IlmDeleteAction { + delete_searchable_snapshot?: boolean +} + +export interface IlmDownsampleAction { + fixed_interval: DurationLarge + wait_timeout?: Duration +} + +export interface IlmForceMergeAction { max_num_segments: integer + index_codec?: string +} + +export interface IlmMigrateAction { + enabled?: boolean } export interface IlmPhase { actions?: IlmActions min_age?: Duration | long - configurations?: IlmConfigurations } export interface IlmPhases { @@ -10002,8 +10031,36 @@ export interface IlmPolicy { _meta?: Metadata } -export interface IlmShrinkConfiguration { - number_of_shards: integer +export interface IlmRolloverAction { + max_size?: ByteSize + max_primary_shard_size?: ByteSize + max_age?: Duration + max_docs?: long + max_primary_shard_docs?: long + min_size?: ByteSize + min_primary_shard_size?: ByteSize + min_age?: Duration + min_docs?: long + min_primary_shard_docs?: long +} + +export interface IlmSearchableSnapshotAction { + snapshot_repository: string + force_merge_index?: boolean +} + +export interface IlmSetPriorityAction { + priority?: integer +} + +export interface IlmShrinkAction { + number_of_shards?: integer + max_primary_shard_size?: ByteSize + allow_write_after_shrink?: boolean +} + +export interface IlmWaitForSnapshotAction { + policy: string } export interface IlmDeleteLifecycleRequest extends RequestBase { diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index cda640105..5203f3ca3 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -9226,9 +9226,9 @@ export interface ConnectorConnectorConfigProperties { required: boolean sensitive: boolean tooltip?: string | null - type: ConnectorConnectorFieldType - ui_restrictions: string[] - validations: ConnectorValidation[] + type?: ConnectorConnectorFieldType + ui_restrictions?: string[] + validations?: ConnectorValidation[] value: any } @@ -10136,22 +10136,51 @@ export interface GraphExploreResponse { vertices: GraphVertex[] } -export type IlmActions = any - -export interface IlmConfigurations { - rollover?: IndicesRolloverRolloverConditions - forcemerge?: IlmForceMergeConfiguration - shrink?: IlmShrinkConfiguration +export interface IlmActions { + allocate?: IlmAllocateAction + delete?: IlmDeleteAction + downsample?: IlmDownsampleAction + freeze?: EmptyObject + forcemerge?: IlmForceMergeAction + migrate?: IlmMigrateAction + readonly?: EmptyObject + rollover?: IlmRolloverAction + set_priority?: IlmSetPriorityAction + searchable_snapshot?: IlmSearchableSnapshotAction + shrink?: IlmShrinkAction + unfollow?: EmptyObject + wait_for_snapshot?: IlmWaitForSnapshotAction } -export interface IlmForceMergeConfiguration { +export interface IlmAllocateAction { + number_of_replicas?: integer + total_shards_per_node?: integer + include?: Record + exclude?: Record + require?: Record +} + +export interface IlmDeleteAction { + delete_searchable_snapshot?: boolean +} + +export interface IlmDownsampleAction { + fixed_interval: DurationLarge + wait_timeout?: Duration +} + +export interface IlmForceMergeAction { max_num_segments: integer + index_codec?: string +} + +export interface IlmMigrateAction { + enabled?: boolean } export interface IlmPhase { actions?: IlmActions min_age?: Duration | long - configurations?: IlmConfigurations } export interface IlmPhases { @@ -10167,8 +10196,36 @@ export interface IlmPolicy { _meta?: Metadata } -export interface IlmShrinkConfiguration { - number_of_shards: integer +export interface IlmRolloverAction { + max_size?: ByteSize + max_primary_shard_size?: ByteSize + max_age?: Duration + max_docs?: long + max_primary_shard_docs?: long + min_size?: ByteSize + min_primary_shard_size?: ByteSize + min_age?: Duration + min_docs?: long + min_primary_shard_docs?: long +} + +export interface IlmSearchableSnapshotAction { + snapshot_repository: string + force_merge_index?: boolean +} + +export interface IlmSetPriorityAction { + priority?: integer +} + +export interface IlmShrinkAction { + number_of_shards?: integer + max_primary_shard_size?: ByteSize + allow_write_after_shrink?: boolean +} + +export interface IlmWaitForSnapshotAction { + policy: string } export interface IlmDeleteLifecycleRequest extends RequestBase {