import { Endpoint } from '../endpoint'; import { EndpointClientConfig } from '../endpoint-client'; import { Status } from '../types'; import { ConfigEntry } from './installedapps'; export interface CronSchedule { /** * The cron expression for the schedule for CRON schedules. The format * matches that specified by the * [Quartz scheduler](http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html) * but should not include the seconds (1st) field. The exact second will be * chosen at random but will remain consistent. The years part must be less * than 2 years from now. */ expression: string; /** * The timezone id for CRON schedules. */ timezone: string; } export interface OnceSchedule { /** * The time in millis from jan 1 1970 UTC for ONCE schedules. Must be less * than 2 years from now. */ time: number; overwrite?: boolean; } export interface Schedule { /** * The ID of the installed app. */ installedAppId?: string; /** * The ID of the location the installed app is in. */ locationId?: string; /** * list of scheduled execution times in millis from jan 1 1970 UTC */ scheduledExecutions?: number[]; /** * The unique per installed app name of the schedule. */ name: string; cron?: CronSchedule; once?: OnceSchedule; } export declare class SchedulesEndpoint extends Endpoint { constructor(config: EndpointClientConfig); /** * Returns a list of schedules for an installed app * @param installedAppId UUID of the installed app. If the client is configured with an installed app ID then this * parameter is not needed. */ list(installedAppId?: string): Promise; /** * Get a specific schedule * @param name the alphanumeric name of the schedule * @param installedAppId UUID of the installed app. If the client is configured with an installed app ID then this * parameter is not needed. */ get(name: string, installedAppId?: string): Promise; /** * Create a schedule * @param data the schedule definition * @param installedAppId UUID of the installed app. If the client is configured with an installed app ID then this * parameter is not needed. */ create(data: Schedule, installedAppId?: string): Promise; /** * Delete one or more schedules * @param name the name of the schedule to be deleted. If not specified then all schedules of the installed app are * deleted. * @param installedAppId UUID of the installed app. If the client is configured with an installed app ID then this * parameter is not needed. */ delete(name?: string, installedAppId?: string): Promise; /** * Create a schedule using a cron expression. * @param name the name of the schedule * @param expression the cron expression * @param timezone optional time zone. If not specified and the client is configured with a locationId of a location * that has geo-coordinates set, then the time zone of those coordinates is used. If that's not the case the time * zone defaults to UTC. Note that in order for the coordinates lookup to work, the API token must include the * r:locations:* scope. * @param installedAppId UUID of the installed app. If the client is configured with an installed app ID then this * parameter is not needed. */ schedule(name: string, expression: string, timezone?: string, installedAppId?: string): Promise; /** * Create a schedule that runs at a specific time once per day * @param name the name of the schedule * @param dateOrConfig either a SmartApp date configuration setting, an ISO date string of the format * '2020-02-08T16:35:00.000-0800', a 24 hour hh:mm time expression (i.e. 16:35), or a Date object. * configuration setting * @param timezone optional time zone. Not required if the input is a Date object. Otherwise * if not specified and the client is configured with a locationId of a location * that has geo-coordinates set, then the time zone of those coordinates is used. If that's not the case the time * zone defaults to UTC. Note that in order for the coordinates lookup to work, the API token must include the * r:locations:* scope. * @param installedAppId UUID of the installed app. If the client is configured with an installed app ID then this * parameter is not needed. */ runDaily(name: string, dateOrConfig: (string | ConfigEntry[] | Date), timezone?: string, installedAppId?: string): Promise; /** * * @param name * @param dateTime * @param overwrite * @param installedAppId */ runOnce(name: string, dateTime: number | Date, overwrite?: boolean, installedAppId?: string): Promise; /** * Creates a one-time schedule that runs after the specified period of time. * @param name the name of the schedule * @param delay the amount of time that should elapse before the schedule runs, in seconds * @param overwrite if true then a second call with the same name that's made before the first one has run will * replace the first schedule, so that only the second one runs. If false then each call to runIn will result in * a schedule execution. Defaults to true. * @param installedAppId UUID of the installed app. If the client is configured with an installed app ID then this * parameter is not needed. */ runIn(name: string, delay: number, overwrite?: boolean, installedAppId?: string): Promise; /** * Deletes the schedule with the specified name * @param name the schedule name * @param installedAppId UUID of the installed app. If the client is configured with an installed app ID then this * parameter is not needed. * @deprecated use delete(name) instead */ unschedule(name: string, installedAppId?: string): Promise; /** * Deletes all schedules for the installed app * @param installedAppId UUID of the installed app. If the client is configured with an installed app ID then this * parameter is not needed. * @deprecated use delete() instead */ unscheduleAll(installedAppId?: string): Promise; } //# sourceMappingURL=schedules.d.ts.map