export type CreateApiConsumersConsumerIdConnectionsConnectionIdDisableDatalayerArgs = {consumer_id: string, connection_id: string}; export type CreateApiConsumersConsumerIdConnectionsConnectionIdDisableDatalayerOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Disable the datalayer sync for a connection * * POST /consumers/{consumer_id}/connections/{connection_id}/disable_datalayer */ export const createApiConsumersConsumerIdConnectionsConnectionIdDisableDatalayer = async (args: CreateApiConsumersConsumerIdConnectionsConnectionIdDisableDatalayerArgs, options?: CreateApiConsumersConsumerIdConnectionsConnectionIdDisableDatalayerOptions) => { const {baseUrl = "https://api.chift.eu", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/consumers/${encodeURIComponent(String(args.consumer_id))}/connections/${encodeURIComponent(String(args.connection_id))}/disable_datalayer${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };