export type GetApiApiEventsTeamTeamIdArgs = {team_id: number, skipSeasonal?: ('true' | 'false') | undefined, order_by?: ('name' | 'created_at' | 'audits' | 'venue' | 'season') | undefined, order?: ('ASC' | 'DESC') | undefined, startDate?: string | undefined, endDate?: string | undefined, name?: string | undefined, season?: string | undefined, event_type?: string | undefined, eventId?: number | undefined, per_page?: number | undefined, page?: number | undefined}; export type GetApiApiEventsTeamTeamIdOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get events for a specific property/team * * GET /api/events/team/{team_id} */ export const getApiApiEventsTeamTeamId = async (args: GetApiApiEventsTeamTeamIdArgs, options: GetApiApiEventsTeamTeamIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.skipSeasonal != null) query.append("skipSeasonal", String(args.skipSeasonal)) if (args.order_by != null) query.append("order_by", String(args.order_by)) if (args.order != null) query.append("order", String(args.order)) if (args.startDate != null) query.append("startDate", String(args.startDate)) if (args.endDate != null) query.append("endDate", String(args.endDate)) if (args.name != null) query.append("name", String(args.name)) if (args.season != null) query.append("season", String(args.season)) if (args.event_type != null) query.append("event_type", String(args.event_type)) if (args.eventId != null) query.append("eventId", String(args.eventId)) if (args.per_page != null) query.append("per_page", String(args.per_page)) if (args.page != null) query.append("page", String(args.page)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/events/team/${encodeURIComponent(String(args.team_id))}${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 };