import type Association from "./Association.js";
import type { JSONSupport } from "../../../core/JSONSupport.js";
import type { UnitIdentifier } from "../../../networks/support/jsonTypes.js";
import type { AssociationProperties } from "./Association.js";

export interface TraverseAssociationsResultProperties extends Partial<Pick<TraverseAssociationsResult, "objects">> {
  /** List of [associations](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/Association/) returned filtered based on the input parameters in [TraverseAssociationsParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/TraverseAssociationsParameters/). */
  associations?: AssociationProperties[];
}

/**
 * Defines the results of the [traverseAssociations](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/traverseAssociations/) function which takes in [TraverseAssociationsParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/TraverseAssociationsParameters/) and returns a [TraverseAssociationsResult](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/TraverseAssociationsResult/).
 * The result includes [associations](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/Association/) and [UnitIdentifiers](https://developers.arcgis.com/javascript/latest/references/core/networks/support/jsonTypes/#UnitIdentifier) filtered by the parameters set.
 *
 * @since 5.2
 * @see [Association](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/Association/)
 * @see [traverseAssociations](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/traverseAssociations/)
 * @example
 * const traverseAssociationsParameters = new TraverseAssociationsParameters({
 *   direction: "ascending",
 *   stopAtFirstSpatial: false,
 *   elements: [
 *     {
 *       networkSourceId: 19,
 *       globalId: "{AE323515-8E6F-4CC2-B9A8-1DB963E769AB}"
 *     }
 *  ]
 * });
 *
 * const result = await traverseAssociations(networkServiceUrl, traverseAssociationsParameters);
 */
export default class TraverseAssociationsResult extends JSONSupport {
  constructor(properties?: TraverseAssociationsResultProperties);
  /** List of [associations](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/Association/) returned filtered based on the input parameters in [TraverseAssociationsParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/TraverseAssociationsParameters/). */
  get associations(): Association[];
  set associations(value: AssociationProperties[]);
  /** Contains IDs for the objects that are returned during the traversal process based on the input parameters in [TraverseAssociationsParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/TraverseAssociationsParameters/). */
  accessor objects: UnitIdentifier[] | null | undefined;
}