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

export interface CIMFilteredFindPathsPathFilterProperties extends JSONSupportMixinProperties, Partial<Pick<CIMFilteredFindPathsPathFilter, "filterType" | "iD" | "itemType" | "itemTypeName" | "propertyFilterPredicate">> {}

/**
 * Defines  {@link rest/knowledgGraph/toolSettings/findPaths/CIMFilteredFindPathsConfiguration#pathFilters path filters}  to determine what records are used to find paths in the graph between the
 * {@link rest/knowledgGraph/toolSettings/findPaths/CIMFilteredFindPathsConfiguration#originEntities origin}
 *  and {@link rest/knowledgGraph/toolSettings/findPaths/CIMFilteredFindPathsConfiguration#destinationEntities destination} entities.
 * A path filter can be used for a specific record, in this case the [iD](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-toolService-findPaths-CIMFilteredFindPathsPathFilter.html#iD) is used, or for all records of an entity or relationship
 * type, in which case the  [iD](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-toolService-findPaths-CIMFilteredFindPathsPathFilter.html#iD) is null.
 *
 * @beta
 * @since 4.32
 */
export default class CIMFilteredFindPathsPathFilter extends JSONSupport {
  constructor(properties?: CIMFilteredFindPathsPathFilterProperties);
  /**
   * Specifies the filter type to use in the path filter for the specified entity or relationship.
   * Multiple filters can be defined and multiple of the same filters can be defined.
   *
   * | Filter | Description|
   * |----------|----------|
   * |IncludeOnly| The filtered find paths algorithm will only consider paths which contain included types (type is active). If a path filter does not use the include only option, all types are active.|
   * |Exclude| The filtered find paths algorithm will ignore paths that contain excluded types (type is not active).|
   * |MandatoryWaypoint| The filtered find paths algorithm will only consider paths passing through each mandatory waypoint.|
   * |OptionalWaypoint| The filtered find paths algorithm will only consider paths passing through at least one of the optional waypoints.|
   *
   * @default "Exclude"
   */
  accessor filterType: FilterType;
  /** The unique ID to use as a filter.  If `iD` is undefined, all instances of the type are used. */
  accessor iD: string | null | undefined;
  /**
   * Whether the [iD](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-toolService-findPaths-CIMFilteredFindPathsPathFilter.html#iD) or [itemTypeName](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-toolService-findPaths-CIMFilteredFindPathsPathFilter.html#itemTypeName) is an entity or relationship.
   *
   * @default "Entity"
   */
  accessor itemType: "Entity" | "Relationship";
  /**
   * The [GraphNamedObject#typeName](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphNamedObject.html#typeName) of the entity or relationship specified in [iD](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-toolService-findPaths-CIMFilteredFindPathsPathFilter.html#iD).
   * If `iD` is unspecified, all records of the entity or relationship type will be used.
   */
  accessor itemTypeName: string | null | undefined;
  /**
   * The property filter predicate (openCypher syntax) associated with the path filter.
   *  The predicate is only taken into account when [iD](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-toolService-findPaths-CIMFilteredFindPathsPathFilter.html#iD) has no value.
   */
  accessor propertyFilterPredicate: string | null | undefined;
  /** @default "CIMFilteredFindPathsPathFilter" */
  get type(): "CIMFilteredFindPathsPathFilter";
}

export type FilterType = "IncludeOnly" | "Exclude" | "MandatoryWaypoint" | "OptionalWaypoint";