"""mindbodypublicapi.

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

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


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

    Attributes:
        file_size (int): The size of the uploaded file.
        file_name (str): The name of the uploaded file.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "file_size": "FileSize",
        "file_name": "FileName",
    }

    _optionals = [
        "file_size",
        "file_name",
    ]

    def __init__(
        self,
        file_size=APIHelper.SKIP,
        file_name=APIHelper.SKIP):
        """Initialize a UploadClientDocumentResponse instance."""
        # Initialize members of the class
        if file_size is not APIHelper.SKIP:
            self.file_size = file_size
        if file_name is not APIHelper.SKIP:
            self.file_name = file_name

    @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_size =\
            dictionary.get("FileSize")\
            if dictionary.get("FileSize")\
                else APIHelper.SKIP
        file_name =\
            dictionary.get("FileName")\
            if dictionary.get("FileName")\
                else APIHelper.SKIP

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

    def __repr__(self):
        """Return a unambiguous string representation."""
        _file_size=(
            self.file_size
            if hasattr(self, "file_size")
            else None
        )
        _file_name=(
            self.file_name
            if hasattr(self, "file_name")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"file_size={_file_size!r}, "
            f"file_name={_file_name!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _file_size=(
            self.file_size
            if hasattr(self, "file_size")
            else None
        )
        _file_name=(
            self.file_name
            if hasattr(self, "file_name")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"file_size={_file_size!s}, "
            f"file_name={_file_name!s}, "
            f")"
        )
