import type { JSONSupport } from "../../core/JSONSupport.js";

export interface DataFileProperties extends Partial<Pick<DataFile, "itemId" | "url">> {}

/**
 * A geoprocessing data object containing a data source.
 *
 * @since 4.20
 * @see [geoprocessor](https://developers.arcgis.com/javascript/latest/references/core/rest/geoprocessor/)
 * @example
 * const [Geoprocessor, DataFile] = await $arcgis.import([
 *   "@arcgis/core/rest/Geoprocessor.js", "@arcgis/core/rest/support/DataFile.js"
 * ]);
 * let gp = new Geoprocessor( ... );
 * function requestSucceeded(result) {
 *   let itemID = result.item.itemID;
 *   let dataFile = new DataFile();
 *   dataFile.itemID = itemID;
 *   let params = {
 *     "Input_File": dataFile
 *   };
 *   gp.execute(params).then(function(gpResult){
 *     ...
 *    });
 * }
 */
export default class DataFile extends JSONSupport {
  constructor(properties?: DataFileProperties);
  /**
   * The ID of the uploaded file returned as a result of the upload operation.
   * For ArcGIS Server 10.1 and greater services that support uploads, this class
   * can be used to specify an uploaded item as input by specifying the itemID.
   */
  accessor itemId: string | null | undefined;
  /** URL pointing to the location of the generated printout of the view. */
  accessor url: string | null | undefined;
}