export type GetApiApiV1PlaybackQueuesIdItemsArgs = {id: string, currentQueueItemId?: string | undefined, leading?: number | undefined, trailing?: number | undefined, includeCurrentItemInReturn?: boolean | undefined, sort?: 'createdAt' | undefined, take?: number | undefined, skip?: number | undefined, order?: ('ASC' | 'DESC') | undefined}; export type GetApiApiV1PlaybackQueuesIdItemsOptions = {baseUrl: string, LocalUserJWT?: string | undefined, fetch?: typeof fetch | undefined}; /** * Query queues. * * GET /api/v1/playback-queues/{id}/items */ export const getApiApiV1PlaybackQueuesIdItems = async (args: GetApiApiV1PlaybackQueuesIdItemsArgs, options: GetApiApiV1PlaybackQueuesIdItemsOptions) => { const {baseUrl, fetch: fetchFn = fetch, LocalUserJWT} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.currentQueueItemId != null) query.append("currentQueueItemId", String(args.currentQueueItemId)) if (args.leading != null) query.append("leading", String(args.leading)) if (args.trailing != null) query.append("trailing", String(args.trailing)) if (args.includeCurrentItemInReturn != null) query.append("includeCurrentItemInReturn", String(args.includeCurrentItemInReturn)) if (args.sort != null) query.append("sort", String(args.sort)) if (args.take != null) query.append("take", String(args.take)) if (args.skip != null) query.append("skip", String(args.skip)) if (args.order != null) query.append("order", String(args.order)) if (LocalUserJWT !== undefined) headers.set('authorization', `Bearer ${LocalUserJWT}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/playback-queues/${encodeURIComponent(String(args.id))}/items${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 };