export type DeleteApiV1SettingsMetadataIndexesEntitiesEntityNameKeyIndexKeyArgs = {entity_name: 'organization' | 'ledger' | 'asset' | 'segment' | 'portfolio' | 'account' | 'transaction' | 'operation' | 'account_type' | 'operation_route' | 'transaction_route', index_key: string, 'Content-Type'?: string | undefined, 'X-Request-Id'?: string | undefined, Authorization?: string | undefined}; export type DeleteApiV1SettingsMetadataIndexesEntitiesEntityNameKeyIndexKeyOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Metadata Index * * DELETE /v1/settings/metadata-indexes/entities/{entity_name}/key/{index_key} */ export const deleteApiV1SettingsMetadataIndexesEntitiesEntityNameKeyIndexKey = async (args: DeleteApiV1SettingsMetadataIndexesEntitiesEntityNameKeyIndexKeyArgs, options?: DeleteApiV1SettingsMetadataIndexesEntitiesEntityNameKeyIndexKeyOptions) => { const {baseUrl = "https://identity.sandbox.lerian.net", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) if (args['X-Request-Id'] != null) headers.set("X-Request-Id", String(args['X-Request-Id'])) if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/settings/metadata-indexes/entities/${encodeURIComponent(String(args.entity_name))}/key/${encodeURIComponent(String(args.index_key))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };