# coding: utf-8

"""
    Managed Ray API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 0.1.0
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from openapi_client.configuration import Configuration


class LineageGraph(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 = {
        'node': 'LineageGraphNode',
        'in_edges': 'list[LineageGraphNode]',
        'out_edges': 'list[LineageGraphNode]'
    }

    attribute_map = {
        'node': 'node',
        'in_edges': 'in_edges',
        'out_edges': 'out_edges'
    }

    def __init__(self, node=None, in_edges=None, out_edges=None, local_vars_configuration=None):  # noqa: E501
        """LineageGraph - 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._node = None
        self._in_edges = None
        self._out_edges = None
        self.discriminator = None

        self.node = node
        if in_edges is not None:
            self.in_edges = in_edges
        if out_edges is not None:
            self.out_edges = out_edges

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

        The queried node  # noqa: E501

        :return: The node of this LineageGraph.  # noqa: E501
        :rtype: LineageGraphNode
        """
        return self._node

    @node.setter
    def node(self, node):
        """Sets the node of this LineageGraph.

        The queried node  # noqa: E501

        :param node: The node of this LineageGraph.  # noqa: E501
        :type: LineageGraphNode
        """
        if self.local_vars_configuration.client_side_validation and node is None:  # noqa: E501
            raise ValueError("Invalid value for `node`, must not be `None`")  # noqa: E501

        self._node = node

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

        Nodes with inward edges (producers)  # noqa: E501

        :return: The in_edges of this LineageGraph.  # noqa: E501
        :rtype: list[LineageGraphNode]
        """
        return self._in_edges

    @in_edges.setter
    def in_edges(self, in_edges):
        """Sets the in_edges of this LineageGraph.

        Nodes with inward edges (producers)  # noqa: E501

        :param in_edges: The in_edges of this LineageGraph.  # noqa: E501
        :type: list[LineageGraphNode]
        """

        self._in_edges = in_edges

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

        Nodes with outward edges (consumers)  # noqa: E501

        :return: The out_edges of this LineageGraph.  # noqa: E501
        :rtype: list[LineageGraphNode]
        """
        return self._out_edges

    @out_edges.setter
    def out_edges(self, out_edges):
        """Sets the out_edges of this LineageGraph.

        Nodes with outward edges (consumers)  # noqa: E501

        :param out_edges: The out_edges of this LineageGraph.  # noqa: E501
        :type: list[LineageGraphNode]
        """

        self._out_edges = out_edges

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

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