"""mindbodypublicapi.

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

# ruff: noqa: E501
class ClientDocument(object):
    """Implementation of the 'ClientDocument' model.

    Attributes:
        file_name (str): The name of the file to be used on the client’s documents
            page when it is uploaded.
        media_type (str): The type of file or file extension. Possible values are:  *
            pdf  * jpg  * jpeg  * tif  * tiff  * png  * doc  * docx  * bmp  * txt  *
            rtf  * xlsx  * xls  * gif  * zip  * ppt  * pptx  * mov
        buffer (str): A Base64-encoded string representation of the file’s byte array.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "file_name": "FileName",
        "media_type": "MediaType",
        "buffer": "Buffer",
    }

    def __init__(
        self,
        file_name=None,
        media_type=None,
        buffer=None):
        """Initialize a ClientDocument instance."""
        # Initialize members of the class
        self.file_name = file_name
        self.media_type = media_type
        self.buffer = buffer

    @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
        file_name =\
            dictionary.get("FileName")\
            if dictionary.get("FileName")\
                else None
        media_type =\
            dictionary.get("MediaType")\
            if dictionary.get("MediaType")\
                else None
        buffer =\
            dictionary.get("Buffer")\
            if dictionary.get("Buffer")\
                else None

        # Return an object of this model
        return cls(file_name,
                   media_type,
                   buffer)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _file_name=self.file_name
        _media_type=self.media_type
        _buffer=self.buffer
        return (
            f"{self.__class__.__name__}("
            f"file_name={_file_name!r}, "
            f"media_type={_media_type!r}, "
            f"buffer={_buffer!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _file_name=self.file_name
        _media_type=self.media_type
        _buffer=self.buffer
        return (
            f"{self.__class__.__name__}("
            f"file_name={_file_name!s}, "
            f"media_type={_media_type!s}, "
            f"buffer={_buffer!s}, "
            f")"
        )
