"""This file was generated by xsdata, v26.1, on 2026-02-18 00:40: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.ndmxml2.ndmxml_2_0_0_common_2_0 import (
    AngleRateType,
    AngleType,
    DurationType,
    NdmHeader,
    QuaternionRateType,
    QuaternionType,
    RotationAngleType,
    RotationRateType,
    RotDirectionType,
    RotseqType,
    TimeSystemType,
)

__NAMESPACE__ = "urn:ccsds:schema:ndmxml"


class AemRateFrameType(Enum):
    REF_FRAME_A = "ref_frame_a"
    REF_FRAME_A_1 = "REF_FRAME_A"
    REF_FRAME_B = "ref_frame_b"
    REF_FRAME_B_1 = "REF_FRAME_B"


class AttitudeTypeType(Enum):
    QUATERNION = "quaternion"
    QUATERNION_1 = "QUATERNION"
    QUATERNION_DERIVATIVE = "quaternion/derivative"
    QUATERNION_DERIVATIVE_1 = "QUATERNION/DERIVATIVE"
    QUATERNION_RATE = "quaternion/rate"
    QUATERNION_RATE_1 = "QUATERNION/RATE"
    EULER_ANGLE = "euler_angle"
    EULER_ANGLE_1 = "EULER_ANGLE"
    EULER_ANGLE_RATE = "euler_angle/rate"
    EULER_ANGLE_RATE_1 = "EULER_ANGLE/RATE"
    SPIN = "spin"
    SPIN_1 = "SPIN"
    SPIN_NUTATION = "spin/nutation"
    SPIN_NUTATION_1 = "SPIN/NUTATION"


class QuaternionTypeType(Enum):
    FIRST = "first"
    FIRST_1 = "FIRST"
    LAST = "last"
    LAST_1 = "LAST"


@dataclass(kw_only=True)
class AemMetadata:
    class Meta:
        name = "aemMetadata"

    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": "",
        },
    )
    ref_frame_a: str = field(
        metadata={
            "name": "REF_FRAME_A",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    ref_frame_b: str = field(
        metadata={
            "name": "REF_FRAME_B",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    attitude_dir: RotDirectionType = field(
        metadata={
            "name": "ATTITUDE_DIR",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    time_system: TimeSystemType = field(
        metadata={
            "name": "TIME_SYSTEM",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    start_time: str = field(
        metadata={
            "name": "START_TIME",
            "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*)?",
        }
    )
    useable_start_time: None | str = field(
        default=None,
        metadata={
            "name": "USEABLE_START_TIME",
            "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*)?",
        },
    )
    useable_stop_time: None | str = field(
        default=None,
        metadata={
            "name": "USEABLE_STOP_TIME",
            "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*)?",
        },
    )
    stop_time: str = field(
        metadata={
            "name": "STOP_TIME",
            "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*)?",
        }
    )
    attitude_type: AttitudeTypeType = field(
        metadata={
            "name": "ATTITUDE_TYPE",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    quaternion_type: None | QuaternionTypeType = field(
        default=None,
        metadata={
            "name": "QUATERNION_TYPE",
            "type": "Element",
            "namespace": "",
        },
    )
    euler_rot_seq: None | RotseqType = field(
        default=None,
        metadata={
            "name": "EULER_ROT_SEQ",
            "type": "Element",
            "namespace": "",
        },
    )
    rate_frame: None | AemRateFrameType = field(
        default=None,
        metadata={
            "name": "RATE_FRAME",
            "type": "Element",
            "namespace": "",
        },
    )
    interpolation_method: None | str = field(
        default=None,
        metadata={
            "name": "INTERPOLATION_METHOD",
            "type": "Element",
            "namespace": "",
        },
    )
    interpolation_degree: None | int = field(
        default=None,
        metadata={
            "name": "INTERPOLATION_DEGREE",
            "type": "Element",
            "namespace": "",
        },
    )


@dataclass(kw_only=True)
class EulerAngleRateType:
    class Meta:
        name = "eulerAngleRateType"

    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*)?",
        }
    )
    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 EulerAngleType:
    class Meta:
        name = "eulerAngleType"

    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*)?",
        }
    )
    rotation_angles: None | RotationAngleType = field(
        default=None,
        metadata={
            "name": "rotationAngles",
            "type": "Element",
            "namespace": "",
        },
    )


@dataclass(kw_only=True)
class QuaternionDerivativeType:
    class Meta:
        name = "quaternionDerivativeType"

    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*)?",
        }
    )
    quaternion: QuaternionType = field(
        metadata={
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    quaternion_rate: QuaternionRateType = field(
        metadata={
            "name": "quaternionRate",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )


@dataclass(kw_only=True)
class QuaternionEphemerisType:
    class Meta:
        name = "quaternionEphemerisType"

    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*)?",
        }
    )
    quaternion: QuaternionType = field(
        metadata={
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )


@dataclass(kw_only=True)
class QuaternionEulerRateType:
    class Meta:
        name = "quaternionEulerRateType"

    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*)?",
        }
    )
    quaternion: QuaternionType = field(
        metadata={
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    rotation_rates: None | RotationRateType = field(
        default=None,
        metadata={
            "name": "rotationRates",
            "type": "Element",
            "namespace": "",
        },
    )


@dataclass(kw_only=True)
class SpinNutationType:
    class Meta:
        name = "spinNutationType"

    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*)?",
        }
    )
    spin_alpha: AngleType = field(
        metadata={
            "name": "SPIN_ALPHA",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    spin_delta: AngleType = field(
        metadata={
            "name": "SPIN_DELTA",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    spin_angle: AngleType = field(
        metadata={
            "name": "SPIN_ANGLE",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    spin_angle_vel: AngleRateType = field(
        metadata={
            "name": "SPIN_ANGLE_VEL",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    nutation: AngleType = field(
        metadata={
            "name": "NUTATION",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    nutation_per: DurationType = field(
        metadata={
            "name": "NUTATION_PER",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    nutation_phase: AngleType = field(
        metadata={
            "name": "NUTATION_PHASE",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )


@dataclass(kw_only=True)
class SpinType:
    class Meta:
        name = "spinType"

    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*)?",
        }
    )
    spin_alpha: AngleType = field(
        metadata={
            "name": "SPIN_ALPHA",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    spin_delta: AngleType = field(
        metadata={
            "name": "SPIN_DELTA",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    spin_angle: AngleType = field(
        metadata={
            "name": "SPIN_ANGLE",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )
    spin_angle_vel: AngleRateType = field(
        metadata={
            "name": "SPIN_ANGLE_VEL",
            "type": "Element",
            "namespace": "",
            "required": True,
        }
    )


@dataclass(kw_only=True)
class AttitudeStateType:
    class Meta:
        name = "attitudeStateType"

    quaternion_state: None | QuaternionEphemerisType = field(
        default=None,
        metadata={
            "name": "quaternionState",
            "type": "Element",
            "namespace": "",
        },
    )
    quaternion_derivative: None | QuaternionDerivativeType = field(
        default=None,
        metadata={
            "name": "quaternionDerivative",
            "type": "Element",
            "namespace": "",
        },
    )
    quaternion_euler_rate: None | QuaternionEulerRateType = field(
        default=None,
        metadata={
            "name": "quaternionEulerRate",
            "type": "Element",
            "namespace": "",
        },
    )
    euler_angle: None | EulerAngleType = field(
        default=None,
        metadata={
            "name": "eulerAngle",
            "type": "Element",
            "namespace": "",
        },
    )
    euler_angle_rate: None | EulerAngleRateType = field(
        default=None,
        metadata={
            "name": "eulerAngleRate",
            "type": "Element",
            "namespace": "",
        },
    )
    spin: None | SpinType = field(
        default=None,
        metadata={
            "type": "Element",
            "namespace": "",
        },
    )
    spin_nutation: None | SpinNutationType = field(
        default=None,
        metadata={
            "name": "spinNutation",
            "type": "Element",
            "namespace": "",
        },
    )


@dataclass(kw_only=True)
class AemData:
    class Meta:
        name = "aemData"

    comment: list[str] = field(
        default_factory=list,
        metadata={
            "name": "COMMENT",
            "type": "Element",
            "namespace": "",
        },
    )
    attitude_state: list[AttitudeStateType] = field(
        default_factory=list,
        metadata={
            "name": "attitudeState",
            "type": "Element",
            "namespace": "",
            "min_occurs": 1,
        },
    )


@dataclass(kw_only=True)
class AemSegment:
    class Meta:
        name = "aemSegment"

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


@dataclass(kw_only=True)
class AemBody:
    class Meta:
        name = "aemBody"

    segment: list[AemSegment] = field(
        default_factory=list,
        metadata={
            "type": "Element",
            "namespace": "",
            "min_occurs": 1,
        },
    )


@dataclass(kw_only=True)
class AemType:
    class Meta:
        name = "aemType"

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