"""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.account_14 import (
    Account14,
)


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

    Attributes:
        account (Account14): The model property of type Account14.
        first_name (str): The first name of the sender.
        last_name (str): The last name of the sender.
        email (str): The email address of the sender.
        phone_number (str): The phone number of the sender.
        country_code (str): The country code of the sender.
        create_date (str): The date when the sender's account was created.
        postal_code (str): The postal code of the sender.
        risk_popularity_score (str): The risk popularity score of the sender.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "account": "account",
        "first_name": "firstName",
        "last_name": "lastName",
        "email": "email",
        "phone_number": "phoneNumber",
        "country_code": "countryCode",
        "create_date": "createDate",
        "postal_code": "postalCode",
        "risk_popularity_score": "riskPopularityScore",
    }

    _optionals = [
        "account",
        "first_name",
        "last_name",
        "email",
        "phone_number",
        "country_code",
        "create_date",
        "postal_code",
        "risk_popularity_score",
    ]

    def __init__(
        self,
        account=APIHelper.SKIP,
        first_name=APIHelper.SKIP,
        last_name=APIHelper.SKIP,
        email=APIHelper.SKIP,
        phone_number=APIHelper.SKIP,
        country_code=APIHelper.SKIP,
        create_date=APIHelper.SKIP,
        postal_code=APIHelper.SKIP,
        risk_popularity_score=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a SenderInformation2 instance."""
        # Initialize members of the class
        if account is not APIHelper.SKIP:
            self.account = account
        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 email is not APIHelper.SKIP:
            self.email = email
        if phone_number is not APIHelper.SKIP:
            self.phone_number = phone_number
        if country_code is not APIHelper.SKIP:
            self.country_code = country_code
        if create_date is not APIHelper.SKIP:
            self.create_date = create_date
        if postal_code is not APIHelper.SKIP:
            self.postal_code = postal_code
        if risk_popularity_score is not APIHelper.SKIP:
            self.risk_popularity_score = risk_popularity_score

        # 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
        account =\
            Account14.from_dictionary(
                dictionary.get("account"))\
                if "account" in dictionary.keys()\
                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
        email =\
            dictionary.get("email")\
            if dictionary.get("email")\
                else APIHelper.SKIP
        phone_number =\
            dictionary.get("phoneNumber")\
            if dictionary.get("phoneNumber")\
                else APIHelper.SKIP
        country_code =\
            dictionary.get("countryCode")\
            if dictionary.get("countryCode")\
                else APIHelper.SKIP
        create_date =\
            dictionary.get("createDate")\
            if dictionary.get("createDate")\
                else APIHelper.SKIP
        postal_code =\
            dictionary.get("postalCode")\
            if dictionary.get("postalCode")\
                else APIHelper.SKIP
        risk_popularity_score =\
            dictionary.get("riskPopularityScore")\
            if dictionary.get("riskPopularityScore")\
                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(account,
                   first_name,
                   last_name,
                   email,
                   phone_number,
                   country_code,
                   create_date,
                   postal_code,
                   risk_popularity_score,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _account=(
            self.account
            if hasattr(self, "account")
            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
        )
        _email=(
            self.email
            if hasattr(self, "email")
            else None
        )
        _phone_number=(
            self.phone_number
            if hasattr(self, "phone_number")
            else None
        )
        _country_code=(
            self.country_code
            if hasattr(self, "country_code")
            else None
        )
        _create_date=(
            self.create_date
            if hasattr(self, "create_date")
            else None
        )
        _postal_code=(
            self.postal_code
            if hasattr(self, "postal_code")
            else None
        )
        _risk_popularity_score=(
            self.risk_popularity_score
            if hasattr(self, "risk_popularity_score")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"account={_account!r}, "
            f"first_name={_first_name!r}, "
            f"last_name={_last_name!r}, "
            f"email={_email!r}, "
            f"phone_number={_phone_number!r}, "
            f"country_code={_country_code!r}, "
            f"create_date={_create_date!r}, "
            f"postal_code={_postal_code!r}, "
            f"risk_popularity_score={_risk_popularity_score!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _account=(
            self.account
            if hasattr(self, "account")
            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
        )
        _email=(
            self.email
            if hasattr(self, "email")
            else None
        )
        _phone_number=(
            self.phone_number
            if hasattr(self, "phone_number")
            else None
        )
        _country_code=(
            self.country_code
            if hasattr(self, "country_code")
            else None
        )
        _create_date=(
            self.create_date
            if hasattr(self, "create_date")
            else None
        )
        _postal_code=(
            self.postal_code
            if hasattr(self, "postal_code")
            else None
        )
        _risk_popularity_score=(
            self.risk_popularity_score
            if hasattr(self, "risk_popularity_score")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"account={_account!s}, "
            f"first_name={_first_name!s}, "
            f"last_name={_last_name!s}, "
            f"email={_email!s}, "
            f"phone_number={_phone_number!s}, "
            f"country_code={_country_code!s}, "
            f"create_date={_create_date!s}, "
            f"postal_code={_postal_code!s}, "
            f"risk_popularity_score={_risk_popularity_score!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
