export type CustomFieldResponseItem = {response: string, additionalInput?: string | undefined}; export type CustomFieldTravelerAccess = 'HIDDEN' | 'READ_ACCESS' | 'WRITE_ACCESS'; export type CustomFieldResponse = {customFieldId: string, responseItems?: Array | undefined, travelerAccess: CustomFieldTravelerAccess}; export type VariableName = 'PUBLISHED_FARE' | 'LLF' | 'ADD_COLLECT_AMOUNT' | 'SELECTED_FARE' | 'SPLIT_PAYMENT_FARE'; export type AdditionalInfo = {type: string, name: VariableName} | {type: string, formatExpression: string, variables?: Array | undefined}; export type CustomFieldSelectedOption = {name: string, translatedName?: string | undefined, description?: string | undefined, translatedDescription?: string | undefined, additionalUserInput?: string | undefined, additionalInfos?: Array | undefined, additionalInfoConfigs?: Array | undefined, optionId?: string | undefined}; export type CustomFieldPrefilledResponse = {fieldId: string, fieldName?: string | undefined, armId: string, readOnly?: boolean | undefined, hidden?: boolean | undefined, selectedOptions: Array}; export type EventCustomFieldResponsesRequest = {eventCustomFieldResponses?: Array | undefined, customFieldV3Responses?: Array | undefined}; export type UpdateApiV2EventsEventIdCustomFieldResponsesArgs = {body: EventCustomFieldResponsesRequest}; export type UpdateApiV2EventsEventIdCustomFieldResponsesOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update event custom field responses * * PUT /v2/events/{eventId}/custom-field-responses */ export const updateApiV2EventsEventIdCustomFieldResponses = async (args: UpdateApiV2EventsEventIdCustomFieldResponsesArgs, options?: UpdateApiV2EventsEventIdCustomFieldResponsesOptions) => { const {baseUrl = "https://api-ext-sboxmeta.partners.spotnana.com", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/events/${encodeURIComponent(String(args.eventId))}/custom-field-responses${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 undefined };