import type FieldIndex from "./FieldIndex.js";
import type GraphProperty from "./GraphProperty.js";
import type { JSONSupport, JSONSupportMixinProperties } from "../../core/JSONSupport.js";
import type { NamedObjectType } from "./wasmInterface/WasmDataModelWrapperInterfaces.js";
import type { GraphPropertyProperties } from "./GraphProperty.js";
import type { FieldIndexProperties } from "./FieldIndex.js";

export interface GraphObjectTypeProperties extends JSONSupportMixinProperties, Partial<Pick<GraphObjectType, "alias" | "name" | "role">> {
  /** Specifies [index fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-FieldIndex.html) for a graph object type. [executeSearch()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraphService.html#executeSearch) will include content from indexed text and [GUID](https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/arcgis-field-data-types.htm#GUID-97064FAE-B42E-4DC3-A5C9-9A6F12D053A8) fields. */
  fieldIndexes?: FieldIndexProperties[];
  /** Specifies the [properties](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphProperty.html) of a graph object type such as an [EntityType](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-EntityType.html) or [RelationshipType](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-RelationshipType.html). */
  properties?: GraphPropertyProperties[];
}

/**
 * Parent object for [entity types](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-EntityType.html) and [relationship types](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-RelationshipType.html) defined in the graph schema.
 *
 * @since 4.25
 * @see [EntityType](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-EntityType.html)
 * @see [RelationshipType](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-RelationshipType.html)
 * @example
 * //sample structure of an entity type
 * {
 *  "declaredClass": "esri.rest.knowledgeGraph.EntityType",
 *  "name": "company",
 *  "alias": "Company",
 *  "role": "Regular",
 *  "strict": false,
 *  "properties": [
 *    {
 *      "declaredClass": "esri.rest.knowledgeGraph.GraphProperty",
 *      "name": "Name",
 *      "alias": "Name",
 *      "fieldType": "esriFieldTypeString",
 *      "geometryType": "esriGeometryNull",
 *      "hasM": false,
 *      "hasZ": false,
 *      "nullable": true,
 *      "editable": true,
 *      "required": false,
 *      "defaultVisibility": true,
 *      "systemMaintained": false,
 *      "role": "esriGraphPropertyRegular",
 *      "defaultValue": null
 *    },
 *    {
 *      "declaredClass": "esri.rest.knowledgeGraph.GraphProperty",
 *      "name": "id",
 *      "alias": "id",
 *      "fieldType": "esriFieldTypeOID",
 *      "geometryType": "esriGeometryNull",
 *      "hasM": false,
 *      "hasZ": false,
 *      "nullable": false,
 *      "editable": false,
 *      "required": true,
 *      "defaultVisibility": true,
 *      "systemMaintained": true,
 *      "role": "esriGraphPropertyRegular",
 *      "defaultValue": null
 *    }
 *  ],
 *  "fieldIndexes": [
 *    {
 *      "declaredClass": "esri.rest.knowledgeGraph.FieldIndex",
 *      "name": "esri__id_idx",
 *      "unique": true,
 *      "ascending": true,
 *      "description": "",
 *      "fieldNames": [
 *        "id"
 *      ]
 *    },
 *    {
 *      "declaredClass": "esri.rest.knowledgeGraph.FieldIndex",
 *      "name": "esri__name_idx",
 *      "unique": true,
 *      "ascending": true,
 *      "description": "",
 *      "fieldNames": [
 *        "name"
 *      ]
 *    }
 *  ]
 * }
 */
export default class GraphObjectType extends JSONSupport {
  constructor(properties?: GraphObjectTypeProperties);
  /** - The display name of the graph object type that can be updated. */
  accessor alias: string | null | undefined;
  /** Specifies [index fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-FieldIndex.html) for a graph object type. [executeSearch()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraphService.html#executeSearch) will include content from indexed text and [GUID](https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/arcgis-field-data-types.htm#GUID-97064FAE-B42E-4DC3-A5C9-9A6F12D053A8) fields. */
  get fieldIndexes(): FieldIndex[];
  set fieldIndexes(value: FieldIndexProperties[]);
  /** The name of the graph object type. */
  accessor name: string;
  /** Specifies the [properties](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphProperty.html) of a graph object type such as an [EntityType](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-EntityType.html) or [RelationshipType](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-RelationshipType.html). */
  get properties(): GraphProperty[];
  set properties(value: GraphPropertyProperties[]);
  /**
   * The object type's role in the knowledge graph. Designates objects that have capabilities that are not available to other objects.
   * For example, the document entity type has a specific role of 'Document'. The `Document` entity type (and the associated `HasDocument` relationship) are included in all knowledge graph services by default.
   *
   * @default "Regular"
   */
  accessor role: NamedObjectType;
}