export type ScheduleType = 'Playlist' | 'Template' | 'Campaign'; export type ScheduleDevice = {id?: (string | null) | undefined}; 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 SchedulePriorityType = 'Normal' | 'High' | 'Highest' | 'Lowest' | 'Low'; export type ScheduleRequest = {name?: (string | null) | undefined, group_id?: (string | null) | undefined, tags?: (string | null) | undefined, monday?: (boolean | null) | undefined, tuesday?: (boolean | null) | undefined, wednesday?: (boolean | null) | undefined, thursday?: (boolean | null) | undefined, friday?: (boolean | null) | undefined, saturday?: (boolean | null) | undefined, sunday?: (boolean | null) | undefined, start_date?: (string | null) | undefined, end_date?: (string | null) | undefined, start_time?: (string | null) | undefined, end_time?: (string | null) | undefined, template_id?: (string | null) | undefined, playlist_id?: (string | null) | undefined, type?: ScheduleType | undefined, devices?: (Array | null) | undefined, conditions?: (Array | null) | undefined, priority?: SchedulePriorityType | undefined}; export type UpdateApiSchedulesIdArgs = {id: string, body: ScheduleRequest}; export type UpdateApiSchedulesIdOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update schedule. * * PUT /schedules/{id} * * Also accepts auth: ApiKeyInHeader, ApiKeyInQuery */ export const updateApiSchedulesId = async (args: UpdateApiSchedulesIdArgs, options?: UpdateApiSchedulesIdOptions) => { 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(/\/+$/, '')}/schedules/${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 };