"""visaacceptancemergedspec.

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

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


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

    Attributes:
        mtype (str): Passenger classification associated with the price of the
            ticket. You can use one of the following values: - `ADT`: Adult - `CNN`:
            Child - `INF`: Infant - `YTH`: Youth - `STU`: Student - `SCR`: Senior
            Citizen - `MIL`: Military
        status (str): Your company's passenger classification, such as with a
            frequent flyer program. In this case, you might use values such as
            `standard`, `gold`, or `platinum`.
        phone (str): Passenger's phone number. If the order is from outside the U.S.,
            Visa Acceptance recommends that you include the [ISO Standard Country
            Codes](
        first_name (str): Passenger's first name.
        last_name (str): Passenger's last name.
        id (str): ID of the passenger to whom the ticket was issued. For example, you
            can use this field for the frequent flyer number.
        email (str): Passenger's email address, including the full domain name, such
            as jdoe@example.com.
        nationality (str): Passenger's nationality country. Use the two character
            [ISO Standard Country Codes](
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "mtype": "type",
        "status": "status",
        "phone": "phone",
        "first_name": "firstName",
        "last_name": "lastName",
        "id": "id",
        "email": "email",
        "nationality": "nationality",
    }

    _optionals = [
        "mtype",
        "status",
        "phone",
        "first_name",
        "last_name",
        "id",
        "email",
        "nationality",
    ]

    def __init__(
        self,
        mtype=APIHelper.SKIP,
        status=APIHelper.SKIP,
        phone=APIHelper.SKIP,
        first_name=APIHelper.SKIP,
        last_name=APIHelper.SKIP,
        id=APIHelper.SKIP,
        email=APIHelper.SKIP,
        nationality=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a Passenger2 instance."""
        # Initialize members of the class
        if mtype is not APIHelper.SKIP:
            self.mtype = mtype
        if status is not APIHelper.SKIP:
            self.status = status
        if phone is not APIHelper.SKIP:
            self.phone = phone
        if first_name is not APIHelper.SKIP:
            self.first_name = first_name
        if last_name is not APIHelper.SKIP:
            self.last_name = last_name
        if id is not APIHelper.SKIP:
            self.id = id
        if email is not APIHelper.SKIP:
            self.email = email
        if nationality is not APIHelper.SKIP:
            self.nationality = nationality

        # 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
        mtype =\
            dictionary.get("type")\
            if dictionary.get("type")\
                else APIHelper.SKIP
        status =\
            dictionary.get("status")\
            if dictionary.get("status")\
                else APIHelper.SKIP
        phone =\
            dictionary.get("phone")\
            if dictionary.get("phone")\
                else APIHelper.SKIP
        first_name =\
            dictionary.get("firstName")\
            if dictionary.get("firstName")\
                else APIHelper.SKIP
        last_name =\
            dictionary.get("lastName")\
            if dictionary.get("lastName")\
                else APIHelper.SKIP
        id =\
            dictionary.get("id")\
            if dictionary.get("id")\
                else APIHelper.SKIP
        email =\
            dictionary.get("email")\
            if dictionary.get("email")\
                else APIHelper.SKIP
        nationality =\
            dictionary.get("nationality")\
            if dictionary.get("nationality")\
                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(mtype,
                   status,
                   phone,
                   first_name,
                   last_name,
                   id,
                   email,
                   nationality,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _status=(
            self.status
            if hasattr(self, "status")
            else None
        )
        _phone=(
            self.phone
            if hasattr(self, "phone")
            else None
        )
        _first_name=(
            self.first_name
            if hasattr(self, "first_name")
            else None
        )
        _last_name=(
            self.last_name
            if hasattr(self, "last_name")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _email=(
            self.email
            if hasattr(self, "email")
            else None
        )
        _nationality=(
            self.nationality
            if hasattr(self, "nationality")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"mtype={_mtype!r}, "
            f"status={_status!r}, "
            f"phone={_phone!r}, "
            f"first_name={_first_name!r}, "
            f"last_name={_last_name!r}, "
            f"id={_id!r}, "
            f"email={_email!r}, "
            f"nationality={_nationality!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _status=(
            self.status
            if hasattr(self, "status")
            else None
        )
        _phone=(
            self.phone
            if hasattr(self, "phone")
            else None
        )
        _first_name=(
            self.first_name
            if hasattr(self, "first_name")
            else None
        )
        _last_name=(
            self.last_name
            if hasattr(self, "last_name")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _email=(
            self.email
            if hasattr(self, "email")
            else None
        )
        _nationality=(
            self.nationality
            if hasattr(self, "nationality")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"mtype={_mtype!s}, "
            f"status={_status!s}, "
            f"phone={_phone!s}, "
            f"first_name={_first_name!s}, "
            f"last_name={_last_name!s}, "
            f"id={_id!s}, "
            f"email={_email!s}, "
            f"nationality={_nationality!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
