export type DeleteApiAmlMonitoringsIdArgs = {id: string}; export type DeleteApiAmlMonitoringsIdOptions = {baseUrl?: string | undefined, apiKeyPair?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete AML monitoring * * DELETE /aml/monitorings/{id}/ */ export const deleteApiAmlMonitoringsId = async (args: DeleteApiAmlMonitoringsIdArgs, options?: DeleteApiAmlMonitoringsIdOptions) => { const {baseUrl = "https://ivs.idenfy.com", fetch: fetchFn = fetch, apiKeyPair} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKeyPair !== undefined) headers.set('authorization', `Basic ${btoa(`${apiKeyPair.username}:${apiKeyPair.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/aml/monitorings/${encodeURIComponent(String(args.id))}/${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 };