# coding: utf-8

"""
    Trackside Software TeamDB API v2.0

    This API enables you to access TeamDB data  # noqa: E501

    OpenAPI spec version: 2.0
    Contact: support@trackside.fr
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from teamdbapi.configuration import Configuration


class ModelFieldAuthorization(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',
        'concerned_entity_id': 'str',
        'concerned_entity_is_group': 'bool',
        'model_field_id': 'str',
        'can_read': 'bool',
        'can_write': 'bool'
    }

    attribute_map = {
        'id': 'Id',
        'concerned_entity_id': 'ConcernedEntityId',
        'concerned_entity_is_group': 'ConcernedEntityIsGroup',
        'model_field_id': 'ModelFieldId',
        'can_read': 'CanRead',
        'can_write': 'CanWrite'
    }

    def __init__(self, id=None, concerned_entity_id=None, concerned_entity_is_group=None, model_field_id=None, can_read=None, can_write=None, _configuration=None):  # noqa: E501
        """ModelFieldAuthorization - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._id = None
        self._concerned_entity_id = None
        self._concerned_entity_is_group = None
        self._model_field_id = None
        self._can_read = None
        self._can_write = None
        self.discriminator = None

        self.id = id
        self.concerned_entity_id = concerned_entity_id
        if concerned_entity_is_group is not None:
            self.concerned_entity_is_group = concerned_entity_is_group
        self.model_field_id = model_field_id
        if can_read is not None:
            self.can_read = can_read
        if can_write is not None:
            self.can_write = can_write

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

        The unique model field authorization Id.  # noqa: E501

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

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

        The unique model field authorization Id.  # noqa: E501

        :param id: The id of this ModelFieldAuthorization.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

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

        The unique id of the concerned entity (user or group).  # noqa: E501

        :return: The concerned_entity_id of this ModelFieldAuthorization.  # noqa: E501
        :rtype: str
        """
        return self._concerned_entity_id

    @concerned_entity_id.setter
    def concerned_entity_id(self, concerned_entity_id):
        """Sets the concerned_entity_id of this ModelFieldAuthorization.

        The unique id of the concerned entity (user or group).  # noqa: E501

        :param concerned_entity_id: The concerned_entity_id of this ModelFieldAuthorization.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and concerned_entity_id is None:
            raise ValueError("Invalid value for `concerned_entity_id`, must not be `None`")  # noqa: E501

        self._concerned_entity_id = concerned_entity_id

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

        Set to True if `ConcernedEntityId` is a group id.  # noqa: E501

        :return: The concerned_entity_is_group of this ModelFieldAuthorization.  # noqa: E501
        :rtype: bool
        """
        return self._concerned_entity_is_group

    @concerned_entity_is_group.setter
    def concerned_entity_is_group(self, concerned_entity_is_group):
        """Sets the concerned_entity_is_group of this ModelFieldAuthorization.

        Set to True if `ConcernedEntityId` is a group id.  # noqa: E501

        :param concerned_entity_is_group: The concerned_entity_is_group of this ModelFieldAuthorization.  # noqa: E501
        :type: bool
        """

        self._concerned_entity_is_group = concerned_entity_is_group

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

        The model field id to which this authorization belongs.  # noqa: E501

        :return: The model_field_id of this ModelFieldAuthorization.  # noqa: E501
        :rtype: str
        """
        return self._model_field_id

    @model_field_id.setter
    def model_field_id(self, model_field_id):
        """Sets the model_field_id of this ModelFieldAuthorization.

        The model field id to which this authorization belongs.  # noqa: E501

        :param model_field_id: The model_field_id of this ModelFieldAuthorization.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and model_field_id is None:
            raise ValueError("Invalid value for `model_field_id`, must not be `None`")  # noqa: E501

        self._model_field_id = model_field_id

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

        Set to True to allow the user/group to read the model field data.  # noqa: E501

        :return: The can_read of this ModelFieldAuthorization.  # noqa: E501
        :rtype: bool
        """
        return self._can_read

    @can_read.setter
    def can_read(self, can_read):
        """Sets the can_read of this ModelFieldAuthorization.

        Set to True to allow the user/group to read the model field data.  # noqa: E501

        :param can_read: The can_read of this ModelFieldAuthorization.  # noqa: E501
        :type: bool
        """

        self._can_read = can_read

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

        Set to True to allow the user/group to write into the model field data.  # noqa: E501

        :return: The can_write of this ModelFieldAuthorization.  # noqa: E501
        :rtype: bool
        """
        return self._can_write

    @can_write.setter
    def can_write(self, can_write):
        """Sets the can_write of this ModelFieldAuthorization.

        Set to True to allow the user/group to write into the model field data.  # noqa: E501

        :param can_write: The can_write of this ModelFieldAuthorization.  # noqa: E501
        :type: bool
        """

        self._can_write = can_write

    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(ModelFieldAuthorization, 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, ModelFieldAuthorization):
            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, ModelFieldAuthorization):
            return True

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