"""mindbodypublicapi.

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

# ruff: noqa: E501
from mindbodypublicapi.api_helper import APIHelper


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

    A client credit card.

    Attributes:
        address (str): The billing address for the credit card.
        card_holder (str): The name of the card holder.
        card_number (str): The credit card number.
        card_type (str): The type of credit card, for example Visa or MasterCard.
        city (str): The city in which the billing address is located.
        exp_month (str): The month in which the credit card expires.
        exp_year (str): The year in which the credit card expires.
        last_four (str): The last four digits of the credit card number.
        postal_code (str): The postal code where the billing address is located.
        state (str): The state that the billing address is located in.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "address": "Address",
        "card_holder": "CardHolder",
        "card_number": "CardNumber",
        "card_type": "CardType",
        "city": "City",
        "exp_month": "ExpMonth",
        "exp_year": "ExpYear",
        "last_four": "LastFour",
        "postal_code": "PostalCode",
        "state": "State",
    }

    _optionals = [
        "address",
        "card_holder",
        "card_number",
        "card_type",
        "city",
        "exp_month",
        "exp_year",
        "last_four",
        "postal_code",
        "state",
    ]

    def __init__(
        self,
        address=APIHelper.SKIP,
        card_holder=APIHelper.SKIP,
        card_number=APIHelper.SKIP,
        card_type=APIHelper.SKIP,
        city=APIHelper.SKIP,
        exp_month=APIHelper.SKIP,
        exp_year=APIHelper.SKIP,
        last_four=APIHelper.SKIP,
        postal_code=APIHelper.SKIP,
        state=APIHelper.SKIP):
        """Initialize a ClientCreditCard instance."""
        # Initialize members of the class
        if address is not APIHelper.SKIP:
            self.address = address
        if card_holder is not APIHelper.SKIP:
            self.card_holder = card_holder
        if card_number is not APIHelper.SKIP:
            self.card_number = card_number
        if card_type is not APIHelper.SKIP:
            self.card_type = card_type
        if city is not APIHelper.SKIP:
            self.city = city
        if exp_month is not APIHelper.SKIP:
            self.exp_month = exp_month
        if exp_year is not APIHelper.SKIP:
            self.exp_year = exp_year
        if last_four is not APIHelper.SKIP:
            self.last_four = last_four
        if postal_code is not APIHelper.SKIP:
            self.postal_code = postal_code
        if state is not APIHelper.SKIP:
            self.state = state

    @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
        address =\
            dictionary.get("Address")\
            if dictionary.get("Address")\
                else APIHelper.SKIP
        card_holder =\
            dictionary.get("CardHolder")\
            if dictionary.get("CardHolder")\
                else APIHelper.SKIP
        card_number =\
            dictionary.get("CardNumber")\
            if dictionary.get("CardNumber")\
                else APIHelper.SKIP
        card_type =\
            dictionary.get("CardType")\
            if dictionary.get("CardType")\
                else APIHelper.SKIP
        city =\
            dictionary.get("City")\
            if dictionary.get("City")\
                else APIHelper.SKIP
        exp_month =\
            dictionary.get("ExpMonth")\
            if dictionary.get("ExpMonth")\
                else APIHelper.SKIP
        exp_year =\
            dictionary.get("ExpYear")\
            if dictionary.get("ExpYear")\
                else APIHelper.SKIP
        last_four =\
            dictionary.get("LastFour")\
            if dictionary.get("LastFour")\
                else APIHelper.SKIP
        postal_code =\
            dictionary.get("PostalCode")\
            if dictionary.get("PostalCode")\
                else APIHelper.SKIP
        state =\
            dictionary.get("State")\
            if dictionary.get("State")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(address,
                   card_holder,
                   card_number,
                   card_type,
                   city,
                   exp_month,
                   exp_year,
                   last_four,
                   postal_code,
                   state)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _address=(
            self.address
            if hasattr(self, "address")
            else None
        )
        _card_holder=(
            self.card_holder
            if hasattr(self, "card_holder")
            else None
        )
        _card_number=(
            self.card_number
            if hasattr(self, "card_number")
            else None
        )
        _card_type=(
            self.card_type
            if hasattr(self, "card_type")
            else None
        )
        _city=(
            self.city
            if hasattr(self, "city")
            else None
        )
        _exp_month=(
            self.exp_month
            if hasattr(self, "exp_month")
            else None
        )
        _exp_year=(
            self.exp_year
            if hasattr(self, "exp_year")
            else None
        )
        _last_four=(
            self.last_four
            if hasattr(self, "last_four")
            else None
        )
        _postal_code=(
            self.postal_code
            if hasattr(self, "postal_code")
            else None
        )
        _state=(
            self.state
            if hasattr(self, "state")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"address={_address!r}, "
            f"card_holder={_card_holder!r}, "
            f"card_number={_card_number!r}, "
            f"card_type={_card_type!r}, "
            f"city={_city!r}, "
            f"exp_month={_exp_month!r}, "
            f"exp_year={_exp_year!r}, "
            f"last_four={_last_four!r}, "
            f"postal_code={_postal_code!r}, "
            f"state={_state!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _address=(
            self.address
            if hasattr(self, "address")
            else None
        )
        _card_holder=(
            self.card_holder
            if hasattr(self, "card_holder")
            else None
        )
        _card_number=(
            self.card_number
            if hasattr(self, "card_number")
            else None
        )
        _card_type=(
            self.card_type
            if hasattr(self, "card_type")
            else None
        )
        _city=(
            self.city
            if hasattr(self, "city")
            else None
        )
        _exp_month=(
            self.exp_month
            if hasattr(self, "exp_month")
            else None
        )
        _exp_year=(
            self.exp_year
            if hasattr(self, "exp_year")
            else None
        )
        _last_four=(
            self.last_four
            if hasattr(self, "last_four")
            else None
        )
        _postal_code=(
            self.postal_code
            if hasattr(self, "postal_code")
            else None
        )
        _state=(
            self.state
            if hasattr(self, "state")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"address={_address!s}, "
            f"card_holder={_card_holder!s}, "
            f"card_number={_card_number!s}, "
            f"card_type={_card_type!s}, "
            f"city={_city!s}, "
            f"exp_month={_exp_month!s}, "
            f"exp_year={_exp_year!s}, "
            f"last_four={_last_four!s}, "
            f"postal_code={_postal_code!s}, "
            f"state={_state!s}, "
            f")"
        )
