/**
 * TODO:
 * IMPORTANT: Please see how  BreadcrumbService is set up for an example of how these services should be set up
 * in future. The pattern in this file is legacy and should be updated to conform to the plugin lifecycle.
  import { HttpSetup } from 'src/core/public' ; import { UseRequestConfig , useRequest as _useRequest , } from '../../../../../../src/plugins/es_ui_shared/public' ; interface GenericObject { [ key ] : any ; } let _httpClient ; export function init ( httpClient ) { _httpClient = httpClient ; } function getFullPath ( path ) { const apiPrefix = '/api/index_lifecycle_management' ; if ( path ) { return `${ apiPrefix }/${ path }` ; } return apiPrefix ; } export function sendPost ( path , payload , query ? ) { return _httpClient . post ( getFullPath ( path ) , { body : JSON . stringify ( payload ) , query } ) ; } export function sendGet ( path , query ? ) { return _httpClient . get ( getFullPath ( path ) , { query } ) ; } export function sendDelete ( path ) { return _httpClient . delete ( getFullPath ( path ) ) ; } export const useRequest = < T = any , E = { statusCode : number ; error : string ; message : string ; } > ( config ) => { return _useRequest < T , E > ( _httpClient , { ... config , path : getFullPath ( config . path ) } ) ; } ;