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
from .Dynamics import ConductingEquipment

class MutualCoupling(IdentifiedObject):
    __cim_class__ = URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#MutualCoupling')
    First_Terminal: Optional['Terminal'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#MutualCoupling.First_Terminal')
    Second_Terminal: Optional['Terminal'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#MutualCoupling.Second_Terminal')
    b0ch: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#MutualCoupling.b0ch')
    distance11: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#MutualCoupling.distance11')
    distance12: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#MutualCoupling.distance12')
    distance21: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#MutualCoupling.distance21')
    distance22: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#MutualCoupling.distance22')
    g0ch: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#MutualCoupling.g0ch')
    r0: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#MutualCoupling.r0')
    x0: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#MutualCoupling.x0')

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

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

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

class GroundingImpedance(EarthFaultCompensator):
    __cim_class__ = URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#GroundingImpedance')
    x: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#GroundingImpedance.x')

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

class PetersenCoil(EarthFaultCompensator):
    __cim_class__ = URIRef('http://iec.ch/TC57/2013/CIM-schema-cim16#PetersenCoil')
    mode: Optional['PetersenCoilModeKind'] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#PetersenCoil.mode')
    nominalU: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#PetersenCoil.nominalU')
    offsetCurrent: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#PetersenCoil.offsetCurrent')
    positionCurrent: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#PetersenCoil.positionCurrent')
    xGroundMax: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#PetersenCoil.xGroundMax')
    xGroundMin: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#PetersenCoil.xGroundMin')
    xGroundNominal: Optional[float] = Field(default=None, alias='http://iec.ch/TC57/2013/CIM-schema-cim16#PetersenCoil.xGroundNominal')

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

__all__ = [
    'MutualCoupling',
    'EarthFaultCompensator',
    'GroundingImpedance',
    'PetersenCoil',
]
