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

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

from __future__ import annotations

from dataclasses import dataclass, field
from enum import Enum

from ccsds_ndm.models.ndmxml1.ndmxml_1_0_navwg_common import (
    AngleRateType,
    AngleType,
    DurationType,
    NdmHeader,
    QuaternionRateType,
    QuaternionType,
    RotationAngleType,
    RotationRateType,
    RotDirectionType,
    RotseqType,
    TimeSystemType,
)

__NAMESPACE__ = "urn:ccsds:recommendation:navigation:schema:ndmxml"


class ApmRateFrameType(Enum):
    EULER_FRAME_A = "EULER_FRAME_A"
    EULER_FRAME_B = "EULER_FRAME_B"


class MomentUnits(Enum):
    KG_M_2 = "kg*m**2"


class TorqueUnits(Enum):
    N_M = "N*m"


@dataclass(kw_only=True)
class ApmMetadata:
    class Meta:
        name = "apmMetadata"

    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: None | str = field(
        default=None,
        metadata={
            "name": "CENTER_NAME",
            "type": "Element",
            "namespace": "",
        },
    )
    time_system: TimeSystemType = field(
        metadata={
            "name": "TIME_SYSTEM",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )


@dataclass(kw_only=True)
class EulerElementsSpinType:
    class Meta:
        name = "eulerElementsSpinType"

    comment: list[str] = field(
        default_factory=list,
        metadata={
            "name": "COMMENT",
            "type": "Element",
            "namespace": "",
        },
    )
    spin_frame_a: str = field(
        metadata={
            "name": "SPIN_FRAME_A",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    spin_frame_b: str = field(
        metadata={
            "name": "SPIN_FRAME_B",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    spin_dir: None | RotDirectionType = field(
        default=None,
        metadata={
            "name": "SPIN_DIR",
            "type": "Element",
            "namespace": "",
        },
    )
    spin_alpha: None | AngleType = field(
        default=None,
        metadata={
            "name": "SPIN_ALPHA",
            "type": "Element",
            "namespace": "",
        },
    )
    spin_delta: None | AngleType = field(
        default=None,
        metadata={
            "name": "SPIN_DELTA",
            "type": "Element",
            "namespace": "",
        },
    )
    spin_angle: None | AngleType = field(
        default=None,
        metadata={
            "name": "SPIN_ANGLE",
            "type": "Element",
            "namespace": "",
        },
    )
    spin_angle_vel: None | AngleRateType = field(
        default=None,
        metadata={
            "name": "SPIN_ANGLE_VEL",
            "type": "Element",
            "namespace": "",
        },
    )
    nutation: None | AngleType = field(
        default=None,
        metadata={
            "name": "NUTATION",
            "type": "Element",
            "namespace": "",
        },
    )
    nutation_per: None | DurationType = field(
        default=None,
        metadata={
            "name": "NUTATION_PER",
            "type": "Element",
            "namespace": "",
        },
    )
    nutation_phase: None | AngleType = field(
        default=None,
        metadata={
            "name": "NUTATION_PHASE",
            "type": "Element",
            "namespace": "",
        },
    )


@dataclass(kw_only=True)
class EulerElementsThreeType:
    class Meta:
        name = "eulerElementsThreeType"

    comment: list[str] = field(
        default_factory=list,
        metadata={
            "name": "COMMENT",
            "type": "Element",
            "namespace": "",
        },
    )
    euler_frame_a: None | str = field(
        default=None,
        metadata={
            "name": "EULER_FRAME_A",
            "type": "Element",
            "namespace": "",
        },
    )
    euler_frame_b: None | str = field(
        default=None,
        metadata={
            "name": "EULER_FRAME_B",
            "type": "Element",
            "namespace": "",
        },
    )
    euler_dir: None | RotDirectionType = field(
        default=None,
        metadata={
            "name": "EULER_DIR",
            "type": "Element",
            "namespace": "",
        },
    )
    euler_rot_seq: None | RotseqType = field(
        default=None,
        metadata={
            "name": "EULER_ROT_SEQ",
            "type": "Element",
            "namespace": "",
        },
    )
    rate_frame: None | ApmRateFrameType = field(
        default=None,
        metadata={
            "name": "RATE_FRAME",
            "type": "Element",
            "namespace": "",
        },
    )
    rotation_angles: None | RotationAngleType = field(
        default=None,
        metadata={
            "name": "rotationAngles",
            "type": "Element",
            "namespace": "",
        },
    )
    rotation_rates: None | RotationRateType = field(
        default=None,
        metadata={
            "name": "rotationRates",
            "type": "Element",
            "namespace": "",
        },
    )


@dataclass(kw_only=True)
class MomentType:
    class Meta:
        name = "momentType"

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


@dataclass(kw_only=True)
class QuaternionStateType:
    class Meta:
        name = "quaternionStateType"

    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*)?",
        }
    )
    q_frame_a: str = field(
        metadata={
            "name": "Q_FRAME_A",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    q_frame_b: str = field(
        metadata={
            "name": "Q_FRAME_B",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    q_dir: RotDirectionType = field(
        metadata={
            "name": "Q_DIR",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    quaternion: QuaternionType = field(
        metadata={
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    quaternion_rate: None | QuaternionRateType = field(
        default=None,
        metadata={
            "name": "quaternionRate",
            "type": "Element",
            "namespace": "",
        },
    )


@dataclass(kw_only=True)
class TorqueType:
    class Meta:
        name = "torqueType"

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


@dataclass(kw_only=True)
class AttManeuverParametersType:
    class Meta:
        name = "attManeuverParametersType"

    comment: list[str] = field(
        default_factory=list,
        metadata={
            "name": "COMMENT",
            "type": "Element",
            "namespace": "",
        },
    )
    man_epoch_start: str = field(
        metadata={
            "name": "MAN_EPOCH_START",
            "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_ref_frame: str = field(
        metadata={
            "name": "MAN_REF_FRAME",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    man_tor_1: TorqueType = field(
        metadata={
            "name": "MAN_TOR_1",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    man_tor_2: TorqueType = field(
        metadata={
            "name": "MAN_TOR_2",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    man_tor_3: TorqueType = field(
        metadata={
            "name": "MAN_TOR_3",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )


@dataclass(kw_only=True)
class AttSpacecraftParametersType:
    class Meta:
        name = "attSpacecraftParametersType"

    comment: list[str] = field(
        default_factory=list,
        metadata={
            "name": "COMMENT",
            "type": "Element",
            "namespace": "",
        },
    )
    inertia_ref_frame: None | str = field(
        default=None,
        metadata={
            "name": "INERTIA_REF_FRAME",
            "type": "Element",
            "namespace": "",
        },
    )
    i11: MomentType = field(
        metadata={
            "name": "I11",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    i22: MomentType = field(
        metadata={
            "name": "I22",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    i33: MomentType = field(
        metadata={
            "name": "I33",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    i12: MomentType = field(
        metadata={
            "name": "I12",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    i13: MomentType = field(
        metadata={
            "name": "I13",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    i23: MomentType = field(
        metadata={
            "name": "I23",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )


@dataclass(kw_only=True)
class ApmData:
    class Meta:
        name = "apmData"

    comment: list[str] = field(
        default_factory=list,
        metadata={
            "name": "COMMENT",
            "type": "Element",
            "namespace": "",
        },
    )
    quaternion_state: QuaternionStateType = field(
        metadata={
            "name": "quaternionState",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    euler_elements_three: None | EulerElementsThreeType = field(
        default=None,
        metadata={
            "name": "eulerElementsThree",
            "type": "Element",
            "namespace": "",
        },
    )
    euler_elements_spin: None | EulerElementsSpinType = field(
        default=None,
        metadata={
            "name": "eulerElementsSpin",
            "type": "Element",
            "namespace": "",
        },
    )
    spacecraft_parameters: None | AttSpacecraftParametersType = field(
        default=None,
        metadata={
            "name": "spacecraftParameters",
            "type": "Element",
            "namespace": "",
        },
    )
    maneuver_parameters: list[AttManeuverParametersType] = field(
        default_factory=list,
        metadata={
            "name": "maneuverParameters",
            "type": "Element",
            "namespace": "",
        },
    )


@dataclass(kw_only=True)
class ApmSegment:
    class Meta:
        name = "apmSegment"

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


@dataclass(kw_only=True)
class ApmBody:
    class Meta:
        name = "apmBody"

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


@dataclass(kw_only=True)
class ApmType:
    class Meta:
        name = "apmType"

    header: NdmHeader = field(
        metadata={
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    body: ApmBody = field(
        metadata={
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    id: str = field(
        init=False,
        default="CCSDS_APM_VERS",
        metadata={
            "type": "Attribute",
            "required": True,
        },
    )
    version: str = field(
        init=False,
        default="1.0",
        metadata={
            "type": "Attribute",
            "required": True,
        },
    )
