from __future__ import annotations
from dataclasses import dataclass, field
from typing import ForwardRef
from .interchange_version_structure import InterchangeVersionStructure
from .journey_ref_structure import JourneyRefStructure
from .scheduled_stop_point_ref_structure import ScheduledStopPointRefStructure
from .service_journey_pattern_interchange_ref import ServiceJourneyPatternInterchangeRef
from .service_journey_ref_structure import ServiceJourneyRefStructure

__NAMESPACE__ = "http://www.netex.org.uk/netex"


@dataclass(slots=True, kw_only=True)
class ServiceJourneyInterchangeVersionStructure(InterchangeVersionStructure):
    class Meta:
        name = "ServiceJourneyInterchange_VersionStructure"

    from_point_ref: None | ScheduledStopPointRefStructure = field(
        default=None,
        metadata={
            "name": "FromPointRef",
            "type": "Element",
            "namespace": "http://www.netex.org.uk/netex",
        }
    )
    from_visit_number: None | int = field(
        default=None,
        metadata={
            "name": "FromVisitNumber",
            "type": "Element",
            "namespace": "http://www.netex.org.uk/netex",
        }
    )
    to_point_ref: None | ScheduledStopPointRefStructure = field(
        default=None,
        metadata={
            "name": "ToPointRef",
            "type": "Element",
            "namespace": "http://www.netex.org.uk/netex",
        }
    )
    to_visit_number: None | int = field(
        default=None,
        metadata={
            "name": "ToVisitNumber",
            "type": "Element",
            "namespace": "http://www.netex.org.uk/netex",
        }
    )
    from_journey_ref_or_to_journey_ref_or_from_service_journey_ref_or_to_service_journey_ref: list[ServiceJourneyInterchangeVersionStructure.FromJourneyRef | ServiceJourneyInterchangeVersionStructure.ToJourneyRef | ServiceJourneyInterchangeVersionStructure.FromServiceJourneyRef | ServiceJourneyInterchangeVersionStructure.ToServiceJourneyRef] = field(
        default_factory=list,
        metadata={
            "type": "Elements",
            "choices": (
                {
                    "name": "FromJourneyRef",
                    "type": ForwardRef("ServiceJourneyInterchangeVersionStructure.FromJourneyRef"),
                    "namespace": "http://www.netex.org.uk/netex",
                },
                {
                    "name": "ToJourneyRef",
                    "type": ForwardRef("ServiceJourneyInterchangeVersionStructure.ToJourneyRef"),
                    "namespace": "http://www.netex.org.uk/netex",
                },
                {
                    "name": "FromServiceJourneyRef",
                    "type": ForwardRef("ServiceJourneyInterchangeVersionStructure.FromServiceJourneyRef"),
                    "namespace": "http://www.netex.org.uk/netex",
                },
                {
                    "name": "ToServiceJourneyRef",
                    "type": ForwardRef("ServiceJourneyInterchangeVersionStructure.ToServiceJourneyRef"),
                    "namespace": "http://www.netex.org.uk/netex",
                },
            ),
            "max_occurs": 2,
        }
    )
    service_journey_pattern_interchange_ref: None | ServiceJourneyPatternInterchangeRef = field(
        default=None,
        metadata={
            "name": "ServiceJourneyPatternInterchangeRef",
            "type": "Element",
            "namespace": "http://www.netex.org.uk/netex",
        }
    )

    @dataclass(slots=True, kw_only=True)
    class FromJourneyRef(JourneyRefStructure):
        pass

    @dataclass(slots=True, kw_only=True)
    class ToJourneyRef(JourneyRefStructure):
        pass

    @dataclass(slots=True, kw_only=True)
    class FromServiceJourneyRef(ServiceJourneyRefStructure):
        pass

    @dataclass(slots=True, kw_only=True)
    class ToServiceJourneyRef(ServiceJourneyRefStructure):
        pass