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 Ilm { transport : Transport ; constructor ( transport ) { this . transport = transport ; } async deleteLifecycle ( this , params , options ? ) ; async deleteLifecycle ( this , params , options ? ) ; async deleteLifecycle ( this , params , options ? ) ; async deleteLifecycle ( 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 = `/_ilm/policy/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async explainLifecycle ( this , params , options ? ) ; async explainLifecycle ( this , params , options ? ) ; async explainLifecycle ( this , params , options ? ) ; async explainLifecycle ( 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 ( ) ) }/_ilm/explain` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async getLifecycle ( this , params ? , options ? ) ; async getLifecycle ( this , params ? , options ? ) ; async getLifecycle ( this , params ? , options ? ) ; async getLifecycle ( 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 = `/_ilm/policy/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_ilm/policy' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async getStatus ( this , params ? , options ? ) ; async getStatus ( this , params ? , options ? ) ; async getStatus ( this , params ? , options ? ) ; async getStatus ( 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 = '/_ilm/status' ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async migrateToDataTiers ( this , params ? , options ? ) ; async migrateToDataTiers ( this , params ? , options ? ) ; async migrateToDataTiers ( this , params ? , options ? ) ; async migrateToDataTiers ( 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 = '/_ilm/migrate_to_data_tiers' ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async moveToStep ( this , params , options ? ) ; async moveToStep ( this , params , options ? ) ; async moveToStep ( this , params , options ? ) ; async moveToStep ( this , params , options ? ) { const acceptedPath = [ 'index' ] ; const acceptedBody = [ 'current_step' , 'next_step' ] ; 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 = `/_ilm/move/${ encodeURIComponent ( params . index . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async putLifecycle ( this , params , options ? ) ; async putLifecycle ( this , params , options ? ) ; async putLifecycle ( this , params , options ? ) ; async putLifecycle ( this , params , options ? ) { const acceptedPath = [ 'name' ] ; const acceptedBody = [ 'policy' ] ; 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 = `/_ilm/policy/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async removePolicy ( this , params , options ? ) ; async removePolicy ( this , params , options ? ) ; async removePolicy ( this , params , options ? ) ; async removePolicy ( 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 ( ) ) }/_ilm/remove` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async retry ( this , params , options ? ) ; async retry ( this , params , options ? ) ; async retry ( this , params , options ? ) ; async retry ( 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 ( ) ) }/_ilm/retry` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async start ( this , params ? , options ? ) ; async start ( this , params ? , options ? ) ; async start ( this , params ? , options ? ) ; async start ( 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 = '/_ilm/start' ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async stop ( this , params ? , options ? ) ; async stop ( this , params ? , options ? ) ; async stop ( this , params ? , options ? ) ; async stop ( 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 = '/_ilm/stop' ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } }