export type DeleteApiV1CookieConsentRulesRuleIdArgs = {ruleId: number}; export type DeleteApiV1CookieConsentRulesRuleIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Cookie Consent Rule * * DELETE /v1/cookie-consent/rules/{ruleId} */ export const deleteApiV1CookieConsentRulesRuleId = async (args: DeleteApiV1CookieConsentRulesRuleIdArgs, options?: DeleteApiV1CookieConsentRulesRuleIdOptions) => { const {baseUrl = "https://api.osano.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKeyAuth !== undefined) headers.set("x-osano-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/cookie-consent/rules/${encodeURIComponent(String(args.ruleId))}${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 };