"""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_6 import (
    Account6,
)


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

    Attributes:
        first_name (str): First name of the sender of the funds. For Gaming Payment
            of Winnings transactions these are the merchant details. * Required for
            Mastercard Payment of Winnings (POW) transactions. * Must not be all
            numeric. * Must contain only ASCII characters in range 32-122. * Must not
            be greater than 35 characters including spaces. * Required for POW on
            Barclays.
        last_name (str): Last name of the sender of the funds. For Gaming Payment of
            Winnings transactions these are the merchant details. * Optional for
            Mastercard Payment of Winnings (POW) transactions. * Must not be all
            numeric. * Must contain only ASCII characters in range 32-122. * Must not
            be greater than 35 characters including spaces. * Optional for POW on
            Barclays.
        address_1 (str): Street address of the sender of the funds. For Gaming
            Payment of Winnings transactions these are the merchant details. *
            Required for Mastercard Payment of Winnings (POW) transactions. * Must
            not be all numeric. * Must contain only ASCII characters in range 32-122.
            * Must not be greater than 50 characters including spaces. * Required for
            POW on Barclays.
        locality (str): City of the sender of the funds. For Gaming Payment of
            Winnings transactions these are the merchant details. * Required for
            Mastercard Payment of Winnings (POW) transactions. * Must not be all
            numeric. * Must contain only ASCII characters in range 32-122. * Must not
            be greater than 25 characters including spaces. * Required for POW on
            Barclays.
        country_code (str): Country of the sender of the funds. For Gaming Payment of
            Winnings transactions these are the merchant details. * Required for
            Mastercard Payment of Winnings (POW) transactions. * Must be a valid
            three character ISO country code as defined by ISO 3166. * Must not be
            greater than 3 characters. * Required for POW on Barclays.
        account (Account6): The model property of type Account6.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "first_name": "firstName",
        "last_name": "lastName",
        "address_1": "address1",
        "locality": "locality",
        "country_code": "countryCode",
        "account": "account",
    }

    _optionals = [
        "first_name",
        "last_name",
        "address_1",
        "locality",
        "country_code",
        "account",
    ]

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

        # 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
        first_name =\
            dictionary.get("firstName")\
            if dictionary.get("firstName")\
                else APIHelper.SKIP
        last_name =\
            dictionary.get("lastName")\
            if dictionary.get("lastName")\
                else APIHelper.SKIP
        address_1 =\
            dictionary.get("address1")\
            if dictionary.get("address1")\
                else APIHelper.SKIP
        locality =\
            dictionary.get("locality")\
            if dictionary.get("locality")\
                else APIHelper.SKIP
        country_code =\
            dictionary.get("countryCode")\
            if dictionary.get("countryCode")\
                else APIHelper.SKIP
        account =\
            Account6.from_dictionary(
                dictionary.get("account"))\
                if "account" in dictionary.keys()\
                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(first_name,
                   last_name,
                   address_1,
                   locality,
                   country_code,
                   account,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _first_name=(
            self.first_name
            if hasattr(self, "first_name")
            else None
        )
        _last_name=(
            self.last_name
            if hasattr(self, "last_name")
            else None
        )
        _address_1=(
            self.address_1
            if hasattr(self, "address_1")
            else None
        )
        _locality=(
            self.locality
            if hasattr(self, "locality")
            else None
        )
        _country_code=(
            self.country_code
            if hasattr(self, "country_code")
            else None
        )
        _account=(
            self.account
            if hasattr(self, "account")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"first_name={_first_name!r}, "
            f"last_name={_last_name!r}, "
            f"address_1={_address_1!r}, "
            f"locality={_locality!r}, "
            f"country_code={_country_code!r}, "
            f"account={_account!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _first_name=(
            self.first_name
            if hasattr(self, "first_name")
            else None
        )
        _last_name=(
            self.last_name
            if hasattr(self, "last_name")
            else None
        )
        _address_1=(
            self.address_1
            if hasattr(self, "address_1")
            else None
        )
        _locality=(
            self.locality
            if hasattr(self, "locality")
            else None
        )
        _country_code=(
            self.country_code
            if hasattr(self, "country_code")
            else None
        )
        _account=(
            self.account
            if hasattr(self, "account")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"first_name={_first_name!s}, "
            f"last_name={_last_name!s}, "
            f"address_1={_address_1!s}, "
            f"locality={_locality!s}, "
            f"country_code={_country_code!s}, "
            f"account={_account!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
