"""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 (
    AdmHeader,
    AngVelStateType,
    AttManeuverStateType,
    EulerAngleStateType,
    InertiaStateType,
    QuaternionStateType,
    SpinStateType,
)

__NAMESPACE__ = "urn:ccsds:schema:ndmxml"


@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: str = field(
        metadata={
            "name": "TIME_SYSTEM",
            "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": "",
        },
    )
    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_state: list[QuaternionStateType] = field(
        default_factory=list,
        metadata={
            "name": "quaternionState",
            "type": "Element",
            "namespace": "",
        },
    )
    euler_angle_state: list[EulerAngleStateType] = field(
        default_factory=list,
        metadata={
            "name": "eulerAngleState",
            "type": "Element",
            "namespace": "",
        },
    )
    angular_velocity: list[AngVelStateType] = field(
        default_factory=list,
        metadata={
            "name": "angularVelocity",
            "type": "Element",
            "namespace": "",
        },
    )
    spin: list[SpinStateType] = field(
        default_factory=list,
        metadata={
            "type": "Element",
            "namespace": "",
        },
    )
    inertia: list[InertiaStateType] = field(
        default_factory=list,
        metadata={
            "type": "Element",
            "namespace": "",
        },
    )
    maneuver_parameters: list[AttManeuverStateType] = 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: AdmHeader = 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="2.0",
        metadata={
            "type": "Attribute",
            "required": True,
        },
    )
