export type CustomData = {adobeAnalyticsVariableName?: string | undefined, advancedProposedValues?: string | undefined, createdById?: number | undefined, customEvalCode?: string | undefined, dateCreated?: string | undefined, dateModified?: string | undefined, description?: string | undefined, format?: ('BOOLEAN' | 'NUMBER' | 'STRING') | undefined, gtmVariableName?: string | undefined, id?: number | undefined, index?: number | undefined, isConstant?: boolean | undefined, isFiltrableVentilable?: boolean | undefined, isLearnable?: boolean | undefined, isLocalOnly?: boolean | undefined, method: 'ADOBE_ANALYTICS' | 'CLIENT' | 'CUSTOM_CODE' | 'GTM' | 'SDK' | 'TC' | 'TEALIUM', modificationDate?: string | undefined, name: string, siteCode?: string | undefined, siteId: number, tags?: string | undefined, tcVariableName?: string | undefined, tealiumVariableName?: string | undefined, type?: ('COUNT_LIST' | 'LIST' | 'UNIQUE') | undefined}; export type UpdateApiCustomDatasCustomDataIdArgs = {customDataId: number, body: CustomData}; export type UpdateApiCustomDatasCustomDataIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update custom data * * PUT /custom-datas/{customDataId} */ export const updateApiCustomDatasCustomDataId = async (args: UpdateApiCustomDatasCustomDataIdArgs, options?: UpdateApiCustomDatasCustomDataIdOptions) => { const {baseUrl = "https://api.kameleoon.com", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/custom-datas/${encodeURIComponent(String(args.customDataId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 res.blob() };