export type CreateApiAppAnalyzeGOptimizationPmaxCenterOptimizationIdDgChangesLogIdUndoArgs = {optimizationId: number, logId: number}; export type CreateApiAppAnalyzeGOptimizationPmaxCenterOptimizationIdDgChangesLogIdUndoOptions = {baseUrl: string, token?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /app/analyze/g/optimization/pmax-center/{optimizationId}/dg-changes/{logId}/undo */ export const createApiAppAnalyzeGOptimizationPmaxCenterOptimizationIdDgChangesLogIdUndo = async (args: CreateApiAppAnalyzeGOptimizationPmaxCenterOptimizationIdDgChangesLogIdUndoArgs, options: CreateApiAppAnalyzeGOptimizationPmaxCenterOptimizationIdDgChangesLogIdUndoOptions) => { const {baseUrl, fetch: fetchFn = fetch, token} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (token !== undefined) headers.set("authorization", token) const url = `${baseUrl.replace(/\/+$/, '')}/app/analyze/g/optimization/pmax-center/${encodeURIComponent(String(args.optimizationId))}/dg-changes/${encodeURIComponent(String(args.logId))}/undo${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 };