import type VerifyCircuitsResult from "../../rest/networks/circuits/support/VerifyCircuitsResult.js";
import type { WaitOptions } from "./typeUtils.js";
import type { RequestOptions } from "../../request/types.js";

export interface CircuitVerifyJobInfoProperties extends Partial<Pick<CircuitVerifyJobInfo, "status" | "statusUrl">> {
  /** The last date and time the service was updated. */
  lastUpdatedTime?: (Date | number | string) | null;
  /** The date and time in which [CircuitManager.submitVerifyJob()](https://developers.arcgis.com/javascript/latest/references/core/networks/CircuitManager/#submitVerifyJob) is first called. */
  submissionTime?: (Date | number | string) | null;
}

export type CircuitVerifyJobStatus = "job-waiting" | "job-executing" | "job-succeeded";

export interface WaitForVerifyOptions extends WaitOptions<CircuitVerifyJobInfo> {}

/**
 * Represents information pertaining to the execution of an asynchronous [CircuitManager.submitVerifyJob()](https://developers.arcgis.com/javascript/latest/references/core/networks/CircuitManager/#submitVerifyJob) request on the server.
 *
 * @since 5.1
 * @see [VerifyCircuitsParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/circuits/support/VerifyCircuitsParameters/)
 * @see [CircuitManager](https://developers.arcgis.com/javascript/latest/references/core/networks/CircuitManager/)
 */
export default class CircuitVerifyJobInfo extends VerifyCircuitsResult {
  constructor(properties?: CircuitVerifyJobInfoProperties);
  /** The last date and time the service was updated. */
  get lastUpdatedTime(): Date | null | undefined;
  set lastUpdatedTime(value: (Date | number | string) | null | undefined);
  /**
   * The job status.
   *
   * @default "job-waiting"
   */
  status: CircuitVerifyJobStatus;
  /** ArcGIS Server Rest API endpoint to the resource that receives the verify circuits request. */
  accessor statusUrl: string;
  /** The date and time in which [CircuitManager.submitVerifyJob()](https://developers.arcgis.com/javascript/latest/references/core/networks/CircuitManager/#submitVerifyJob) is first called. */
  get submissionTime(): Date | null | undefined;
  set submissionTime(value: (Date | number | string) | null | undefined);
  /**
   * Sends a request for the current state of this job.
   *
   * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/references/core/request/#request) to be used for the data request
   * (will override requestOptions defined during construction).
   * @returns When resolved, returns a [CircuitVerifyJobInfo](https://developers.arcgis.com/javascript/latest/references/core/networks/support/CircuitVerifyJobInfo/).
   */
  checkJobStatus(requestOptions?: RequestOptions | null): Promise<CircuitVerifyJobInfo>;
  /**
   * Stop monitoring this job for status updates.
   *
   * ```
   * // Stop monitoring this job for status updates.
   * jobInfo.destroy();
   * ```
   *
   * @see [waitForJobCompletion()](https://developers.arcgis.com/javascript/latest/references/core/networks/support/CircuitVerifyJobInfo/#waitForJobCompletion)
   */
  destroy(): void;
  /**
   * Resolves when an asynchronous job has completed. Optionally job progress can be monitored.
   *
   * @param options - Options. See properties below for object specifications.
   * @returns When resolved, returns a [CircuitVerifyJobInfo](https://developers.arcgis.com/javascript/latest/references/core/networks/support/CircuitVerifyJobInfo/).
   */
  waitForJobCompletion(options?: WaitForVerifyOptions): Promise<CircuitVerifyJobInfo>;
}