export type PlaylistType = 'Multimedia' | 'Slideshow' | 'Template' | 'Marquee'; export type SourceType = 'Audio' | 'Command' | 'Flash' | 'Gadget' | 'Image' | 'Pdf' | 'PlaceExchange' | 'Playlist' | 'PowerPoint' | 'Rss' | 'Svg' | 'Template' | 'Text' | 'Twitter' | 'Url' | 'Video' | 'VistarMedia' | 'WebPage' | 'YouTube' | 'VistarMediaEx' | 'DataTable' | 'AdBreak'; export type Media = {name?: (string | null) | undefined, group_id?: (string | null) | undefined, tags?: (string | null) | undefined, advertiser_id?: (string | null) | undefined, is_shared?: (boolean | null) | undefined, start_date?: (string | null) | undefined, end_date?: (string | null) | undefined, id?: (string | null) | undefined, group_name?: (string | null) | undefined, mime_type?: (string | null) | undefined, file_size?: number | undefined, file_name?: (string | null) | undefined, file_url?: (string | null) | undefined, thumbnail_url?: (string | null) | undefined, uploaded_on?: (string | null) | undefined, uploaded_by_id?: (string | null) | undefined, sha_512?: (string | null) | undefined, width?: (number | null) | undefined, height?: (number | null) | undefined, is_approved?: (boolean | null) | undefined, approved_on?: (string | null) | undefined, declined_on?: (string | null) | undefined, declined_reason?: (string | null) | undefined}; export type LoopPolicyType = 'Default' | 'OverSaturate2x' | 'OverSaturate3x' | 'OverSaturate4x' | 'OverSaturate5x' | 'Random' | 'UnderSaturate2x' | 'UnderSaturate3x' | 'UnderSaturate4x' | 'UnderSaturate5x' | 'Prefill' | 'Postfill' | 'Spreadfill'; export type ConditionType = 'AfterDate' | 'AfterTime' | 'Always' | 'BeaconActive' | 'BeforeDate' | 'BeforeTime' | 'Command' | 'DateRange' | 'DayOfMonth' | 'DaysOfWeek' | 'DeviceByGroup' | 'DeviceByNestedGroup' | 'DeviceByName' | 'DeviceByTag' | 'DeviceByOrg' | 'Everywhere' | 'GeoLocation' | 'GpsWithinRadius' | 'KeyEvent' | 'MonthOfYear' | 'Motion' | 'Never' | 'Nowhere' | 'PctAdult' | 'PctChild' | 'PctFemale' | 'PctMale' | 'PctSenior' | 'PctYoung' | 'PctYoungAdult' | 'PlaylistByName' | 'PlaylistByTag' | 'SendCommand' | 'SpecificDevice' | 'SpecificPlaylist' | 'SpecificTemplate' | 'SpecificZone' | 'TemplateByName' | 'TemplateByTag' | 'TimeRange' | 'TopicSet' | 'TotalViewersGreaterThan' | 'TotalViewersLessThan' | 'TouchEvent' | 'WeekOfMonth' | 'WeekOfYear'; export type ConditionOperator = 'And' | 'Or' | 'AndNot' | 'OrNot'; export type Condition = {type?: ConditionType | undefined, operator?: ConditionOperator | undefined, value_1?: (string | null) | undefined, value_2?: (string | null) | undefined, value_3?: (string | null) | undefined, value_4?: (string | null) | undefined}; export type Source = {id?: (string | null) | undefined, name?: (string | null) | undefined, type?: SourceType | undefined, sequence?: (number | null) | undefined, media_id?: (string | null) | undefined, template_id?: (string | null) | undefined, playlist_id?: (string | null) | undefined, value?: (string | null) | undefined, interval?: (number | null) | undefined, media?: Media | undefined, loop_policy_type?: LoopPolicyType | undefined, conditions?: (Array | null) | undefined}; export type Playlist = {id?: (string | null) | undefined, name?: (string | null) | undefined, group_name?: (string | null) | undefined, group_id?: (string | null) | undefined, tags?: (string | null) | undefined, type?: PlaylistType | undefined, duration?: (number | null) | undefined, calculated_duration?: (number | null) | undefined, is_random_start?: (boolean | null) | undefined, created_on?: (string | null) | undefined, created_by_id?: (string | null) | undefined, modified_on?: (string | null) | undefined, modified_by_id?: (string | null) | undefined, sources?: (Array | null) | undefined}; export type UpdateApiPlaylistsIdArgs = {id: string, body: Playlist}; export type UpdateApiPlaylistsIdOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Put a playlist. Replaces a playlist with the one provided. * * PUT /playlists/{id} * * Also accepts auth: ApiKeyInHeader, ApiKeyInQuery */ export const updateApiPlaylistsId = async (args: UpdateApiPlaylistsIdArgs, options?: UpdateApiPlaylistsIdOptions) => { const {baseUrl = "https://api.reveldigital.com", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/playlists/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };