import { Transport , TransportRequestOptions , TransportRequestOptionsWithMeta , TransportRequestOptionsWithOutMeta , TransportResult } from '@elastic/transport' ; import * as T from '../types' ; import * as TB from '../typesWithBodyKey' ; interface That { transport : Transport ; } export default class Indices { transport : Transport ; constructor ( transport ) { this . transport = transport ; } async addBlock ( this , params , options ? ) ; async addBlock ( this , params , options ? ) ; async addBlock ( this , params , options ? ) ; async addBlock ( this , params , options ? ) { const acceptedPath = [ 'index' , 'block' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'PUT' ; const path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_block/${ encodeURIComponent ( params . block . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async analyze ( this , params ? , options ? ) ; async analyze ( this , params ? , options ? ) ; async analyze ( this , params ? , options ? ) ; async analyze ( this , params ? , options ? ) { const acceptedPath = [ 'index' ] ; const acceptedBody = [ 'analyzer' , 'attributes' , 'char_filter' , 'explain' , 'field' , 'filter' , 'normalizer' , 'text' , 'tokenizer' ] ; const querystring = { } ; const userBody = params ?. body ; let body ; 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 ?? { } ; body [ key ] = params [ key ] ; } else if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null ) { method = body != null ? 'POST' : 'GET' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_analyze` ; } else { method = body != null ? 'POST' : 'GET' ; path = '/_analyze' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async clearCache ( this , params ? , options ? ) ; async clearCache ( this , params ? , options ? ) ; async clearCache ( this , params ? , options ? ) ; async clearCache ( this , params ? , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null ) { method = 'POST' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_cache/clear` ; } else { method = 'POST' ; path = '/_cache/clear' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async clone ( this , params , options ? ) ; async clone ( this , params , options ? ) ; async clone ( this , params , options ? ) ; async clone ( this , params , options ? ) { const acceptedPath = [ 'index' , 'target' ] ; const acceptedBody = [ 'aliases' , 'settings' ] ; const querystring = { } ; const userBody = params ?. body ; let body ; if ( typeof userBody === 'string' ) { body = userBody ; } else { body = userBody != null ? { ... userBody } : undefined ; } for ( const key in params ) { if ( acceptedBody . includes ( key ) ) { body = body ?? { } ; body [ key ] = params [ key ] ; } else if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'PUT' ; const path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_clone/${ encodeURIComponent ( params . target . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async close ( this , params , options ? ) ; async close ( this , params , options ? ) ; async close ( this , params , options ? ) ; async close ( this , params , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'POST' ; const path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_close` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async create ( this , params , options ? ) ; async create ( this , params , options ? ) ; async create ( this , params , options ? ) ; async create ( this , params , options ? ) { const acceptedPath = [ 'index' ] ; const acceptedBody = [ 'aliases' , 'mappings' , 'settings' ] ; const querystring = { } ; const userBody = params ?. body ; let body ; if ( typeof userBody === 'string' ) { body = userBody ; } else { body = userBody != null ? { ... userBody } : undefined ; } for ( const key in params ) { if ( acceptedBody . includes ( key ) ) { body = body ?? { } ; body [ key ] = params [ key ] ; } else if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'PUT' ; const path = `/${ encodeURIComponent ( params . index . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async createDataStream ( this , params , options ? ) ; async createDataStream ( this , params , options ? ) ; async createDataStream ( this , params , options ? ) ; async createDataStream ( this , params , options ? ) { const acceptedPath = [ 'name' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'PUT' ; const path = `/_data_stream/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async dataStreamsStats ( this , params ? , options ? ) ; async dataStreamsStats ( this , params ? , options ? ) ; async dataStreamsStats ( this , params ? , options ? ) ; async dataStreamsStats ( this , params ? , options ? ) { const acceptedPath = [ 'name' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . name != null ) { method = 'GET' ; path = `/_data_stream/${ encodeURIComponent ( params . name . toString ( ) ) }/_stats` ; } else { method = 'GET' ; path = '/_data_stream/_stats' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async delete ( this , params , options ? ) ; async delete ( this , params , options ? ) ; async delete ( this , params , options ? ) ; async delete ( this , params , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'DELETE' ; const path = `/${ encodeURIComponent ( params . index . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async deleteAlias ( this , params , options ? ) ; async deleteAlias ( this , params , options ? ) ; async deleteAlias ( this , params , options ? ) ; async deleteAlias ( this , params , options ? ) { const acceptedPath = [ 'index' , 'name' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null && params . name != null ) { method = 'DELETE' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_alias/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } else { method = 'DELETE' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_aliases/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async deleteDataStream ( this , params , options ? ) ; async deleteDataStream ( this , params , options ? ) ; async deleteDataStream ( this , params , options ? ) ; async deleteDataStream ( this , params , options ? ) { const acceptedPath = [ 'name' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'DELETE' ; const path = `/_data_stream/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async deleteIndexTemplate ( this , params , options ? ) ; async deleteIndexTemplate ( this , params , options ? ) ; async deleteIndexTemplate ( this , params , options ? ) ; async deleteIndexTemplate ( this , params , options ? ) { const acceptedPath = [ 'name' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'DELETE' ; const path = `/_index_template/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async deleteTemplate ( this , params , options ? ) ; async deleteTemplate ( this , params , options ? ) ; async deleteTemplate ( this , params , options ? ) ; async deleteTemplate ( this , params , options ? ) { const acceptedPath = [ 'name' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'DELETE' ; const path = `/_template/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async diskUsage ( this , params , options ? ) ; async diskUsage ( this , params , options ? ) ; async diskUsage ( this , params , options ? ) ; async diskUsage ( this , params , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'POST' ; const path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_disk_usage` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async exists ( this , params , options ? ) ; async exists ( this , params , options ? ) ; async exists ( this , params , options ? ) ; async exists ( this , params , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'HEAD' ; const path = `/${ encodeURIComponent ( params . index . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async existsAlias ( this , params , options ? ) ; async existsAlias ( this , params , options ? ) ; async existsAlias ( this , params , options ? ) ; async existsAlias ( this , params , options ? ) { const acceptedPath = [ 'name' , 'index' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null && params . name != null ) { method = 'HEAD' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_alias/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } else { method = 'HEAD' ; path = `/_alias/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async existsIndexTemplate ( this , params , options ? ) ; async existsIndexTemplate ( this , params , options ? ) ; async existsIndexTemplate ( this , params , options ? ) ; async existsIndexTemplate ( this , params , options ? ) { const acceptedPath = [ 'name' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'HEAD' ; const path = `/_index_template/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async existsTemplate ( this , params , options ? ) ; async existsTemplate ( this , params , options ? ) ; async existsTemplate ( this , params , options ? ) ; async existsTemplate ( this , params , options ? ) { const acceptedPath = [ 'name' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'HEAD' ; const path = `/_template/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async fieldUsageStats ( this , params ? , options ? ) ; async fieldUsageStats ( this , params ? , options ? ) ; async fieldUsageStats ( this , params ? , options ? ) ; async fieldUsageStats ( this , params ? , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; 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 = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_field_usage_stats` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async flush ( this , params ? , options ? ) ; async flush ( this , params ? , options ? ) ; async flush ( this , params ? , options ? ) ; async flush ( this , params ? , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null ) { method = body != null ? 'POST' : 'GET' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_flush` ; } else { method = body != null ? 'POST' : 'GET' ; path = '/_flush' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async forcemerge ( this , params ? , options ? ) ; async forcemerge ( this , params ? , options ? ) ; async forcemerge ( this , params ? , options ? ) ; async forcemerge ( this , params ? , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null ) { method = 'POST' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_forcemerge` ; } else { method = 'POST' ; path = '/_forcemerge' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async get ( this , params , options ? ) ; async get ( this , params , options ? ) ; async get ( this , params , options ? ) ; async get ( this , params , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'GET' ; const path = `/${ encodeURIComponent ( params . index . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async getAlias ( this , params ? , options ? ) ; async getAlias ( this , params ? , options ? ) ; async getAlias ( this , params ? , options ? ) ; async getAlias ( this , params ? , options ? ) { const acceptedPath = [ 'name' , 'index' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null && params . name != null ) { method = 'GET' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_alias/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } else if ( params . name != null ) { method = 'GET' ; path = `/_alias/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } else if ( params . index != null ) { method = 'GET' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_alias` ; } else { method = 'GET' ; path = '/_alias' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async getDataStream ( this , params ? , options ? ) ; async getDataStream ( this , params ? , options ? ) ; async getDataStream ( this , params ? , options ? ) ; async getDataStream ( this , params ? , options ? ) { const acceptedPath = [ 'name' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . name != null ) { method = 'GET' ; path = `/_data_stream/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_data_stream' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async getFieldMapping ( this , params , options ? ) ; async getFieldMapping ( this , params , options ? ) ; async getFieldMapping ( this , params , options ? ) ; async getFieldMapping ( this , params , options ? ) { const acceptedPath = [ 'fields' , 'index' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null && params . fields != null ) { method = 'GET' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_mapping/field/${ encodeURIComponent ( params . fields . toString ( ) ) }` ; } else { method = 'GET' ; path = `/_mapping/field/${ encodeURIComponent ( params . fields . toString ( ) ) }` ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async getIndexTemplate ( this , params ? , options ? ) ; async getIndexTemplate ( this , params ? , options ? ) ; async getIndexTemplate ( this , params ? , options ? ) ; async getIndexTemplate ( this , params ? , options ? ) { const acceptedPath = [ 'name' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . name != null ) { method = 'GET' ; path = `/_index_template/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_index_template' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async getMapping ( this , params ? , options ? ) ; async getMapping ( this , params ? , options ? ) ; async getMapping ( this , params ? , options ? ) ; async getMapping ( this , params ? , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null ) { method = 'GET' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_mapping` ; } else { method = 'GET' ; path = '/_mapping' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async getSettings ( this , params ? , options ? ) ; async getSettings ( this , params ? , options ? ) ; async getSettings ( this , params ? , options ? ) ; async getSettings ( this , params ? , options ? ) { const acceptedPath = [ 'index' , 'name' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null && params . name != null ) { method = 'GET' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_settings/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } else if ( params . index != null ) { method = 'GET' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_settings` ; } else if ( params . name != null ) { method = 'GET' ; path = `/_settings/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_settings' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async getTemplate ( this , params ? , options ? ) ; async getTemplate ( this , params ? , options ? ) ; async getTemplate ( this , params ? , options ? ) ; async getTemplate ( this , params ? , options ? ) { const acceptedPath = [ 'name' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . name != null ) { method = 'GET' ; path = `/_template/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_template' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async migrateToDataStream ( this , params , options ? ) ; async migrateToDataStream ( this , params , options ? ) ; async migrateToDataStream ( this , params , options ? ) ; async migrateToDataStream ( this , params , options ? ) { const acceptedPath = [ 'name' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'POST' ; const path = `/_data_stream/_migrate/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async modifyDataStream ( this , params ? , options ? ) ; async modifyDataStream ( this , params ? , options ? ) ; async modifyDataStream ( this , params ? , options ? ) ; async modifyDataStream ( this , params ? , options ? ) { const acceptedPath = [ ] ; const querystring = { } ; 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 = '/_data_stream/_modify' ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async open ( this , params , options ? ) ; async open ( this , params , options ? ) ; async open ( this , params , options ? ) ; async open ( this , params , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'POST' ; const path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_open` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async promoteDataStream ( this , params , options ? ) ; async promoteDataStream ( this , params , options ? ) ; async promoteDataStream ( this , params , options ? ) ; async promoteDataStream ( this , params , options ? ) { const acceptedPath = [ 'name' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'POST' ; const path = `/_data_stream/_promote/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async putAlias ( this , params , options ? ) ; async putAlias ( this , params , options ? ) ; async putAlias ( this , params , options ? ) ; async putAlias ( this , params , options ? ) { const acceptedPath = [ 'index' , 'name' ] ; const acceptedBody = [ 'filter' , 'index_routing' , 'is_write_index' , 'routing' , 'search_routing' ] ; const querystring = { } ; const userBody = params ?. body ; let body ; if ( typeof userBody === 'string' ) { body = userBody ; } else { body = userBody != null ? { ... userBody } : undefined ; } for ( const key in params ) { if ( acceptedBody . includes ( key ) ) { body = body ?? { } ; body [ key ] = params [ key ] ; } else if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null && params . name != null ) { method = 'PUT' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_alias/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } else { method = 'PUT' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_aliases/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async putIndexTemplate ( this , params , options ? ) ; async putIndexTemplate ( this , params , options ? ) ; async putIndexTemplate ( this , params , options ? ) ; async putIndexTemplate ( this , params , options ? ) { const acceptedPath = [ 'name' ] ; const acceptedBody = [ 'index_patterns' , 'composed_of' , 'template' , 'data_stream' , 'priority' , 'version' , '_meta' ] ; const querystring = { } ; const userBody = params ?. body ; let body ; if ( typeof userBody === 'string' ) { body = userBody ; } else { body = userBody != null ? { ... userBody } : undefined ; } for ( const key in params ) { if ( acceptedBody . includes ( key ) ) { body = body ?? { } ; body [ key ] = params [ key ] ; } else if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'PUT' ; const path = `/_index_template/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async putMapping ( this , params , options ? ) ; async putMapping ( this , params , options ? ) ; async putMapping ( this , params , options ? ) ; async putMapping ( this , params , options ? ) { const acceptedPath = [ 'index' ] ; const acceptedBody = [ 'date_detection' , 'dynamic' , 'dynamic_date_formats' , 'dynamic_templates' , '_field_names' , '_meta' , 'numeric_detection' , 'properties' , '_routing' , '_source' , 'runtime' ] ; const querystring = { } ; const userBody = params ?. body ; let body ; if ( typeof userBody === 'string' ) { body = userBody ; } else { body = userBody != null ? { ... userBody } : undefined ; } for ( const key in params ) { if ( acceptedBody . includes ( key ) ) { body = body ?? { } ; body [ key ] = params [ key ] ; } else if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'PUT' ; const path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_mapping` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async putSettings ( this , params , options ? ) ; async putSettings ( this , params , options ? ) ; async putSettings ( this , params , options ? ) ; async putSettings ( this , params , options ? ) { const acceptedPath = [ 'index' ] ; const acceptedBody = [ 'settings' ] ; const querystring = { } ; let body = params . body ?? undefined ; for ( const key in params ) { if ( acceptedBody . includes ( key ) ) { body = params [ key ] ; } else if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null ) { method = 'PUT' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_settings` ; } else { method = 'PUT' ; path = '/_settings' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async putTemplate ( this , params , options ? ) ; async putTemplate ( this , params , options ? ) ; async putTemplate ( this , params , options ? ) ; async putTemplate ( this , params , options ? ) { const acceptedPath = [ 'name' ] ; const acceptedBody = [ 'aliases' , 'index_patterns' , 'mappings' , 'order' , 'settings' , 'version' ] ; const querystring = { } ; const userBody = params ?. body ; let body ; if ( typeof userBody === 'string' ) { body = userBody ; } else { body = userBody != null ? { ... userBody } : undefined ; } for ( const key in params ) { if ( acceptedBody . includes ( key ) ) { body = body ?? { } ; body [ key ] = params [ key ] ; } else if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'PUT' ; const path = `/_template/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async recovery ( this , params ? , options ? ) ; async recovery ( this , params ? , options ? ) ; async recovery ( this , params ? , options ? ) ; async recovery ( this , params ? , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null ) { method = 'GET' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_recovery` ; } else { method = 'GET' ; path = '/_recovery' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async refresh ( this , params ? , options ? ) ; async refresh ( this , params ? , options ? ) ; async refresh ( this , params ? , options ? ) ; async refresh ( this , params ? , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null ) { method = body != null ? 'POST' : 'GET' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_refresh` ; } else { method = body != null ? 'POST' : 'GET' ; path = '/_refresh' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async reloadSearchAnalyzers ( this , params , options ? ) ; async reloadSearchAnalyzers ( this , params , options ? ) ; async reloadSearchAnalyzers ( this , params , options ? ) ; async reloadSearchAnalyzers ( this , params , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = body != null ? 'POST' : 'GET' ; const path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_reload_search_analyzers` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async resolveIndex ( this , params , options ? ) ; async resolveIndex ( this , params , options ? ) ; async resolveIndex ( this , params , options ? ) ; async resolveIndex ( this , params , options ? ) { const acceptedPath = [ 'name' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'GET' ; const path = `/_resolve/index/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async rollover ( this , params , options ? ) ; async rollover ( this , params , options ? ) ; async rollover ( this , params , options ? ) ; async rollover ( this , params , options ? ) { const acceptedPath = [ 'alias' , 'new_index' ] ; const acceptedBody = [ 'aliases' , 'conditions' , 'mappings' , 'settings' ] ; const querystring = { } ; const userBody = params ?. body ; let body ; if ( typeof userBody === 'string' ) { body = userBody ; } else { body = userBody != null ? { ... userBody } : undefined ; } for ( const key in params ) { if ( acceptedBody . includes ( key ) ) { body = body ?? { } ; body [ key ] = params [ key ] ; } else if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . alias != null && params . new_index != null ) { method = 'POST' ; path = `/${ encodeURIComponent ( params . alias . toString ( ) ) }/_rollover/${ encodeURIComponent ( params . new_index . toString ( ) ) }` ; } else { method = 'POST' ; path = `/${ encodeURIComponent ( params . alias . toString ( ) ) }/_rollover` ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async segments ( this , params ? , options ? ) ; async segments ( this , params ? , options ? ) ; async segments ( this , params ? , options ? ) ; async segments ( this , params ? , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null ) { method = 'GET' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_segments` ; } else { method = 'GET' ; path = '/_segments' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async shardStores ( this , params ? , options ? ) ; async shardStores ( this , params ? , options ? ) ; async shardStores ( this , params ? , options ? ) ; async shardStores ( this , params ? , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null ) { method = 'GET' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_shard_stores` ; } else { method = 'GET' ; path = '/_shard_stores' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async shrink ( this , params , options ? ) ; async shrink ( this , params , options ? ) ; async shrink ( this , params , options ? ) ; async shrink ( this , params , options ? ) { const acceptedPath = [ 'index' , 'target' ] ; const acceptedBody = [ 'aliases' , 'settings' ] ; const querystring = { } ; const userBody = params ?. body ; let body ; if ( typeof userBody === 'string' ) { body = userBody ; } else { body = userBody != null ? { ... userBody } : undefined ; } for ( const key in params ) { if ( acceptedBody . includes ( key ) ) { body = body ?? { } ; body [ key ] = params [ key ] ; } else if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'PUT' ; const path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_shrink/${ encodeURIComponent ( params . target . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async simulateIndexTemplate ( this , params , options ? ) ; async simulateIndexTemplate ( this , params , options ? ) ; async simulateIndexTemplate ( this , params , options ? ) ; async simulateIndexTemplate ( this , params , options ? ) { const acceptedPath = [ 'name' ] ; const acceptedBody = [ 'allow_auto_create' , 'index_patterns' , 'composed_of' , 'template' , 'data_stream' , 'priority' , 'version' , '_meta' ] ; const querystring = { } ; const userBody = params ?. body ; let body ; if ( typeof userBody === 'string' ) { body = userBody ; } else { body = userBody != null ? { ... userBody } : undefined ; } for ( const key in params ) { if ( acceptedBody . includes ( key ) ) { body = body ?? { } ; body [ key ] = params [ key ] ; } else if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'POST' ; const path = `/_index_template/_simulate_index/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async simulateTemplate ( this , params , options ? ) ; async simulateTemplate ( this , params , options ? ) ; async simulateTemplate ( this , params , options ? ) ; async simulateTemplate ( this , params , options ? ) { const acceptedPath = [ 'name' ] ; const acceptedBody = [ 'template' ] ; const querystring = { } ; let body = params . body ?? undefined ; for ( const key in params ) { if ( acceptedBody . includes ( key ) ) { body = params [ key ] ; } else if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . name != null ) { method = 'POST' ; path = `/_index_template/_simulate/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } else { method = 'POST' ; path = '/_index_template/_simulate' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async split ( this , params , options ? ) ; async split ( this , params , options ? ) ; async split ( this , params , options ? ) ; async split ( this , params , options ? ) { const acceptedPath = [ 'index' , 'target' ] ; const acceptedBody = [ 'aliases' , 'settings' ] ; const querystring = { } ; const userBody = params ?. body ; let body ; if ( typeof userBody === 'string' ) { body = userBody ; } else { body = userBody != null ? { ... userBody } : undefined ; } for ( const key in params ) { if ( acceptedBody . includes ( key ) ) { body = body ?? { } ; body [ key ] = params [ key ] ; } else if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'PUT' ; const path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_split/${ encodeURIComponent ( params . target . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async stats ( this , params ? , options ? ) ; async stats ( this , params ? , options ? ) ; async stats ( this , params ? , options ? ) ; async stats ( this , params ? , options ? ) { const acceptedPath = [ 'metric' , 'index' ] ; const querystring = { } ; const body = undefined ; params = params ?? { } ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null && params . metric != null ) { method = 'GET' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_stats/${ encodeURIComponent ( params . metric . toString ( ) ) }` ; } else if ( params . metric != null ) { method = 'GET' ; path = `/_stats/${ encodeURIComponent ( params . metric . toString ( ) ) }` ; } else if ( params . index != null ) { method = 'GET' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_stats` ; } else { method = 'GET' ; path = '/_stats' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async unfreeze ( this , params , options ? ) ; async unfreeze ( this , params , options ? ) ; async unfreeze ( this , params , options ? ) ; async unfreeze ( this , params , options ? ) { const acceptedPath = [ 'index' ] ; const querystring = { } ; const body = undefined ; for ( const key in params ) { if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'POST' ; const path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_unfreeze` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async updateAliases ( this , params ? , options ? ) ; async updateAliases ( this , params ? , options ? ) ; async updateAliases ( this , params ? , options ? ) ; async updateAliases ( this , params ? , options ? ) { const acceptedPath = [ ] ; const acceptedBody = [ 'actions' ] ; const querystring = { } ; const userBody = params ?. body ; let body ; 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 ?? { } ; body [ key ] = params [ key ] ; } else if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'POST' ; const path = '/_aliases' ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async validateQuery ( this , params ? , options ? ) ; async validateQuery ( this , params ? , options ? ) ; async validateQuery ( this , params ? , options ? ) ; async validateQuery ( this , params ? , options ? ) { const acceptedPath = [ 'index' ] ; const acceptedBody = [ 'query' ] ; const querystring = { } ; const userBody = params ?. body ; let body ; 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 ?? { } ; body [ key ] = params [ key ] ; } else if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } let method = '' ; let path = '' ; if ( params . index != null ) { method = body != null ? 'POST' : 'GET' ; path = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_validate/query` ; } else { method = body != null ? 'POST' : 'GET' ; path = '/_validate/query' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } }