# coding: utf-8

"""
    GraphDB Workbench API

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

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


import pprint
import re  # noqa: F401

import six

from graphdb.graphdb_workbench.configuration import Configuration


class MasterNode(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 = {
        'average_read_time': 'int',
        'completed_reads': 'int',
        'completed_writes': 'int',
        'failed_reads': 'int',
        'failed_writes': 'int',
        'is_local': 'bool',
        'location': 'str',
        'mode': 'str',
        'node_id': 'str',
        'peers': 'list[MasterNode]',
        'pending_writes': 'int',
        'readonly': 'bool',
        'running_reads': 'int',
        'running_writes': 'int',
        'status': 'str',
        'type': 'str',
        'workers': 'list[WorkerNode]'
    }

    attribute_map = {
        'average_read_time': 'averageReadTime',
        'completed_reads': 'completedReads',
        'completed_writes': 'completedWrites',
        'failed_reads': 'failedReads',
        'failed_writes': 'failedWrites',
        'is_local': 'isLocal',
        'location': 'location',
        'mode': 'mode',
        'node_id': 'nodeID',
        'peers': 'peers',
        'pending_writes': 'pendingWrites',
        'readonly': 'readonly',
        'running_reads': 'runningReads',
        'running_writes': 'runningWrites',
        'status': 'status',
        'type': 'type',
        'workers': 'workers'
    }

    def __init__(self, average_read_time=None, completed_reads=None, completed_writes=None, failed_reads=None, failed_writes=None, is_local=None, location=None, mode=None, node_id=None, peers=None, pending_writes=None, readonly=None, running_reads=None, running_writes=None, status=None, type=None, workers=None, _configuration=None):  # noqa: E501
        """MasterNode - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._average_read_time = None
        self._completed_reads = None
        self._completed_writes = None
        self._failed_reads = None
        self._failed_writes = None
        self._is_local = None
        self._location = None
        self._mode = None
        self._node_id = None
        self._peers = None
        self._pending_writes = None
        self._readonly = None
        self._running_reads = None
        self._running_writes = None
        self._status = None
        self._type = None
        self._workers = None
        self.discriminator = None

        if average_read_time is not None:
            self.average_read_time = average_read_time
        if completed_reads is not None:
            self.completed_reads = completed_reads
        if completed_writes is not None:
            self.completed_writes = completed_writes
        if failed_reads is not None:
            self.failed_reads = failed_reads
        if failed_writes is not None:
            self.failed_writes = failed_writes
        if is_local is not None:
            self.is_local = is_local
        if location is not None:
            self.location = location
        if mode is not None:
            self.mode = mode
        if node_id is not None:
            self.node_id = node_id
        if peers is not None:
            self.peers = peers
        if pending_writes is not None:
            self.pending_writes = pending_writes
        if readonly is not None:
            self.readonly = readonly
        if running_reads is not None:
            self.running_reads = running_reads
        if running_writes is not None:
            self.running_writes = running_writes
        if status is not None:
            self.status = status
        if type is not None:
            self.type = type
        if workers is not None:
            self.workers = workers

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


        :return: The average_read_time of this MasterNode.  # noqa: E501
        :rtype: int
        """
        return self._average_read_time

    @average_read_time.setter
    def average_read_time(self, average_read_time):
        """Sets the average_read_time of this MasterNode.


        :param average_read_time: The average_read_time of this MasterNode.  # noqa: E501
        :type: int
        """

        self._average_read_time = average_read_time

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


        :return: The completed_reads of this MasterNode.  # noqa: E501
        :rtype: int
        """
        return self._completed_reads

    @completed_reads.setter
    def completed_reads(self, completed_reads):
        """Sets the completed_reads of this MasterNode.


        :param completed_reads: The completed_reads of this MasterNode.  # noqa: E501
        :type: int
        """

        self._completed_reads = completed_reads

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


        :return: The completed_writes of this MasterNode.  # noqa: E501
        :rtype: int
        """
        return self._completed_writes

    @completed_writes.setter
    def completed_writes(self, completed_writes):
        """Sets the completed_writes of this MasterNode.


        :param completed_writes: The completed_writes of this MasterNode.  # noqa: E501
        :type: int
        """

        self._completed_writes = completed_writes

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


        :return: The failed_reads of this MasterNode.  # noqa: E501
        :rtype: int
        """
        return self._failed_reads

    @failed_reads.setter
    def failed_reads(self, failed_reads):
        """Sets the failed_reads of this MasterNode.


        :param failed_reads: The failed_reads of this MasterNode.  # noqa: E501
        :type: int
        """

        self._failed_reads = failed_reads

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


        :return: The failed_writes of this MasterNode.  # noqa: E501
        :rtype: int
        """
        return self._failed_writes

    @failed_writes.setter
    def failed_writes(self, failed_writes):
        """Sets the failed_writes of this MasterNode.


        :param failed_writes: The failed_writes of this MasterNode.  # noqa: E501
        :type: int
        """

        self._failed_writes = failed_writes

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


        :return: The is_local of this MasterNode.  # noqa: E501
        :rtype: bool
        """
        return self._is_local

    @is_local.setter
    def is_local(self, is_local):
        """Sets the is_local of this MasterNode.


        :param is_local: The is_local of this MasterNode.  # noqa: E501
        :type: bool
        """

        self._is_local = is_local

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


        :return: The location of this MasterNode.  # noqa: E501
        :rtype: str
        """
        return self._location

    @location.setter
    def location(self, location):
        """Sets the location of this MasterNode.


        :param location: The location of this MasterNode.  # noqa: E501
        :type: str
        """

        self._location = location

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


        :return: The mode of this MasterNode.  # noqa: E501
        :rtype: str
        """
        return self._mode

    @mode.setter
    def mode(self, mode):
        """Sets the mode of this MasterNode.


        :param mode: The mode of this MasterNode.  # noqa: E501
        :type: str
        """

        self._mode = mode

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


        :return: The node_id of this MasterNode.  # noqa: E501
        :rtype: str
        """
        return self._node_id

    @node_id.setter
    def node_id(self, node_id):
        """Sets the node_id of this MasterNode.


        :param node_id: The node_id of this MasterNode.  # noqa: E501
        :type: str
        """

        self._node_id = node_id

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


        :return: The peers of this MasterNode.  # noqa: E501
        :rtype: list[MasterNode]
        """
        return self._peers

    @peers.setter
    def peers(self, peers):
        """Sets the peers of this MasterNode.


        :param peers: The peers of this MasterNode.  # noqa: E501
        :type: list[MasterNode]
        """

        self._peers = peers

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


        :return: The pending_writes of this MasterNode.  # noqa: E501
        :rtype: int
        """
        return self._pending_writes

    @pending_writes.setter
    def pending_writes(self, pending_writes):
        """Sets the pending_writes of this MasterNode.


        :param pending_writes: The pending_writes of this MasterNode.  # noqa: E501
        :type: int
        """

        self._pending_writes = pending_writes

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


        :return: The readonly of this MasterNode.  # noqa: E501
        :rtype: bool
        """
        return self._readonly

    @readonly.setter
    def readonly(self, readonly):
        """Sets the readonly of this MasterNode.


        :param readonly: The readonly of this MasterNode.  # noqa: E501
        :type: bool
        """

        self._readonly = readonly

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


        :return: The running_reads of this MasterNode.  # noqa: E501
        :rtype: int
        """
        return self._running_reads

    @running_reads.setter
    def running_reads(self, running_reads):
        """Sets the running_reads of this MasterNode.


        :param running_reads: The running_reads of this MasterNode.  # noqa: E501
        :type: int
        """

        self._running_reads = running_reads

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


        :return: The running_writes of this MasterNode.  # noqa: E501
        :rtype: int
        """
        return self._running_writes

    @running_writes.setter
    def running_writes(self, running_writes):
        """Sets the running_writes of this MasterNode.


        :param running_writes: The running_writes of this MasterNode.  # noqa: E501
        :type: int
        """

        self._running_writes = running_writes

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


        :return: The status of this MasterNode.  # noqa: E501
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this MasterNode.


        :param status: The status of this MasterNode.  # noqa: E501
        :type: str
        """

        self._status = status

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


        :return: The type of this MasterNode.  # noqa: E501
        :rtype: str
        """
        return self._type

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


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

        self._type = type

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


        :return: The workers of this MasterNode.  # noqa: E501
        :rtype: list[WorkerNode]
        """
        return self._workers

    @workers.setter
    def workers(self, workers):
        """Sets the workers of this MasterNode.


        :param workers: The workers of this MasterNode.  # noqa: E501
        :type: list[WorkerNode]
        """

        self._workers = workers

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

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