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 Shutdown { transport : Transport ; constructor ( transport ) { this . transport = transport ; } async deleteNode ( this , params , options ? ) ; async deleteNode ( this , params , options ? ) ; async deleteNode ( this , params , options ? ) ; async deleteNode ( this , params , options ? ) { const acceptedPath = [ 'node_id' ] ; 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 = `/_nodes/${ encodeURIComponent ( params . node_id . toString ( ) ) }/shutdown` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async getNode ( this , params ? , options ? ) ; async getNode ( this , params ? , options ? ) ; async getNode ( this , params ? , options ? ) ; async getNode ( 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 = `/_nodes/${ encodeURIComponent ( params . node_id . toString ( ) ) }/shutdown` ; } else { method = 'GET' ; path = '/_nodes/shutdown' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async putNode ( this , params , options ? ) ; async putNode ( this , params , options ? ) ; async putNode ( this , params , options ? ) ; async putNode ( this , params , options ? ) { const acceptedPath = [ 'node_id' ] ; 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 = `/_nodes/${ encodeURIComponent ( params . node_id . toString ( ) ) }/shutdown` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } }