/* tslint:disable */ /* eslint-disable */ /** * ELEMENTS API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { exists, mapValues } from '../runtime'; /** * * @export * @interface Schedule */ export interface Schedule { /** * * @type {number} * @memberof Schedule */ id: number; /** * * @type {{ [key: string]: string | undefined; }} * @memberof Schedule */ variables?: { [key: string]: string | undefined; }; /** * * @type {Date} * @memberof Schedule */ readonly nextRun: Date; /** * * @type {number} * @memberof Schedule */ type?: ScheduleTypeEnum; /** * * @type {boolean} * @memberof Schedule */ enabled?: boolean; /** * * @type {Date} * @memberof Schedule */ lastRun?: Date | null; /** * * @type {number} * @memberof Schedule */ every?: number; /** * * @type {string} * @memberof Schedule */ period?: SchedulePeriodEnum; /** * * @type {string} * @memberof Schedule */ crontabDayOfMonth?: string; /** * * @type {string} * @memberof Schedule */ crontabDayOfWeek?: string; /** * * @type {string} * @memberof Schedule */ crontabHour?: string; /** * * @type {string} * @memberof Schedule */ crontabMinute?: string; /** * * @type {string} * @memberof Schedule */ crontabMonthOfYear?: string; /** * * @type {number} * @memberof Schedule */ job: number; } /** * @export * @enum {string} */ export enum ScheduleTypeEnum { NUMBER_1 = 1, NUMBER_2 = 2 }/** * @export * @enum {string} */ export enum SchedulePeriodEnum { Minutes = 'minutes', Hours = 'hours', Days = 'days' } export function ScheduleFromJSON(json: any): Schedule { return ScheduleFromJSONTyped(json, false); } export function ScheduleFromJSONTyped(json: any, ignoreDiscriminator: boolean): Schedule { if ((json === undefined) || (json === null)) { return json; } return { 'id': json['id'], 'variables': !exists(json, 'variables') ? undefined : json['variables'], 'nextRun': (new Date(json['next_run'])), 'type': !exists(json, 'type') ? undefined : json['type'], 'enabled': !exists(json, 'enabled') ? undefined : json['enabled'], 'lastRun': !exists(json, 'last_run') ? undefined : (json['last_run'] === null ? null : new Date(json['last_run'])), 'every': !exists(json, 'every') ? undefined : json['every'], 'period': !exists(json, 'period') ? undefined : json['period'], 'crontabDayOfMonth': !exists(json, 'crontab_day_of_month') ? undefined : json['crontab_day_of_month'], 'crontabDayOfWeek': !exists(json, 'crontab_day_of_week') ? undefined : json['crontab_day_of_week'], 'crontabHour': !exists(json, 'crontab_hour') ? undefined : json['crontab_hour'], 'crontabMinute': !exists(json, 'crontab_minute') ? undefined : json['crontab_minute'], 'crontabMonthOfYear': !exists(json, 'crontab_month_of_year') ? undefined : json['crontab_month_of_year'], 'job': json['job'], }; } export function ScheduleToJSON(value?: Schedule | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'id': value.id, 'variables': value.variables, 'type': value.type, 'enabled': value.enabled, 'last_run': value.lastRun === undefined ? undefined : (value.lastRun === null ? null : value.lastRun.toISOString()), 'every': value.every, 'period': value.period, 'crontab_day_of_month': value.crontabDayOfMonth, 'crontab_day_of_week': value.crontabDayOfWeek, 'crontab_hour': value.crontabHour, 'crontab_minute': value.crontabMinute, 'crontab_month_of_year': value.crontabMonthOfYear, 'job': value.job, }; }