/**
 * Represents a GP resource exposed by the ArcGIS REST API. A GP resource represents a
 * single task in a GP service published using the ArcGIS Server and it supports one of the
 * following operations dependent on how the service was set up:
 * * [execute()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-geoprocessor.html#execute) - for when the execution type is synchronous.
 * * [submitJob()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-geoprocessor.html#submitJob) - for when the execution type is asynchronous.
 *
 * If `processExtent` is not set then `execute` and `submitJob` will format web requests compatible
 * with ArcGIS version prior to 10.6.1.
 *
 * @since 4.19
 * @see [GPMessage](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-GPMessage.html)
 * @see [ParameterValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-ParameterValue.html)
 * @see [JobInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-JobInfo.html)
 * @see [Sample - Calculate Viewshed](https://developers.arcgis.com/javascript/latest/sample-code/geoprocessing-viewshed/)
 */
import type GPOptions from "./geoprocessor/GPOptions.js";
import type JobInfo from "./support/JobInfo.js";
import type { RequestOptions } from "../request/types.js";

/**
 * Sends a request to the server to execute a synchronous GP task.
 *
 * The results can be retrieved using the
 * [JobInfo.fetchResultData()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-JobInfo.html#fetchResultData),
 * [JobInfo.fetchResultImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-JobInfo.html#fetchResultImage), or
 * [JobInfo.fetchResultMapImageLayer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-JobInfo.html#fetchResultMapImageLayer) methods.
 *
 * @param url - URL to the ArcGIS Server REST resource that represents a Geoprocessing service.
 * @param params - Specifies the input parameters accepted by the task and their corresponding values. These input parameters
 *                          are listed in the parameters field of the associated GP Task resource. For example, assume that a GP Task
 *                          resource has the following input parameters:
 * * `<GPFeatureRecordSetLayer>` Input_Points
 * * `<GPDouble>` Distance
 *
 * The `params` argument would then be an Object of the form:
 *
 * ```
 * {
 *  Input_Points: <FeatureSet>,
 *  Distance: <Number>
 * }
 *
 * ```
 * @param options - specifies the input options for the geoprocessing service return values.
 * The `options` argument could be an Object of the form:
 *
 * ```
 * {
 *   returnZ: true
 * }
 *
 * ```
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an object with the following properties:
 * ```
 * {
 *   messages: <GPMessage[]>,
 *   results: <ParameterValue[]>
 * }
 * ```
 * See the [GPMessage](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-GPMessage.html) and [ParameterValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-ParameterValue.html) classes
 * for more information about the information in this object.
 */
export function execute(url: string, params?: object | null, options?: GPOptions, requestOptions?: RequestOptions): Promise<object>;

/**
 * Submits a job to the server for asynchronous processing by the GP task. The method
 * will resolve immediately after the job has been submitted to the server. Use
 * [JobInfo.waitForJobCompletion()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-JobInfo.html#waitForJobCompletion)
 * to be notified when the job has completed and optionally periodic job status.
 *
 * The results can be retrieved using the
 * [JobInfo.fetchResultData()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-JobInfo.html#fetchResultData),
 * [JobInfo.fetchResultImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-JobInfo.html#fetchResultImage), or
 * [JobInfo.fetchResultMapImageLayer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-JobInfo.html#fetchResultMapImageLayer) methods.
 *
 * @param url - URL to the ArcGIS Server REST resource that represents a Geoprocessing service.
 * @param params - specifies the input parameters accepted by the task and their corresponding values. These input parameters
 *                          are listed in the parameters field of the associated GP Task resource. For example, assume that a GP Task
 *                          resource has the following input parameters:
 * * `<GPFeatureRecordSetLayer>` Input_Points
 * * `<GPDouble>` Distance
 *
 * The `params` argument would then be an Object of the form:
 *
 * ```
 * {
 *   Input_Points: <FeatureSet>,
 *   Distance: <Number>
 * }
 *
 * ```
 * @param options - specifies the input options for the geoprocessing service return values.
 * The `options` argument could be an Object of the form:
 *
 * ```
 * {
 *   returnZ: true
 * }
 *
 * ```
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns a [JobInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-JobInfo.html).
 */
export function submitJob(url: string, params?: object, options?: GPOptions, requestOptions?: RequestOptions): Promise<JobInfo>;