export type KeepUntil = 'UntilDeleted' | 'UntilSpaceNeeded' | 'UntilWatched' | 'UntilDate'; export type DayOfWeek = 'Sunday' | 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday'; export type DayPattern = 'Daily' | 'Weekdays' | 'Weekends'; export type SeriesTimerInfoDto = {Id?: (string | null) | undefined, Type?: (string | null) | undefined, ServerId?: (string | null) | undefined, ExternalId?: (string | null) | undefined, ChannelId?: string | undefined, ExternalChannelId?: (string | null) | undefined, ChannelName?: (string | null) | undefined, ChannelPrimaryImageTag?: (string | null) | undefined, ProgramId?: (string | null) | undefined, ExternalProgramId?: (string | null) | undefined, Name?: (string | null) | undefined, Overview?: (string | null) | undefined, StartDate?: string | undefined, EndDate?: string | undefined, ServiceName?: (string | null) | undefined, Priority?: number | undefined, PrePaddingSeconds?: number | undefined, PostPaddingSeconds?: number | undefined, IsPrePaddingRequired?: boolean | undefined, ParentBackdropItemId?: (string | null) | undefined, ParentBackdropImageTags?: (Array | null) | undefined, IsPostPaddingRequired?: boolean | undefined, KeepUntil?: KeepUntil | undefined, RecordAnyTime?: boolean | undefined, SkipEpisodesInLibrary?: boolean | undefined, RecordAnyChannel?: boolean | undefined, KeepUpTo?: number | undefined, RecordNewOnly?: boolean | undefined, Days?: (Array | null) | undefined, DayPattern?: DayPattern | undefined, ImageTags?: ({[key: string]: string} | null) | undefined, ParentThumbItemId?: (string | null) | undefined, ParentThumbImageTag?: (string | null) | undefined, ParentPrimaryImageItemId?: (string | null) | undefined, ParentPrimaryImageTag?: (string | null) | undefined}; export type CreateApiLiveTvSeriesTimersArgs = {body: SeriesTimerInfoDto}; export type CreateApiLiveTvSeriesTimersOptions = {baseUrl?: string | undefined, CustomAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Creates a live tv series timer. * * POST /LiveTv/SeriesTimers */ export const createApiLiveTvSeriesTimers = async (args: CreateApiLiveTvSeriesTimersArgs, options?: CreateApiLiveTvSeriesTimersOptions) => { const {baseUrl = "http://localhost", fetch: fetchFn = fetch, CustomAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (CustomAuthentication !== undefined) headers.set("X-Emby-Authorization", CustomAuthentication) const url = `${baseUrl.replace(/\/+$/, '')}/LiveTv/SeriesTimers${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 };