# coding: utf-8

"""
    CartoVista REST API

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: 2.0.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

class View(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """
    """
    Attributes:
      swagger_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.
    """
    swagger_types = {
        'id': 'str',
        'title': 'str',
        'layer_id': 'str',
        'record_count': 'int',
        'type': 'ViewType',
        'expression': 'str',
        'column_id': 'str',
        'column_name': 'str',
        'column_type': 'str',
        'creation_time': 'datetime',
        'modified_time': 'datetime',
        'permissions': 'list[ViewReadPermission]',
        'current_user_has_modify_permission': 'bool'
    }

    attribute_map = {
        'id': 'id',
        'title': 'title',
        'layer_id': 'layerId',
        'record_count': 'recordCount',
        'type': 'type',
        'expression': 'expression',
        'column_id': 'columnId',
        'column_name': 'columnName',
        'column_type': 'columnType',
        'creation_time': 'creationTime',
        'modified_time': 'modifiedTime',
        'permissions': 'permissions',
        'current_user_has_modify_permission': 'currentUserHasModifyPermission'
    }

    def __init__(self, id=None, title=None, layer_id=None, record_count=None, type=None, expression=None, column_id=None, column_name=None, column_type=None, creation_time=None, modified_time=None, permissions=None, current_user_has_modify_permission=None):  # noqa: E501
        """View - a model defined in Swagger"""  # noqa: E501
        self._id = None
        self._title = None
        self._layer_id = None
        self._record_count = None
        self._type = None
        self._expression = None
        self._column_id = None
        self._column_name = None
        self._column_type = None
        self._creation_time = None
        self._modified_time = None
        self._permissions = None
        self._current_user_has_modify_permission = None
        self.discriminator = None
        if id is not None:
            self.id = id
        if title is not None:
            self.title = title
        if layer_id is not None:
            self.layer_id = layer_id
        if record_count is not None:
            self.record_count = record_count
        if type is not None:
            self.type = type
        if expression is not None:
            self.expression = expression
        if column_id is not None:
            self.column_id = column_id
        if column_name is not None:
            self.column_name = column_name
        if column_type is not None:
            self.column_type = column_type
        if creation_time is not None:
            self.creation_time = creation_time
        if modified_time is not None:
            self.modified_time = modified_time
        if permissions is not None:
            self.permissions = permissions
        if current_user_has_modify_permission is not None:
            self.current_user_has_modify_permission = current_user_has_modify_permission

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


        :return: The id of this View.  # noqa: E501
        :rtype: str
        """
        return self._id

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


        :param id: The id of this View.  # noqa: E501
        :type: str
        """

        self._id = id

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


        :return: The title of this View.  # noqa: E501
        :rtype: str
        """
        return self._title

    @title.setter
    def title(self, title):
        """Sets the title of this View.


        :param title: The title of this View.  # noqa: E501
        :type: str
        """

        self._title = title

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


        :return: The layer_id of this View.  # noqa: E501
        :rtype: str
        """
        return self._layer_id

    @layer_id.setter
    def layer_id(self, layer_id):
        """Sets the layer_id of this View.


        :param layer_id: The layer_id of this View.  # noqa: E501
        :type: str
        """

        self._layer_id = layer_id

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


        :return: The record_count of this View.  # noqa: E501
        :rtype: int
        """
        return self._record_count

    @record_count.setter
    def record_count(self, record_count):
        """Sets the record_count of this View.


        :param record_count: The record_count of this View.  # noqa: E501
        :type: int
        """

        self._record_count = record_count

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


        :return: The type of this View.  # noqa: E501
        :rtype: ViewType
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this View.


        :param type: The type of this View.  # noqa: E501
        :type: ViewType
        """

        self._type = type

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


        :return: The expression of this View.  # noqa: E501
        :rtype: str
        """
        return self._expression

    @expression.setter
    def expression(self, expression):
        """Sets the expression of this View.


        :param expression: The expression of this View.  # noqa: E501
        :type: str
        """

        self._expression = expression

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


        :return: The column_id of this View.  # noqa: E501
        :rtype: str
        """
        return self._column_id

    @column_id.setter
    def column_id(self, column_id):
        """Sets the column_id of this View.


        :param column_id: The column_id of this View.  # noqa: E501
        :type: str
        """

        self._column_id = column_id

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


        :return: The column_name of this View.  # noqa: E501
        :rtype: str
        """
        return self._column_name

    @column_name.setter
    def column_name(self, column_name):
        """Sets the column_name of this View.


        :param column_name: The column_name of this View.  # noqa: E501
        :type: str
        """

        self._column_name = column_name

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


        :return: The column_type of this View.  # noqa: E501
        :rtype: str
        """
        return self._column_type

    @column_type.setter
    def column_type(self, column_type):
        """Sets the column_type of this View.


        :param column_type: The column_type of this View.  # noqa: E501
        :type: str
        """

        self._column_type = column_type

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


        :return: The creation_time of this View.  # noqa: E501
        :rtype: datetime
        """
        return self._creation_time

    @creation_time.setter
    def creation_time(self, creation_time):
        """Sets the creation_time of this View.


        :param creation_time: The creation_time of this View.  # noqa: E501
        :type: datetime
        """

        self._creation_time = creation_time

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


        :return: The modified_time of this View.  # noqa: E501
        :rtype: datetime
        """
        return self._modified_time

    @modified_time.setter
    def modified_time(self, modified_time):
        """Sets the modified_time of this View.


        :param modified_time: The modified_time of this View.  # noqa: E501
        :type: datetime
        """

        self._modified_time = modified_time

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


        :return: The permissions of this View.  # noqa: E501
        :rtype: list[ViewReadPermission]
        """
        return self._permissions

    @permissions.setter
    def permissions(self, permissions):
        """Sets the permissions of this View.


        :param permissions: The permissions of this View.  # noqa: E501
        :type: list[ViewReadPermission]
        """

        self._permissions = permissions

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


        :return: The current_user_has_modify_permission of this View.  # noqa: E501
        :rtype: bool
        """
        return self._current_user_has_modify_permission

    @current_user_has_modify_permission.setter
    def current_user_has_modify_permission(self, current_user_has_modify_permission):
        """Sets the current_user_has_modify_permission of this View.


        :param current_user_has_modify_permission: The current_user_has_modify_permission of this View.  # noqa: E501
        :type: bool
        """

        self._current_user_has_modify_permission = current_user_has_modify_permission

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

        for attr, _ in six.iteritems(self.swagger_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
        if issubclass(View, dict):
            for key, value in self.items():
                result[key] = 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, View):
            return False

        return self.__dict__ == other.__dict__

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