"""visaacceptancemergedspec.

This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
"""

# ruff: noqa: E501
from visaacceptancemergedspec.api_helper import (
    APIHelper,
)
from visaacceptancemergedspec.models.agency_5 import (
    Agency5,
)


class TravelInformation8(object):
    """Implementation of the 'TravelInformation8' model.

    Attributes:
        agency (Agency5): The model property of type Agency5.
        journey_type (str): The type of journey.
        actual_final_destination (str): The actual final destination of the travel.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "agency": "agency",
        "journey_type": "journeyType",
        "actual_final_destination": "actualFinalDestination",
    }

    _optionals = [
        "agency",
        "journey_type",
        "actual_final_destination",
    ]

    def __init__(
        self,
        agency=APIHelper.SKIP,
        journey_type=APIHelper.SKIP,
        actual_final_destination=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a TravelInformation8 instance."""
        # Initialize members of the class
        if agency is not APIHelper.SKIP:
            self.agency = agency
        if journey_type is not APIHelper.SKIP:
            self.journey_type = journey_type
        if actual_final_destination is not APIHelper.SKIP:
            self.actual_final_destination = actual_final_destination

        # Add additional model properties to the instance
        if additional_properties is None:
            additional_properties = {}
        self.additional_properties = additional_properties

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Create an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object
            as obtained from the deserialization of the server's response. The
            keys MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        agency =\
            Agency5.from_dictionary(
                dictionary.get("agency"))\
                if "agency" in dictionary.keys()\
                else APIHelper.SKIP
        journey_type =\
            dictionary.get("journeyType")\
            if dictionary.get("journeyType")\
                else APIHelper.SKIP
        actual_final_destination =\
            dictionary.get("actualFinalDestination")\
            if dictionary.get("actualFinalDestination")\
                else APIHelper.SKIP

        additional_properties = APIHelper.get_additional_properties(
            dictionary={k: v for k, v in dictionary.items()
                        if k not in cls._names.values()},
            unboxing_function=lambda value: value)

        # Return an object of this model
        return cls(agency,
                   journey_type,
                   actual_final_destination,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _agency=(
            self.agency
            if hasattr(self, "agency")
            else None
        )
        _journey_type=(
            self.journey_type
            if hasattr(self, "journey_type")
            else None
        )
        _actual_final_destination=(
            self.actual_final_destination
            if hasattr(self, "actual_final_destination")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"agency={_agency!r}, "
            f"journey_type={_journey_type!r}, "
            f"actual_final_destination={_actual_final_destination!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _agency=(
            self.agency
            if hasattr(self, "agency")
            else None
        )
        _journey_type=(
            self.journey_type
            if hasattr(self, "journey_type")
            else None
        )
        _actual_final_destination=(
            self.actual_final_destination
            if hasattr(self, "actual_final_destination")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"agency={_agency!s}, "
            f"journey_type={_journey_type!s}, "
            f"actual_final_destination={_actual_final_destination!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
