"""This file was generated by xsdata, v26.1, on 2026-02-18 00:41:07

Generator: DataclassGenerator
See: https://xsdata.readthedocs.io/
"""

from __future__ import annotations

from dataclasses import dataclass, field
from enum import Enum

from ccsds_ndm.models.ndmxml4.ndmxml_4_0_0_common_4_0 import (
    AngleType,
    DistanceType,
    GmType,
    InclinationType,
    OdmHeader,
    OpmCovarianceMatrixType,
    SpacecraftParametersType,
    UserDefinedType,
)

__NAMESPACE__ = "urn:ccsds:schema:ndmxml"


class AgomUnits(Enum):
    M_2_KG = "m**2/kg"


class BStarUnits(Enum):
    VALUE_1_ER = "1/ER"


class BTermUnits(Enum):
    M_2_KG = "m**2/kg"


class DRevUnits(Enum):
    REV_DAY_2 = "rev/day**2"
    REV_DAY_2_1 = "REV/DAY**2"


class DdRevUnits(Enum):
    REV_DAY_3 = "rev/day**3"
    REV_DAY_3_1 = "REV/DAY**3"


@dataclass(kw_only=True)
class OmmMetadata:
    class Meta:
        name = "ommMetadata"

    comment: list[str] = field(
        default_factory=list,
        metadata={
            "name": "COMMENT",
            "type": "Element",
            "namespace": "",
        },
    )
    object_name: str = field(
        metadata={
            "name": "OBJECT_NAME",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    object_id: str = field(
        metadata={
            "name": "OBJECT_ID",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    center_name: str = field(
        metadata={
            "name": "CENTER_NAME",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    ref_frame: str = field(
        metadata={
            "name": "REF_FRAME",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    ref_frame_epoch: None | str = field(
        default=None,
        metadata={
            "name": "REF_FRAME_EPOCH",
            "type": "Element",
            "namespace": "",
            "pattern": r"\-?\d{4}\d*-((\d{2}\-\d{2})|\d{3})T\d{2}:\d{2}:\d{2}(\.\d*)?(Z|[+|\-]\d{2}:\d{2})?|[+|\-]?\d*(\.\d*)?",
        },
    )
    time_system: str = field(
        metadata={
            "name": "TIME_SYSTEM",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    mean_element_theory: str = field(
        metadata={
            "name": "MEAN_ELEMENT_THEORY",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )


class RevUnits(Enum):
    REV_DAY = "rev/day"
    REV_DAY_1 = "REV/DAY"


@dataclass(kw_only=True)
class AgomType:
    class Meta:
        name = "agomType"

    value: float = field(
        metadata={
            "required": True,
        }
    )
    units: None | AgomUnits = field(
        default=None,
        metadata={
            "type": "Attribute",
        },
    )


@dataclass(kw_only=True)
class BStarType:
    class Meta:
        name = "bStarType"

    value: float = field(
        metadata={
            "required": True,
        }
    )
    units: None | BStarUnits = field(
        default=None,
        metadata={
            "type": "Attribute",
        },
    )


@dataclass(kw_only=True)
class BTermType:
    class Meta:
        name = "bTermType"

    value: float = field(
        metadata={
            "required": True,
        }
    )
    units: None | BTermUnits = field(
        default=None,
        metadata={
            "type": "Attribute",
        },
    )


@dataclass(kw_only=True)
class DRevType:
    class Meta:
        name = "dRevType"

    value: float = field(
        metadata={
            "required": True,
        }
    )
    units: None | DRevUnits = field(
        default=None,
        metadata={
            "type": "Attribute",
        },
    )


@dataclass(kw_only=True)
class DdRevType:
    class Meta:
        name = "ddRevType"

    value: float = field(
        metadata={
            "required": True,
        }
    )
    units: None | DdRevUnits = field(
        default=None,
        metadata={
            "type": "Attribute",
        },
    )


@dataclass(kw_only=True)
class RevType:
    class Meta:
        name = "revType"

    value: float = field(
        metadata={
            "required": True,
        }
    )
    units: None | RevUnits = field(
        default=None,
        metadata={
            "type": "Attribute",
        },
    )


@dataclass(kw_only=True)
class MeanElementsType:
    class Meta:
        name = "meanElementsType"

    comment: list[str] = field(
        default_factory=list,
        metadata={
            "name": "COMMENT",
            "type": "Element",
            "namespace": "",
        },
    )
    epoch: str = field(
        metadata={
            "name": "EPOCH",
            "type": "Element",
            "namespace": "",
            "required": True,
            "pattern": r"\-?\d{4}\d*-((\d{2}\-\d{2})|\d{3})T\d{2}:\d{2}:\d{2}(\.\d*)?(Z|[+|\-]\d{2}:\d{2})?|[+|\-]?\d*(\.\d*)?",
        }
    )
    semi_major_axis: None | DistanceType = field(
        default=None,
        metadata={
            "name": "SEMI_MAJOR_AXIS",
            "type": "Element",
            "namespace": "",
        },
    )
    mean_motion: None | RevType = field(
        default=None,
        metadata={
            "name": "MEAN_MOTION",
            "type": "Element",
            "namespace": "",
        },
    )
    eccentricity: float = field(
        metadata={
            "name": "ECCENTRICITY",
            "type": "Element",
            "namespace": "",
            "required": True,
            "min_inclusive": 0.0,
        }
    )
    inclination: InclinationType = field(
        metadata={
            "name": "INCLINATION",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    ra_of_asc_node: AngleType = field(
        metadata={
            "name": "RA_OF_ASC_NODE",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    arg_of_pericenter: AngleType = field(
        metadata={
            "name": "ARG_OF_PERICENTER",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    mean_anomaly: AngleType = field(
        metadata={
            "name": "MEAN_ANOMALY",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    gm: None | GmType = field(
        default=None,
        metadata={
            "name": "GM",
            "type": "Element",
            "namespace": "",
        },
    )


@dataclass(kw_only=True)
class TleParametersType:
    class Meta:
        name = "tleParametersType"

    comment: list[str] = field(
        default_factory=list,
        metadata={
            "name": "COMMENT",
            "type": "Element",
            "namespace": "",
        },
    )
    ephemeris_type: None | int = field(
        default=None,
        metadata={
            "name": "EPHEMERIS_TYPE",
            "type": "Element",
            "namespace": "",
        },
    )
    classification_type: None | str = field(
        default=None,
        metadata={
            "name": "CLASSIFICATION_TYPE",
            "type": "Element",
            "namespace": "",
        },
    )
    norad_cat_id: None | int = field(
        default=None,
        metadata={
            "name": "NORAD_CAT_ID",
            "type": "Element",
            "namespace": "",
        },
    )
    element_set_no: None | int = field(
        default=None,
        metadata={
            "name": "ELEMENT_SET_NO",
            "type": "Element",
            "namespace": "",
            "min_inclusive": 0,
            "max_inclusive": 9999,
        },
    )
    rev_at_epoch: None | int = field(
        default=None,
        metadata={
            "name": "REV_AT_EPOCH",
            "type": "Element",
            "namespace": "",
        },
    )
    bstar: None | BStarType = field(
        default=None,
        metadata={
            "name": "BSTAR",
            "type": "Element",
            "namespace": "",
        },
    )
    bterm: None | BTermType = field(
        default=None,
        metadata={
            "name": "BTERM",
            "type": "Element",
            "namespace": "",
        },
    )
    mean_motion_dot: DRevType = field(
        metadata={
            "name": "MEAN_MOTION_DOT",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    mean_motion_ddot: None | DdRevType = field(
        default=None,
        metadata={
            "name": "MEAN_MOTION_DDOT",
            "type": "Element",
            "namespace": "",
        },
    )
    agom: None | AgomType = field(
        default=None,
        metadata={
            "name": "AGOM",
            "type": "Element",
            "namespace": "",
        },
    )


@dataclass(kw_only=True)
class OmmData:
    class Meta:
        name = "ommData"

    comment: list[str] = field(
        default_factory=list,
        metadata={
            "name": "COMMENT",
            "type": "Element",
            "namespace": "",
        },
    )
    mean_elements: MeanElementsType = field(
        metadata={
            "name": "meanElements",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    spacecraft_parameters: None | SpacecraftParametersType = field(
        default=None,
        metadata={
            "name": "spacecraftParameters",
            "type": "Element",
            "namespace": "",
        },
    )
    tle_parameters: None | TleParametersType = field(
        default=None,
        metadata={
            "name": "tleParameters",
            "type": "Element",
            "namespace": "",
        },
    )
    covariance_matrix: None | OpmCovarianceMatrixType = field(
        default=None,
        metadata={
            "name": "covarianceMatrix",
            "type": "Element",
            "namespace": "",
        },
    )
    user_defined_parameters: None | UserDefinedType = field(
        default=None,
        metadata={
            "name": "userDefinedParameters",
            "type": "Element",
            "namespace": "",
        },
    )


@dataclass(kw_only=True)
class OmmSegment:
    class Meta:
        name = "ommSegment"

    metadata: OmmMetadata = field(
        metadata={
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    data: OmmData = field(
        metadata={
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )


@dataclass(kw_only=True)
class OmmBody:
    class Meta:
        name = "ommBody"

    segment: OmmSegment = field(
        metadata={
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )


@dataclass(kw_only=True)
class OmmType:
    class Meta:
        name = "ommType"

    header: OdmHeader = field(
        metadata={
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    body: OmmBody = field(
        metadata={
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    id: str = field(
        init=False,
        default="CCSDS_OMM_VERS",
        metadata={
            "type": "Attribute",
            "required": True,
        },
    )
    version: str = field(
        init=False,
        default="3.0",
        metadata={
            "type": "Attribute",
            "required": True,
        },
    )
