export type ScrollDirection = 'Horizontal' | 'Vertical'; export type SortOrder = 'Ascending' | 'Descending'; export type DisplayPreferencesDto = {Id?: (string | null) | undefined, ViewType?: (string | null) | undefined, SortBy?: (string | null) | undefined, IndexBy?: (string | null) | undefined, RememberIndexing?: boolean | undefined, PrimaryImageHeight?: number | undefined, PrimaryImageWidth?: number | undefined, CustomPrefs?: ({[key: string]: string} | null) | undefined, ScrollDirection?: ScrollDirection | undefined, ShowBackdrop?: boolean | undefined, RememberSorting?: boolean | undefined, SortOrder?: SortOrder | undefined, ShowSidebar?: boolean | undefined, Client?: (string | null) | undefined}; export type CreateApiDisplayPreferencesDisplayPreferencesIdArgs = {displayPreferencesId: string, userId: string, client: string, body: DisplayPreferencesDto}; export type CreateApiDisplayPreferencesDisplayPreferencesIdOptions = {baseUrl?: string | undefined, CustomAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update Display Preferences. * * POST /DisplayPreferences/{displayPreferencesId} */ export const createApiDisplayPreferencesDisplayPreferencesId = async (args: CreateApiDisplayPreferencesDisplayPreferencesIdArgs, options?: CreateApiDisplayPreferencesDisplayPreferencesIdOptions) => { const {baseUrl = "http://localhost", fetch: fetchFn = fetch, CustomAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.userId != null) query.append("userId", String(args.userId)) if (args.client != null) query.append("client", String(args.client)) if (CustomAuthentication !== undefined) headers.set("X-Emby-Authorization", CustomAuthentication) const url = `${baseUrl.replace(/\/+$/, '')}/DisplayPreferences/${encodeURIComponent(String(args.displayPreferencesId))}${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 };