from __future__ import annotations
from typing import List, Optional, Union, Any
from enum import Enum
from pydantic import Field
from ..base import CIMBase, CIMModelRegistry
from rdflib import URIRef

CIM = URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#')

from .DiagramLayout import IdentifiedObject

class StateVariablesVersion(CIMBase):
    __cim_class__ = URIRef('http://entsoe.eu/CIM/SchemaExtension/3/1#StateVariablesVersion')
    baseUML: Optional[str] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#StateVariablesVersion.baseUML')
    baseURI: Optional[str] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#StateVariablesVersion.baseURI')
    date: Optional[str] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#StateVariablesVersion.date')
    differenceModelURI: Optional[str] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#StateVariablesVersion.differenceModelURI')
    entsoeUML: Optional[str] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#StateVariablesVersion.entsoeUML')
    entsoeURI: Optional[str] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#StateVariablesVersion.entsoeURI')
    modelDescriptionURI: Optional[str] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#StateVariablesVersion.modelDescriptionURI')
    namespaceRDF: Optional[str] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#StateVariablesVersion.namespaceRDF')
    namespaceUML: Optional[str] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#StateVariablesVersion.namespaceUML')
    shortName: Optional[str] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#StateVariablesVersion.shortName')

CIMModelRegistry.register(URIRef('http://entsoe.eu/CIM/SchemaExtension/3/1#StateVariablesVersion'), StateVariablesVersion)

class DCTopologicalIsland(IdentifiedObject):
    __cim_class__ = URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#DCTopologicalIsland')
    DCTopologicalNodes: List['DCTopologicalNode'] = Field(default_factory=list, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#DCTopologicalIsland.DCTopologicalNodes')

CIMModelRegistry.register(URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#DCTopologicalIsland'), DCTopologicalIsland)

class SvStatus(CIMBase):
    __cim_class__ = URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#SvStatus')
    ConductingEquipment: Optional['ConductingEquipment'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#SvStatus.ConductingEquipment')
    inService: Optional[bool] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#SvStatus.inService')

CIMModelRegistry.register(URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#SvStatus'), SvStatus)

class SvInjection(CIMBase):
    __cim_class__ = URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#SvInjection')
    TopologicalNode: Optional['TopologicalNode'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#SvInjection.TopologicalNode')
    pInjection: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#SvInjection.pInjection')
    qInjection: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#SvInjection.qInjection')

CIMModelRegistry.register(URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#SvInjection'), SvInjection)

class SvPowerFlow(CIMBase):
    __cim_class__ = URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#SvPowerFlow')
    Terminal: Optional['Terminal'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#SvPowerFlow.Terminal')
    p: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#SvPowerFlow.p')
    q: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#SvPowerFlow.q')

CIMModelRegistry.register(URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#SvPowerFlow'), SvPowerFlow)

class SvShuntCompensatorSections(CIMBase):
    __cim_class__ = URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#SvShuntCompensatorSections')
    ShuntCompensator: Optional['ShuntCompensator'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#SvShuntCompensatorSections.ShuntCompensator')
    sections: Optional['Simple_Float'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#SvShuntCompensatorSections.sections')

CIMModelRegistry.register(URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#SvShuntCompensatorSections'), SvShuntCompensatorSections)

class SvTapStep(CIMBase):
    __cim_class__ = URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#SvTapStep')
    TapChanger: Optional['TapChanger'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#SvTapStep.TapChanger')
    position: Optional['Simple_Float'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#SvTapStep.position')

CIMModelRegistry.register(URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#SvTapStep'), SvTapStep)

class SvVoltage(CIMBase):
    __cim_class__ = URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#SvVoltage')
    TopologicalNode: Optional['TopologicalNode'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#SvVoltage.TopologicalNode')
    angle: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#SvVoltage.angle')
    v: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#SvVoltage.v')

CIMModelRegistry.register(URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#SvVoltage'), SvVoltage)

class DCTopologicalNode(IdentifiedObject):
    __cim_class__ = URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#DCTopologicalNode')
    DCEquipmentContainer: Optional['DCEquipmentContainer'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#DCTopologicalNode.DCEquipmentContainer')
    DCNodes: List['DCNode'] = Field(default_factory=list, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#DCTopologicalNode.DCNodes')
    DCTerminals: List['DCBaseTerminal'] = Field(default_factory=list, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#DCTopologicalNode.DCTerminals')
    DCTopologicalIsland: Optional['DCTopologicalIsland'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#DCTopologicalNode.DCTopologicalIsland')

CIMModelRegistry.register(URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#DCTopologicalNode'), DCTopologicalNode)

class TopologicalNode(CIMBase):
    __cim_class__ = URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#TopologicalNode')
    AngleRefTopologicalIsland: Optional['TopologicalIsland'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#TopologicalNode.AngleRefTopologicalIsland')
    BaseVoltage: Optional['BaseVoltage'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#TopologicalNode.BaseVoltage')
    ConnectivityNodeContainer: Optional['ConnectivityNodeContainer'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#TopologicalNode.ConnectivityNodeContainer')
    ConnectivityNodes: List['ConnectivityNode'] = Field(default_factory=list, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#TopologicalNode.ConnectivityNodes')
    ReportingGroup: Optional['ReportingGroup'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#TopologicalNode.ReportingGroup')
    SvInjection: Optional['SvInjection'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#TopologicalNode.SvInjection')
    SvVoltage: Optional['SvVoltage'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#TopologicalNode.SvVoltage')
    Terminal: List['Terminal'] = Field(default_factory=list, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#TopologicalNode.Terminal')
    TopologicalIsland: Optional['TopologicalIsland'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#TopologicalNode.TopologicalIsland')
    boundaryPoint: Optional[bool] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#TopologicalNode.boundaryPoint')
    fromEndIsoCode: Optional[str] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#TopologicalNode.fromEndIsoCode')
    fromEndName: Optional[str] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#TopologicalNode.fromEndName')
    fromEndNameTso: Optional[str] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#TopologicalNode.fromEndNameTso')
    toEndIsoCode: Optional[str] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#TopologicalNode.toEndIsoCode')
    toEndName: Optional[str] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#TopologicalNode.toEndName')
    toEndNameTso: Optional[str] = Field(default=None, alias='http://entsoe.eu/CIM/SchemaExtension/3/1#TopologicalNode.toEndNameTso')

CIMModelRegistry.register(URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#TopologicalNode'), TopologicalNode)

class TopologicalIsland(IdentifiedObject):
    __cim_class__ = URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#TopologicalIsland')
    AngleRefTopologicalNode: Optional['TopologicalNode'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#TopologicalIsland.AngleRefTopologicalNode')
    TopologicalNodes: List['TopologicalNode'] = Field(default_factory=list, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#TopologicalIsland.TopologicalNodes')

CIMModelRegistry.register(URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#TopologicalIsland'), TopologicalIsland)

__all__ = [
    'StateVariablesVersion',
    'DCTopologicalIsland',
    'SvStatus',
    'SvInjection',
    'SvPowerFlow',
    'SvShuntCompensatorSections',
    'SvTapStep',
    'SvVoltage',
    'DCTopologicalNode',
    'TopologicalNode',
    'TopologicalIsland',
]
