"""visaacceptancemergedspec.

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

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


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

    Attributes:
        alternate_name (str): Alternate contact information for your business,such as
            an email address or URL. This value might be displayed on the
            cardholder’s statement. When you do not include this value in your
            capture or credit request, the merchant URL from your Visa Acceptance
            account is used. Important This value must consist of English characters
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "alternate_name": "alternateName",
    }

    _optionals = [
        "alternate_name",
    ]

    def __init__(
        self,
        alternate_name=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a MerchantDescriptor13 instance."""
        # Initialize members of the class
        if alternate_name is not APIHelper.SKIP:
            self.alternate_name = alternate_name

        # 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
        alternate_name =\
            dictionary.get("alternateName")\
            if dictionary.get("alternateName")\
                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(alternate_name,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _alternate_name=(
            self.alternate_name
            if hasattr(self, "alternate_name")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"alternate_name={_alternate_name!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _alternate_name=(
            self.alternate_name
            if hasattr(self, "alternate_name")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"alternate_name={_alternate_name!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
