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 Ccr { transport : Transport ; constructor ( transport ) { this . transport = transport ; } async deleteAutoFollowPattern ( this , params , options ? ) ; async deleteAutoFollowPattern ( this , params , options ? ) ; async deleteAutoFollowPattern ( this , params , options ? ) ; async deleteAutoFollowPattern ( 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 = `/_ccr/auto_follow/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async follow ( this , params , options ? ) ; async follow ( this , params , options ? ) ; async follow ( this , params , options ? ) ; async follow ( this , params , options ? ) { const acceptedPath = [ 'index' ] ; const acceptedBody = [ 'leader_index' , 'max_outstanding_read_requests' , 'max_outstanding_write_requests' , 'max_read_request_operation_count' , 'max_read_request_size' , 'max_retry_delay' , 'max_write_buffer_count' , 'max_write_buffer_size' , 'max_write_request_operation_count' , 'max_write_request_size' , 'read_poll_timeout' , 'remote_cluster' ] ; 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 ( ) ) }/_ccr/follow` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async followInfo ( this , params , options ? ) ; async followInfo ( this , params , options ? ) ; async followInfo ( this , params , options ? ) ; async followInfo ( 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 ( ) ) }/_ccr/info` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async followStats ( this , params , options ? ) ; async followStats ( this , params , options ? ) ; async followStats ( this , params , options ? ) ; async followStats ( 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 ( ) ) }/_ccr/stats` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async forgetFollower ( this , params , options ? ) ; async forgetFollower ( this , params , options ? ) ; async forgetFollower ( this , params , options ? ) ; async forgetFollower ( this , params , options ? ) { const acceptedPath = [ 'index' ] ; const acceptedBody = [ 'follower_cluster' , 'follower_index' , 'follower_index_uuid' , 'leader_remote_cluster' ] ; 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 = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_ccr/forget_follower` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async getAutoFollowPattern ( this , params ? , options ? ) ; async getAutoFollowPattern ( this , params ? , options ? ) ; async getAutoFollowPattern ( this , params ? , options ? ) ; async getAutoFollowPattern ( 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 = `/_ccr/auto_follow/${ encodeURIComponent ( params . name . toString ( ) ) }` ; } else { method = 'GET' ; path = '/_ccr/auto_follow' ; } return await this . transport . request ( { path , method , querystring , body } , options ) ; } async pauseAutoFollowPattern ( this , params , options ? ) ; async pauseAutoFollowPattern ( this , params , options ? ) ; async pauseAutoFollowPattern ( this , params , options ? ) ; async pauseAutoFollowPattern ( 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 = `/_ccr/auto_follow/${ encodeURIComponent ( params . name . toString ( ) ) }/pause` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async pauseFollow ( this , params , options ? ) ; async pauseFollow ( this , params , options ? ) ; async pauseFollow ( this , params , options ? ) ; async pauseFollow ( 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 ( ) ) }/_ccr/pause_follow` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async putAutoFollowPattern ( this , params , options ? ) ; async putAutoFollowPattern ( this , params , options ? ) ; async putAutoFollowPattern ( this , params , options ? ) ; async putAutoFollowPattern ( this , params , options ? ) { const acceptedPath = [ 'name' ] ; const acceptedBody = [ 'remote_cluster' , 'follow_index_pattern' , 'leader_index_patterns' , 'leader_index_exclusion_patterns' , 'max_outstanding_read_requests' , 'settings' , 'max_outstanding_write_requests' , 'read_poll_timeout' , 'max_read_request_operation_count' , 'max_read_request_size' , 'max_retry_delay' , 'max_write_buffer_count' , 'max_write_buffer_size' , 'max_write_request_operation_count' , 'max_write_request_size' ] ; 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 = `/_ccr/auto_follow/${ encodeURIComponent ( params . name . toString ( ) ) }` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async resumeAutoFollowPattern ( this , params , options ? ) ; async resumeAutoFollowPattern ( this , params , options ? ) ; async resumeAutoFollowPattern ( this , params , options ? ) ; async resumeAutoFollowPattern ( 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 = `/_ccr/auto_follow/${ encodeURIComponent ( params . name . toString ( ) ) }/resume` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async resumeFollow ( this , params , options ? ) ; async resumeFollow ( this , params , options ? ) ; async resumeFollow ( this , params , options ? ) ; async resumeFollow ( this , params , options ? ) { const acceptedPath = [ 'index' ] ; const acceptedBody = [ 'max_outstanding_read_requests' , 'max_outstanding_write_requests' , 'max_read_request_operation_count' , 'max_read_request_size' , 'max_retry_delay' , 'max_write_buffer_count' , 'max_write_buffer_size' , 'max_write_request_operation_count' , 'max_write_request_size' , 'read_poll_timeout' ] ; 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 = `/${ encodeURIComponent ( params . index . toString ( ) ) }/_ccr/resume_follow` ; 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 = [ ] ; 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 = '/_ccr/stats' ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } async unfollow ( this , params , options ? ) ; async unfollow ( this , params , options ? ) ; async unfollow ( this , params , options ? ) ; async unfollow ( 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 ( ) ) }/_ccr/unfollow` ; return await this . transport . request ( { path , method , querystring , body } , options ) ; } }