/*! * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { CosmosDbClient } from '../client'; import { InterceptorProcessor } from '../interceptor'; import { TaskEnableOptions } from '../types/public'; import { ResolvedTaskDocument } from './document'; import { SerializedTask, TaskBase, TaskStatus } from './types'; export default class TaskImpl implements Task { static create(client: CosmosDbClient, interceptor: InterceptorProcessor, document: ResolvedTaskDocument): TaskImpl; get id(): string; get type(): string; get status(): TaskStatus; get enabled(): boolean; get createTime(): Date; get nextRunTime(): Date | undefined; get lastUpdatedTime(): Date; get lastRun(): { startTime: Date; finishTime: Date; succeeded: boolean; } | undefined; get currentRunStartTime(): Date | undefined; get deliveries(): number; get attempts(): number; get runs(): number; get payload(): T; set payload(payload: T); get interval(): string | number | undefined; get lastRunTime(): Date | undefined; private _data; private _interceptor; private constructor(); save(): Promise; enable(options?: TaskEnableOptions): Promise; /** * Disable the task for processing. If the task is currently running, the * processor will be informed that the task has been disabled. * * @public */ disable(): Promise; /** * Delete this task from the database. The operation is idempotent and will * succeed even if the task has already been deleted. * * @public */ delete(): Promise; toJSON(): SerializedTask; } /** * General representation of a task. It is returned by many methods such as * TaskClient.create, {@link TaskClient.get} and {@link TaskClient.list}. You * should never need to create an instance of this class directly. * * @public */ export interface Task extends TaskBase { /** * User-defined payload holding information about the task. * * @public */ payload: T; /** * Update the task in the database to match the information in this * instance. This can only be called once at a time to avoid race conditions * between different updates of the payload. * * @public */ save(): Promise; /** * Enable the task for processing. * * @public * @param options Task Enable Options */ enable(options?: TaskEnableOptions): Promise; /** * Disable the task for processing. If the task is currently running, the * processor will be informed that the task has been disabled. * * @public */ disable(): Promise; /** * Delete this task from the database. The operation is idempotent and will * succeed even if the task has already been deleted. * * @public */ delete(): Promise; } //# sourceMappingURL=task.d.ts.map