export type GetApiAdminMcpMarketingCreativesLocalizationIdDownloadUrlArgs = {'x-mcp-api-key': string, localizationId: string}; export type GetApiAdminMcpMarketingCreativesLocalizationIdDownloadUrlOptions = {baseUrl: string, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Presigned S3 links (15 min) for a creative's media file and poster * * GET /admin/mcp/marketing/creatives/{localizationId}/download-url */ export const getApiAdminMcpMarketingCreativesLocalizationIdDownloadUrl = async (args: GetApiAdminMcpMarketingCreativesLocalizationIdDownloadUrlArgs, options: GetApiAdminMcpMarketingCreativesLocalizationIdDownloadUrlOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['x-mcp-api-key'] != null) headers.set("x-mcp-api-key", String(args['x-mcp-api-key'])) if (bearer !== undefined) headers.set('authorization', `Bearer ${bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/admin/mcp/marketing/creatives/${encodeURIComponent(String(args.localizationId))}/download-url${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };