"""cellpointapi.

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

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


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

    Card identification details.

    Attributes:
        scheme (CardScheme): The model property of type CardScheme.
        funding_type (FundingType): The model property of type FundingType.
        country (str): The model property of type str.
        issuing_bank (str): The model property of type str.
        category (Category): The model property of type Category.
        level (str): The model property of type str.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "scheme": "scheme",
        "funding_type": "fundingType",
        "country": "country",
        "issuing_bank": "issuingBank",
        "category": "category",
        "level": "level",
    }

    _optionals = [
        "scheme",
        "funding_type",
        "country",
        "issuing_bank",
        "category",
        "level",
    ]

    def __init__(
        self,
        scheme=APIHelper.SKIP,
        funding_type=APIHelper.SKIP,
        country=APIHelper.SKIP,
        issuing_bank=APIHelper.SKIP,
        category=APIHelper.SKIP,
        level=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a CardIdentification instance."""
        # Initialize members of the class
        if scheme is not APIHelper.SKIP:
            self.scheme = scheme
        if funding_type is not APIHelper.SKIP:
            self.funding_type = funding_type
        if country is not APIHelper.SKIP:
            self.country = country
        if issuing_bank is not APIHelper.SKIP:
            self.issuing_bank = issuing_bank
        if category is not APIHelper.SKIP:
            self.category = category
        if level is not APIHelper.SKIP:
            self.level = level

        # 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
        scheme =\
            dictionary.get("scheme")\
            if dictionary.get("scheme")\
                else APIHelper.SKIP
        funding_type =\
            dictionary.get("fundingType")\
            if dictionary.get("fundingType")\
                else APIHelper.SKIP
        country =\
            dictionary.get("country")\
            if dictionary.get("country")\
                else APIHelper.SKIP
        issuing_bank =\
            dictionary.get("issuingBank")\
            if dictionary.get("issuingBank")\
                else APIHelper.SKIP
        category =\
            dictionary.get("category")\
            if dictionary.get("category")\
                else APIHelper.SKIP
        level =\
            dictionary.get("level")\
            if dictionary.get("level")\
                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(scheme,
                   funding_type,
                   country,
                   issuing_bank,
                   category,
                   level,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _scheme=(
            self.scheme
            if hasattr(self, "scheme")
            else None
        )
        _funding_type=(
            self.funding_type
            if hasattr(self, "funding_type")
            else None
        )
        _country=(
            self.country
            if hasattr(self, "country")
            else None
        )
        _issuing_bank=(
            self.issuing_bank
            if hasattr(self, "issuing_bank")
            else None
        )
        _category=(
            self.category
            if hasattr(self, "category")
            else None
        )
        _level=(
            self.level
            if hasattr(self, "level")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"scheme={_scheme!r}, "
            f"funding_type={_funding_type!r}, "
            f"country={_country!r}, "
            f"issuing_bank={_issuing_bank!r}, "
            f"category={_category!r}, "
            f"level={_level!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _scheme=(
            self.scheme
            if hasattr(self, "scheme")
            else None
        )
        _funding_type=(
            self.funding_type
            if hasattr(self, "funding_type")
            else None
        )
        _country=(
            self.country
            if hasattr(self, "country")
            else None
        )
        _issuing_bank=(
            self.issuing_bank
            if hasattr(self, "issuing_bank")
            else None
        )
        _category=(
            self.category
            if hasattr(self, "category")
            else None
        )
        _level=(
            self.level
            if hasattr(self, "level")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"scheme={_scheme!s}, "
            f"funding_type={_funding_type!s}, "
            f"country={_country!s}, "
            f"issuing_bank={_issuing_bank!s}, "
            f"category={_category!s}, "
            f"level={_level!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
