export type DeleteApiV1DomainsDomainIdComplianceDomainArgs = {domainId: string}; export type DeleteApiV1DomainsDomainIdComplianceDomainOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete compliance domain * * DELETE /v1/domains/{domainId}/compliance/domain */ export const deleteApiV1DomainsDomainIdComplianceDomain = async (args: DeleteApiV1DomainsDomainIdComplianceDomainArgs, options: DeleteApiV1DomainsDomainIdComplianceDomainOptions) => { const {baseUrl, fetch: fetchFn = fetch, httpAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (httpAuth !== undefined) headers.set('authorization', `Bearer ${httpAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/domains/${encodeURIComponent(String(args.domainId))}/compliance/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 };