"""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 ccsds_ndm.models.ndmxml4.ndmxml_4_0_0_common_4_0 import (
    AngleType,
    DeltamassTypeZ,
    DistanceType,
    DurationType,
    GmType,
    InclinationType,
    OdmHeader,
    OpmCovarianceMatrixType,
    SpacecraftParametersType,
    StateVectorType,
    UserDefinedType,
    VelocityTypeUo,
)

__NAMESPACE__ = "urn:ccsds:schema:ndmxml"


@dataclass(kw_only=True)
class OpmMetadata:
    class Meta:
        name = "opmMetadata"

    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,
        }
    )


@dataclass(kw_only=True)
class KeplerianElementsType:
    class Meta:
        name = "keplerianElementsType"

    comment: list[str] = field(
        default_factory=list,
        metadata={
            "name": "COMMENT",
            "type": "Element",
            "namespace": "",
        },
    )
    semi_major_axis: DistanceType = field(
        metadata={
            "name": "SEMI_MAJOR_AXIS",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    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,
        }
    )
    true_anomaly: None | AngleType = field(
        default=None,
        metadata={
            "name": "TRUE_ANOMALY",
            "type": "Element",
            "namespace": "",
        },
    )
    mean_anomaly: None | AngleType = field(
        default=None,
        metadata={
            "name": "MEAN_ANOMALY",
            "type": "Element",
            "namespace": "",
        },
    )
    gm: GmType = field(
        metadata={
            "name": "GM",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )


@dataclass(kw_only=True)
class ManeuverParametersType:
    class Meta:
        name = "maneuverParametersType"

    comment: list[str] = field(
        default_factory=list,
        metadata={
            "name": "COMMENT",
            "type": "Element",
            "namespace": "",
        },
    )
    man_epoch_ignition: str = field(
        metadata={
            "name": "MAN_EPOCH_IGNITION",
            "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*)?",
        }
    )
    man_duration: DurationType = field(
        metadata={
            "name": "MAN_DURATION",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    man_delta_mass: DeltamassTypeZ = field(
        metadata={
            "name": "MAN_DELTA_MASS",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    man_ref_frame: str = field(
        metadata={
            "name": "MAN_REF_FRAME",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    man_dv_1: VelocityTypeUo = field(
        metadata={
            "name": "MAN_DV_1",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    man_dv_2: VelocityTypeUo = field(
        metadata={
            "name": "MAN_DV_2",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    man_dv_3: VelocityTypeUo = field(
        metadata={
            "name": "MAN_DV_3",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )


@dataclass(kw_only=True)
class OpmData:
    class Meta:
        name = "opmData"

    comment: list[str] = field(
        default_factory=list,
        metadata={
            "name": "COMMENT",
            "type": "Element",
            "namespace": "",
        },
    )
    state_vector: StateVectorType = field(
        metadata={
            "name": "stateVector",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    keplerian_elements: None | KeplerianElementsType = field(
        default=None,
        metadata={
            "name": "keplerianElements",
            "type": "Element",
            "namespace": "",
        },
    )
    spacecraft_parameters: None | SpacecraftParametersType = field(
        default=None,
        metadata={
            "name": "spacecraftParameters",
            "type": "Element",
            "namespace": "",
        },
    )
    covariance_matrix: None | OpmCovarianceMatrixType = field(
        default=None,
        metadata={
            "name": "covarianceMatrix",
            "type": "Element",
            "namespace": "",
        },
    )
    maneuver_parameters: list[ManeuverParametersType] = field(
        default_factory=list,
        metadata={
            "name": "maneuverParameters",
            "type": "Element",
            "namespace": "",
        },
    )
    user_defined_parameters: None | UserDefinedType = field(
        default=None,
        metadata={
            "name": "userDefinedParameters",
            "type": "Element",
            "namespace": "",
        },
    )


@dataclass(kw_only=True)
class OpmSegment:
    class Meta:
        name = "opmSegment"

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


@dataclass(kw_only=True)
class OpmBody:
    class Meta:
        name = "opmBody"

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


@dataclass(kw_only=True)
class OpmType:
    class Meta:
        name = "opmType"

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