export type CreateApiV1CookieConsentConfigsConfigIdPublishArgs = {configId: string, body: {keepUnclassifiedTattles?: boolean | undefined, description?: string | undefined, webhookUrl?: string | undefined}}; export type CreateApiV1CookieConsentConfigsConfigIdPublishOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Publish Cookie Consent Configuration * * POST /v1/cookie-consent/configs/{configId}/publish */ export const createApiV1CookieConsentConfigsConfigIdPublish = async (args: CreateApiV1CookieConsentConfigsConfigIdPublishArgs, options?: CreateApiV1CookieConsentConfigsConfigIdPublishOptions) => { const {baseUrl = "https://api.osano.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKeyAuth !== undefined) headers.set("x-osano-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/cookie-consent/configs/${encodeURIComponent(String(args.configId))}/publish${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };