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

export interface QueryAssociationsResultProperties {
  /** List of [associations](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-networks-support-Association.html) returned filtered based on the input parameters in [QueryAssociationsParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-networks-support-QueryAssociationsParameters.html). */
  associations?: AssociationProperties[];
}

/**
 * Defines the results of the [queryAssociations](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-networks-queryAssociations.html) function which takes in [QueryAssociationsParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-networks-support-QueryAssociationsParameters.html) and returns an [QueryAssociationsResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-networks-support-QueryAssociationsResult.html) of all
 * [associations](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-networks-support-Association.html) filtered by the parameters set.
 *
 * @since 4.25
 * @see [Association](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-networks-support-Association.html)
 * @see [AggregatedGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-networks-support-AggregatedGeometry.html)
 * @see [queryAssociations](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-networks-queryAssociations.html)
 * @example
 * // Define the QueryAssociationsParameters
 * const queryAssociationsParameters = new QueryAssociationsParameters({
 *   types: ["containment", "attachment", "junction-edge-from-connectivity"],
 *   elements: [
 *     {
 *       networkSourceId: 2,
 *       globalId: "{46B3FA19-2237-4D38-A7CF-AA34C3T40420}",
 *       objectId: 44,
 *       terminalId: 1,
 *       assetGroupCode: 1,
 *       assetTypeCode: 1
 *     },
 *     {
 *       networkSourceId: 9,
 *       globalId: "{321C0089-1165-42D9-K45B-ED91B1A40500}",
 *       objectId: 45,
 *       terminalId: 1,
 *       assetGroupCode: 13,
 *       assetTypeCode: 441
 *     }
 *  ]
 * });
 *
 * // Query associations, and assign the query result to a variable `associations`
 * const associations = await queryAssociations(networkServiceUrl, queryAssociationsParameters);
 *
 * // Print out the first association
 * console.log(associations[0]);
 */
export default class QueryAssociationsResult extends JSONSupport {
  constructor(properties?: QueryAssociationsResultProperties);
  /** List of [associations](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-networks-support-Association.html) returned filtered based on the input parameters in [QueryAssociationsParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-networks-support-QueryAssociationsParameters.html). */
  get associations(): Association[];
  set associations(value: AssociationProperties[]);
}