"""mindbodypublicapi.

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

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


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

    Attributes:
        activation_code (str): An activation code used to provide access to a site’s
            business data through MINDBODY.
        activation_link (str): A link to the Manage Credentials screen.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "activation_code": "ActivationCode",
        "activation_link": "ActivationLink",
    }

    _optionals = [
        "activation_code",
        "activation_link",
    ]

    def __init__(
        self,
        activation_code=APIHelper.SKIP,
        activation_link=APIHelper.SKIP):
        """Initialize a GetActivationCodeResponse instance."""
        # Initialize members of the class
        if activation_code is not APIHelper.SKIP:
            self.activation_code = activation_code
        if activation_link is not APIHelper.SKIP:
            self.activation_link = activation_link

    @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
        activation_code =\
            dictionary.get("ActivationCode")\
            if dictionary.get("ActivationCode")\
                else APIHelper.SKIP
        activation_link =\
            dictionary.get("ActivationLink")\
            if dictionary.get("ActivationLink")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(activation_code,
                   activation_link)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _activation_code=(
            self.activation_code
            if hasattr(self, "activation_code")
            else None
        )
        _activation_link=(
            self.activation_link
            if hasattr(self, "activation_link")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"activation_code={_activation_code!r}, "
            f"activation_link={_activation_link!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _activation_code=(
            self.activation_code
            if hasattr(self, "activation_code")
            else None
        )
        _activation_link=(
            self.activation_link
            if hasattr(self, "activation_link")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"activation_code={_activation_code!s}, "
            f"activation_link={_activation_link!s}, "
            f")"
        )
