export type TeachingEventAddAttendee = {candidateId?: (string | null) | undefined, qualificationId?: (string | null) | undefined, eventId: string, channelId?: (number | null) | undefined, creationChannelSourceId?: (number | null) | undefined, creationChannelServiceId?: (number | null) | undefined, creationChannelActivityId?: (number | null) | undefined, acceptedPolicyId: string, preferredTeachingSubjectId?: (string | null) | undefined, considerationJourneyStageId?: (number | null) | undefined, degreeStatusId?: (number | null) | undefined, email: string, firstName: string, lastName: string, addressPostcode?: (string | null) | undefined, addressTelephone?: (string | null) | undefined, isVerified?: boolean | undefined, isWalkIn?: boolean | undefined, subscribeToMailingList?: boolean | undefined, alreadySubscribedToEvents?: boolean | undefined, alreadySubscribedToMailingList?: boolean | undefined, alreadySubscribedToTeacherTrainingAdviser?: boolean | undefined, defaultContactCreationChannel?: (number | null) | undefined, defaultCreationChannelSourceId?: (number | null) | undefined, defaultCreationChannelServiceId?: (number | null) | undefined, defaultCreationChannelActivityId?: (number | null) | undefined, accessibilityNeedsForEvent?: (string | null) | undefined}; export type CreateApiApiTeachingEventsAttendeesArgs = {body: TeachingEventAddAttendee}; export type CreateApiApiTeachingEventsAttendeesOptions = {baseUrl: string, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Adds an attendee to a teaching event. * * POST /api/teaching_events/attendees */ export const createApiApiTeachingEventsAttendees = async (args: CreateApiApiTeachingEventsAttendeesArgs, options: CreateApiApiTeachingEventsAttendeesOptions) => { const {baseUrl, fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (apiKey !== undefined) headers.set("Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/teaching_events/attendees${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };