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

export interface SubcircuitProperties extends JSONSupportMixinProperties, Partial<Pick<Subcircuit, "attributes" | "consumerId" | "globalId" | "isReserved" | "name" | "providerId">> {}

/**
 * Represents a subcircuit in a telecom domain network.
 *
 * @beta
 * @since 4.34
 * @see [UtilityNetwork](https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-UtilityNetwork.html)
 * @see [CircuitManager](https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-CircuitManager.html)
 * @see [Circuit](https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-support-Circuit.html)
 * @see [CircuitSection](https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-support-CircuitSection.html)
 * @see [CircuitLocation](https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-support-CircuitLocation.html)
 * @see [Telecom domain network](https://pro.arcgis.com/en/pro-app/latest/help/data/utility-network/telecom-domain-networks.htm)
 */
export default class Subcircuit extends JSONSupport {
  constructor(properties?: SubcircuitProperties);
  /** User-defined attributes on the subcircuit. */
  accessor attributes: Record<string, any> | null | undefined;
  /** The global ID of the circuit that consumes the subcircuit. */
  accessor consumerId: string | null | undefined;
  /** The global ID of the subcircuit. */
  accessor globalId: string | null | undefined;
  /**
   * Whether the subcircuit is reserved for use by its own circuit.
   *
   * When a subcircuit is reserved, it is assigned to its provider circuit and is not available for consumption by other circuits.
   * A subcircuit is reserved when provider ID and consumer ID are the same.
   *
   * @default false
   */
  accessor isReserved: boolean;
  /**
   * The name of the subcircuit.
   * This name is unique within a circuit.
   */
  accessor name: string;
  /** The global ID of the provider circuit in which the subcircuit participates. */
  accessor providerId: string | null | undefined;
  /**
   * Returns the value of the specified attribute.
   *
   * @param name - The name of the attribute.
   * @returns Returns the value of the attribute specified by `name`.
   */
  getAttribute<T = any>(name: string): T;
  /**
   * Sets a new value for the specified attribute.
   *
   * @param name - The name of the attribute to set.
   * @param newValue - The new value to set on the named attribute.
   */
  setAttribute(name: string, newValue: any): void;
}