import { SavedObjectsClientContract , SimpleSavedObject } from '../../../../../core/public' ; export async function getTitle ( client , indexPatternId ) { const savedObject = ( await client . get ( 'index-pattern' , indexPatternId ) ) as SimpleSavedObject < any > ; if ( savedObject . error ) { throw new Error ( `Unable to get index-pattern title: ${ savedObject . error . message }` ) ; } return savedObject . attributes . title ; }