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 Autoscaling { transport : Transport ; constructor ( transport ) { this . transport = transport ; } async deleteAutoscalingPolicy ( this , params , options ? ) ; async deleteAutoscalingPolicy ( this , params , options ? ) ; async deleteAutoscalingPolicy ( this , params , options ? ) ; async deleteAutoscalingPolicy ( 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 = `/_autoscaling/policy/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async getAutoscalingCapacity ( this , params ? , options ? ) ; async getAutoscalingCapacity ( this , params ? , options ? ) ; async getAutoscalingCapacity ( this , params ? , options ? ) ; async getAutoscalingCapacity ( 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 = '/_autoscaling/capacity' ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async getAutoscalingPolicy ( this , params , options ? ) ; async getAutoscalingPolicy ( this , params , options ? ) ; async getAutoscalingPolicy ( this , params , options ? ) ; async getAutoscalingPolicy ( 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 = `/_autoscaling/policy/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async putAutoscalingPolicy ( this , params , options ? ) ; async putAutoscalingPolicy ( this , params , options ? ) ; async putAutoscalingPolicy ( this , params , options ? ) ; async putAutoscalingPolicy ( this , params , options ? ) { const acceptedPath = [ 'name' ] ; const acceptedBody = [ 'policy' ] ; 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 ] ; } } const method = 'PUT' ; const path = `/_autoscaling/policy/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } }