export type DeleteApiV0PlatformLabelsDomainsDomainArgs = {domain: string, label: string}; export type DeleteApiV0PlatformLabelsDomainsDomainOptions = {baseUrl?: string | undefined, APIKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove Domain Label * * DELETE /v0/platform/labels/domains/{domain} * * Also accepts auth: ClientID */ export const deleteApiV0PlatformLabelsDomainsDomain = async (args: DeleteApiV0PlatformLabelsDomainsDomainArgs, options?: DeleteApiV0PlatformLabelsDomainsDomainOptions) => { const {baseUrl = "https://api.blockaid.io", fetch: fetchFn = fetch, APIKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.label != null) query.append("label", String(args.label)) if (APIKey !== undefined) headers.set("X-API-Key", APIKey) const url = `${baseUrl.replace(/\/+$/, '')}/v0/platform/labels/domains/${encodeURIComponent(String(args.domain))}${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 };