# coding: utf-8

"""
    BIMData API

    BIMData API is a tool to interact with your models stored on BIMData’s servers.     Through the API, you can manage your projects, the clouds, upload your IFC files and manage them through endpoints.  # noqa: E501

    The version of the OpenAPI document: v1
    Contact: support@bimdata.io
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from bimdata_api_client.configuration import Configuration


class Document(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    openapi_types = {
        'id': 'int',
        'parent': 'int',
        'parent_id': 'int',
        'creator': 'int',
        'project': 'int',
        'name': 'str',
        'file_name': 'str',
        'description': 'str',
        'file': 'str',
        'size': 'int',
        'created_at': 'datetime',
        'updated_at': 'datetime',
        'model_source': 'str',
        'model_id': 'str',
        'ifc_source': 'str',
        'ifc_id': 'str',
        'user_permission': 'int'
    }

    attribute_map = {
        'id': 'id',
        'parent': 'parent',
        'parent_id': 'parent_id',
        'creator': 'creator',
        'project': 'project',
        'name': 'name',
        'file_name': 'file_name',
        'description': 'description',
        'file': 'file',
        'size': 'size',
        'created_at': 'created_at',
        'updated_at': 'updated_at',
        'model_source': 'model_source',
        'model_id': 'model_id',
        'ifc_source': 'ifc_source',
        'ifc_id': 'ifc_id',
        'user_permission': 'user_permission'
    }

    def __init__(self, id=None, parent=None, parent_id=None, creator=None, project=None, name=None, file_name=None, description=None, file=None, size=None, created_at=None, updated_at=None, model_source=None, model_id=None, ifc_source=None, ifc_id=None, user_permission=None, local_vars_configuration=None):  # noqa: E501
        """Document - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._id = None
        self._parent = None
        self._parent_id = None
        self._creator = None
        self._project = None
        self._name = None
        self._file_name = None
        self._description = None
        self._file = None
        self._size = None
        self._created_at = None
        self._updated_at = None
        self._model_source = None
        self._model_id = None
        self._ifc_source = None
        self._ifc_id = None
        self._user_permission = None
        self.discriminator = None

        if id is not None:
            self.id = id
        self.parent = parent
        self.parent_id = parent_id
        self.creator = creator
        if project is not None:
            self.project = project
        self.name = name
        if file_name is not None:
            self.file_name = file_name
        self.description = description
        if file is not None:
            self.file = file
        self.size = size
        if created_at is not None:
            self.created_at = created_at
        if updated_at is not None:
            self.updated_at = updated_at
        if model_source is not None:
            self.model_source = model_source
        if model_id is not None:
            self.model_id = model_id
        if ifc_source is not None:
            self.ifc_source = ifc_source
        if ifc_id is not None:
            self.ifc_id = ifc_id
        if user_permission is not None:
            self.user_permission = user_permission

    @property
    def id(self):
        """Gets the id of this Document.  # noqa: E501


        :return: The id of this Document.  # noqa: E501
        :rtype: int
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this Document.


        :param id: The id of this Document.  # noqa: E501
        :type: int
        """

        self._id = id

    @property
    def parent(self):
        """Gets the parent of this Document.  # noqa: E501


        :return: The parent of this Document.  # noqa: E501
        :rtype: int
        """
        return self._parent

    @parent.setter
    def parent(self, parent):
        """Sets the parent of this Document.


        :param parent: The parent of this Document.  # noqa: E501
        :type: int
        """

        self._parent = parent

    @property
    def parent_id(self):
        """Gets the parent_id of this Document.  # noqa: E501


        :return: The parent_id of this Document.  # noqa: E501
        :rtype: int
        """
        return self._parent_id

    @parent_id.setter
    def parent_id(self, parent_id):
        """Sets the parent_id of this Document.


        :param parent_id: The parent_id of this Document.  # noqa: E501
        :type: int
        """

        self._parent_id = parent_id

    @property
    def creator(self):
        """Gets the creator of this Document.  # noqa: E501


        :return: The creator of this Document.  # noqa: E501
        :rtype: int
        """
        return self._creator

    @creator.setter
    def creator(self, creator):
        """Sets the creator of this Document.


        :param creator: The creator of this Document.  # noqa: E501
        :type: int
        """

        self._creator = creator

    @property
    def project(self):
        """Gets the project of this Document.  # noqa: E501


        :return: The project of this Document.  # noqa: E501
        :rtype: int
        """
        return self._project

    @project.setter
    def project(self, project):
        """Sets the project of this Document.


        :param project: The project of this Document.  # noqa: E501
        :type: int
        """

        self._project = project

    @property
    def name(self):
        """Gets the name of this Document.  # noqa: E501

        Shown name of the file  # noqa: E501

        :return: The name of this Document.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this Document.

        Shown name of the file  # noqa: E501

        :param name: The name of this Document.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and name is None:  # noqa: E501
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                name is not None and len(name) > 512):
            raise ValueError("Invalid value for `name`, length must be less than or equal to `512`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                name is not None and len(name) < 1):
            raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`")  # noqa: E501

        self._name = name

    @property
    def file_name(self):
        """Gets the file_name of this Document.  # noqa: E501

        Full name of the file  # noqa: E501

        :return: The file_name of this Document.  # noqa: E501
        :rtype: str
        """
        return self._file_name

    @file_name.setter
    def file_name(self, file_name):
        """Sets the file_name of this Document.

        Full name of the file  # noqa: E501

        :param file_name: The file_name of this Document.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                file_name is not None and len(file_name) > 512):
            raise ValueError("Invalid value for `file_name`, length must be less than or equal to `512`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                file_name is not None and len(file_name) < 1):
            raise ValueError("Invalid value for `file_name`, length must be greater than or equal to `1`")  # noqa: E501

        self._file_name = file_name

    @property
    def description(self):
        """Gets the description of this Document.  # noqa: E501

        Description of the file  # noqa: E501

        :return: The description of this Document.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this Document.

        Description of the file  # noqa: E501

        :param description: The description of this Document.  # noqa: E501
        :type: str
        """

        self._description = description

    @property
    def file(self):
        """Gets the file of this Document.  # noqa: E501


        :return: The file of this Document.  # noqa: E501
        :rtype: str
        """
        return self._file

    @file.setter
    def file(self, file):
        """Sets the file of this Document.


        :param file: The file of this Document.  # noqa: E501
        :type: str
        """

        self._file = file

    @property
    def size(self):
        """Gets the size of this Document.  # noqa: E501

        Size of the file.  # noqa: E501

        :return: The size of this Document.  # noqa: E501
        :rtype: int
        """
        return self._size

    @size.setter
    def size(self, size):
        """Sets the size of this Document.

        Size of the file.  # noqa: E501

        :param size: The size of this Document.  # noqa: E501
        :type: int
        """
        if (self.local_vars_configuration.client_side_validation and
                size is not None and size > 9223372036854775807):  # noqa: E501
            raise ValueError("Invalid value for `size`, must be a value less than or equal to `9223372036854775807`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                size is not None and size < 0):  # noqa: E501
            raise ValueError("Invalid value for `size`, must be a value greater than or equal to `0`")  # noqa: E501

        self._size = size

    @property
    def created_at(self):
        """Gets the created_at of this Document.  # noqa: E501

        Creation date  # noqa: E501

        :return: The created_at of this Document.  # noqa: E501
        :rtype: datetime
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """Sets the created_at of this Document.

        Creation date  # noqa: E501

        :param created_at: The created_at of this Document.  # noqa: E501
        :type: datetime
        """

        self._created_at = created_at

    @property
    def updated_at(self):
        """Gets the updated_at of this Document.  # noqa: E501

        Date of the last update  # noqa: E501

        :return: The updated_at of this Document.  # noqa: E501
        :rtype: datetime
        """
        return self._updated_at

    @updated_at.setter
    def updated_at(self, updated_at):
        """Sets the updated_at of this Document.

        Date of the last update  # noqa: E501

        :param updated_at: The updated_at of this Document.  # noqa: E501
        :type: datetime
        """

        self._updated_at = updated_at

    @property
    def model_source(self):
        """Gets the model_source of this Document.  # noqa: E501

        Define the model.source field if the upload is a Model (IFC, PDF, DWG...)  # noqa: E501

        :return: The model_source of this Document.  # noqa: E501
        :rtype: str
        """
        return self._model_source

    @model_source.setter
    def model_source(self, model_source):
        """Sets the model_source of this Document.

        Define the model.source field if the upload is a Model (IFC, PDF, DWG...)  # noqa: E501

        :param model_source: The model_source of this Document.  # noqa: E501
        :type: str
        """
        allowed_values = ["UPLOAD", "SPLIT", "MERGE", "EXPORT", "OPTIMIZED"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and model_source not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `model_source` ({0}), must be one of {1}"  # noqa: E501
                .format(model_source, allowed_values)
            )

        self._model_source = model_source

    @property
    def model_id(self):
        """Gets the model_id of this Document.  # noqa: E501


        :return: The model_id of this Document.  # noqa: E501
        :rtype: str
        """
        return self._model_id

    @model_id.setter
    def model_id(self, model_id):
        """Sets the model_id of this Document.


        :param model_id: The model_id of this Document.  # noqa: E501
        :type: str
        """

        self._model_id = model_id

    @property
    def ifc_source(self):
        """Gets the ifc_source of this Document.  # noqa: E501

        DEPRECATED: Use 'model_source' instead. Define the model.source field if the upload is a Model (IFC, PDF, DWG...)  # noqa: E501

        :return: The ifc_source of this Document.  # noqa: E501
        :rtype: str
        """
        return self._ifc_source

    @ifc_source.setter
    def ifc_source(self, ifc_source):
        """Sets the ifc_source of this Document.

        DEPRECATED: Use 'model_source' instead. Define the model.source field if the upload is a Model (IFC, PDF, DWG...)  # noqa: E501

        :param ifc_source: The ifc_source of this Document.  # noqa: E501
        :type: str
        """
        allowed_values = ["UPLOAD", "SPLIT", "MERGE", "EXPORT", "OPTIMIZED"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and ifc_source not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `ifc_source` ({0}), must be one of {1}"  # noqa: E501
                .format(ifc_source, allowed_values)
            )

        self._ifc_source = ifc_source

    @property
    def ifc_id(self):
        """Gets the ifc_id of this Document.  # noqa: E501

        DEPRECATED: Use 'model_id' instead.  # noqa: E501

        :return: The ifc_id of this Document.  # noqa: E501
        :rtype: str
        """
        return self._ifc_id

    @ifc_id.setter
    def ifc_id(self, ifc_id):
        """Sets the ifc_id of this Document.

        DEPRECATED: Use 'model_id' instead.  # noqa: E501

        :param ifc_id: The ifc_id of this Document.  # noqa: E501
        :type: str
        """

        self._ifc_id = ifc_id

    @property
    def user_permission(self):
        """Gets the user_permission of this Document.  # noqa: E501

        Aggregate of group user permissions and folder default permission  # noqa: E501

        :return: The user_permission of this Document.  # noqa: E501
        :rtype: int
        """
        return self._user_permission

    @user_permission.setter
    def user_permission(self, user_permission):
        """Sets the user_permission of this Document.

        Aggregate of group user permissions and folder default permission  # noqa: E501

        :param user_permission: The user_permission of this Document.  # noqa: E501
        :type: int
        """

        self._user_permission = user_permission

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, Document):
            return False

        return self.to_dict() == other.to_dict()

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        if not isinstance(other, Document):
            return True

        return self.to_dict() != other.to_dict()
