# coding: utf-8

"""
    Collibra Data Governance Center Core API

    <p>The Core REST API allows you to create your own integrations with Collibra Data Governance Center.</p><p><i>Create custom applications to help users get access to the right data.</i></p>  # noqa: E501

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

import pprint
import re  # noqa: F401

import six
from collibra_core.models.assigned_characteristic_type import AssignedCharacteristicType  # noqa: F401,E501

class AssignedRelationType(AssignedCharacteristicType):
    """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 = {
        'role_direction': 'str',
        'relation_type': 'RelationTypeImpl',
        'restriction': 'NamedResourceReferenceImpl'
    }
    if hasattr(AssignedCharacteristicType, "swagger_types"):
        swagger_types.update(AssignedCharacteristicType.swagger_types)

    attribute_map = {
        'role_direction': 'roleDirection',
        'relation_type': 'relationType',
        'restriction': 'restriction'
    }
    if hasattr(AssignedCharacteristicType, "attribute_map"):
        attribute_map.update(AssignedCharacteristicType.attribute_map)

    def __init__(self, role_direction=None, relation_type=None, restriction=None, *args, **kwargs):  # noqa: E501
        """AssignedRelationType - a model defined in Swagger"""  # noqa: E501
        self._role_direction = None
        self._relation_type = None
        self._restriction = None
        self.discriminator = None
        if role_direction is not None:
            self.role_direction = role_direction
        if relation_type is not None:
            self.relation_type = relation_type
        if restriction is not None:
            self.restriction = restriction
        AssignedCharacteristicType.__init__(self, *args, **kwargs)

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

        The direction of the relation type.  # noqa: E501

        :return: The role_direction of this AssignedRelationType.  # noqa: E501
        :rtype: str
        """
        return self._role_direction

    @role_direction.setter
    def role_direction(self, role_direction):
        """Sets the role_direction of this AssignedRelationType.

        The direction of the relation type.  # noqa: E501

        :param role_direction: The role_direction of this AssignedRelationType.  # noqa: E501
        :type: str
        """
        allowed_values = ["TO_SOURCE", "TO_TARGET", "BOTH", "NONE"]  # noqa: E501
        if role_direction not in allowed_values:
            raise ValueError(
                "Invalid value for `role_direction` ({0}), must be one of {1}"  # noqa: E501
                .format(role_direction, allowed_values)
            )

        self._role_direction = role_direction

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


        :return: The relation_type of this AssignedRelationType.  # noqa: E501
        :rtype: RelationTypeImpl
        """
        return self._relation_type

    @relation_type.setter
    def relation_type(self, relation_type):
        """Sets the relation_type of this AssignedRelationType.


        :param relation_type: The relation_type of this AssignedRelationType.  # noqa: E501
        :type: RelationTypeImpl
        """

        self._relation_type = relation_type

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


        :return: The restriction of this AssignedRelationType.  # noqa: E501
        :rtype: NamedResourceReferenceImpl
        """
        return self._restriction

    @restriction.setter
    def restriction(self, restriction):
        """Sets the restriction of this AssignedRelationType.


        :param restriction: The restriction of this AssignedRelationType.  # noqa: E501
        :type: NamedResourceReferenceImpl
        """

        self._restriction = restriction

    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(AssignedRelationType, 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, AssignedRelationType):
            return False

        return self.__dict__ == other.__dict__

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