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 Cat { transport : Transport ; constructor ( transport ) { this . transport = transport ; } async aliases ( this , params ? , options ? ) ; async aliases ( this , params ? , options ? ) ; async aliases ( this , params ? , options ? ) ; async aliases ( 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 = `/_cat/aliases/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_cat/aliases' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async allocation ( this , params ? , options ? ) ; async allocation ( this , params ? , options ? ) ; async allocation ( this , params ? , options ? ) ; async allocation ( this , params ? , options ? ) { const acceptedPath = [ 'node_id' ] ; 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 . node_id != null ) { method = 'GET' ; path = `/_cat/allocation/${ encodeURIComponent ( params . node_id . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_cat/allocation' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async count ( this , params ? , options ? ) ; async count ( this , params ? , options ? ) ; async count ( this , params ? , options ? ) ; async count ( 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 = `/_cat/count/${ encodeURIComponent ( params . index . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_cat/count' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async fielddata ( this , params ? , options ? ) ; async fielddata ( this , params ? , options ? ) ; async fielddata ( this , params ? , options ? ) ; async fielddata ( this , params ? , options ? ) { const acceptedPath = [ 'fields' ] ; 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 . fields != null ) { method = 'GET' ; path = `/_cat/fielddata/${ encodeURIComponent ( params . fields . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_cat/fielddata' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async health ( this , params ? , options ? ) ; async health ( this , params ? , options ? ) ; async health ( this , params ? , options ? ) ; async health ( 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 = 'GET' ; const path = '/_cat/health' ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async help ( this , params ? , options ? ) ; async help ( this , params ? , options ? ) ; async help ( this , params ? , options ? ) ; async help ( 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 = 'GET' ; const path = '/_cat' ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async indices ( this , params ? , options ? ) ; async indices ( this , params ? , options ? ) ; async indices ( this , params ? , options ? ) ; async indices ( 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 = `/_cat/indices/${ encodeURIComponent ( params . index . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_cat/indices' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async master ( this , params ? , options ? ) ; async master ( this , params ? , options ? ) ; async master ( this , params ? , options ? ) ; async master ( 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 = 'GET' ; const path = '/_cat/master' ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async mlDataFrameAnalytics ( this , params ? , options ? ) ; async mlDataFrameAnalytics ( this , params ? , options ? ) ; async mlDataFrameAnalytics ( this , params ? , options ? ) ; async mlDataFrameAnalytics ( this , params ? , options ? ) { const acceptedPath = [ 'id' ] ; 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 . id != null ) { method = 'GET' ; path = `/_cat/ml/data_frame/analytics/${ encodeURIComponent ( params . id . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_cat/ml/data_frame/analytics' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async mlDatafeeds ( this , params ? , options ? ) ; async mlDatafeeds ( this , params ? , options ? ) ; async mlDatafeeds ( this , params ? , options ? ) ; async mlDatafeeds ( this , params ? , options ? ) { const acceptedPath = [ 'datafeed_id' ] ; 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 . datafeed_id != null ) { method = 'GET' ; path = `/_cat/ml/datafeeds/${ encodeURIComponent ( params . datafeed_id . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_cat/ml/datafeeds' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async mlJobs ( this , params ? , options ? ) ; async mlJobs ( this , params ? , options ? ) ; async mlJobs ( this , params ? , options ? ) ; async mlJobs ( this , params ? , options ? ) { const acceptedPath = [ 'job_id' ] ; 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 . job_id != null ) { method = 'GET' ; path = `/_cat/ml/anomaly_detectors/${ encodeURIComponent ( params . job_id . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_cat/ml/anomaly_detectors' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async mlTrainedModels ( this , params ? , options ? ) ; async mlTrainedModels ( this , params ? , options ? ) ; async mlTrainedModels ( this , params ? , options ? ) ; async mlTrainedModels ( this , params ? , options ? ) { const acceptedPath = [ 'model_id' ] ; 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 . model_id != null ) { method = 'GET' ; path = `/_cat/ml/trained_models/${ encodeURIComponent ( params . model_id . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_cat/ml/trained_models' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async nodeattrs ( this , params ? , options ? ) ; async nodeattrs ( this , params ? , options ? ) ; async nodeattrs ( this , params ? , options ? ) ; async nodeattrs ( 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 = 'GET' ; const path = '/_cat/nodeattrs' ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async nodes ( this , params ? , options ? ) ; async nodes ( this , params ? , options ? ) ; async nodes ( this , params ? , options ? ) ; async nodes ( 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 = 'GET' ; const path = '/_cat/nodes' ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async pendingTasks ( this , params ? , options ? ) ; async pendingTasks ( this , params ? , options ? ) ; async pendingTasks ( this , params ? , options ? ) ; async pendingTasks ( 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 = 'GET' ; const path = '/_cat/pending_tasks' ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async plugins ( this , params ? , options ? ) ; async plugins ( this , params ? , options ? ) ; async plugins ( this , params ? , options ? ) ; async plugins ( 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 = 'GET' ; const path = '/_cat/plugins' ; 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 = `/_cat/recovery/${ encodeURIComponent ( params . index . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_cat/recovery' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async repositories ( this , params ? , options ? ) ; async repositories ( this , params ? , options ? ) ; async repositories ( this , params ? , options ? ) ; async repositories ( 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 = 'GET' ; const path = '/_cat/repositories' ; 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 = `/_cat/segments/${ encodeURIComponent ( params . index . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_cat/segments' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async shards ( this , params ? , options ? ) ; async shards ( this , params ? , options ? ) ; async shards ( this , params ? , options ? ) ; async shards ( 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 = `/_cat/shards/${ encodeURIComponent ( params . index . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_cat/shards' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async snapshots ( this , params ? , options ? ) ; async snapshots ( this , params ? , options ? ) ; async snapshots ( this , params ? , options ? ) ; async snapshots ( this , params ? , options ? ) { const acceptedPath = [ 'repository' ] ; 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 . repository != null ) { method = 'GET' ; path = `/_cat/snapshots/${ encodeURIComponent ( params . repository . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_cat/snapshots' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async tasks ( this , params ? , options ? ) ; async tasks ( this , params ? , options ? ) ; async tasks ( this , params ? , options ? ) ; async tasks ( 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 = 'GET' ; const path = '/_cat/tasks' ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async templates ( this , params ? , options ? ) ; async templates ( this , params ? , options ? ) ; async templates ( this , params ? , options ? ) ; async templates ( 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 = `/_cat/templates/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_cat/templates' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async threadPool ( this , params ? , options ? ) ; async threadPool ( this , params ? , options ? ) ; async threadPool ( this , params ? , options ? ) ; async threadPool ( this , params ? , options ? ) { const acceptedPath = [ 'thread_pool_patterns' ] ; 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 . thread_pool_patterns != null ) { method = 'GET' ; path = `/_cat/thread_pool/${ encodeURIComponent ( params . thread_pool_patterns . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_cat/thread_pool' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async transforms ( this , params ? , options ? ) ; async transforms ( this , params ? , options ? ) ; async transforms ( this , params ? , options ? ) ; async transforms ( this , params ? , options ? ) { const acceptedPath = [ 'transform_id' ] ; 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 . transform_id != null ) { method = 'GET' ; path = `/_cat/transforms/${ encodeURIComponent ( params . transform_id . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_cat/transforms' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } }