# coding: utf-8

"""
    Anyscale 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 anyscale_client.configuration import Configuration


class JobQueueSpec(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 = {
        'job_queue_name': 'str',
        'execution_mode': 'JobQueueExecutionMode',
        'compute_config_id': 'str',
        'cluster_environment_build_id': 'str',
        'max_concurrency': 'int',
        'idle_timeout_sec': 'int'
    }

    attribute_map = {
        'job_queue_name': 'job_queue_name',
        'execution_mode': 'execution_mode',
        'compute_config_id': 'compute_config_id',
        'cluster_environment_build_id': 'cluster_environment_build_id',
        'max_concurrency': 'max_concurrency',
        'idle_timeout_sec': 'idle_timeout_sec'
    }

    def __init__(self, job_queue_name=None, execution_mode=None, compute_config_id=None, cluster_environment_build_id=None, max_concurrency=1, idle_timeout_sec=None, local_vars_configuration=None):  # noqa: E501
        """JobQueueSpec - 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._job_queue_name = None
        self._execution_mode = None
        self._compute_config_id = None
        self._cluster_environment_build_id = None
        self._max_concurrency = None
        self._idle_timeout_sec = None
        self.discriminator = None

        if job_queue_name is not None:
            self.job_queue_name = job_queue_name
        if execution_mode is not None:
            self.execution_mode = execution_mode
        if compute_config_id is not None:
            self.compute_config_id = compute_config_id
        if cluster_environment_build_id is not None:
            self.cluster_environment_build_id = cluster_environment_build_id
        if max_concurrency is not None:
            self.max_concurrency = max_concurrency
        self.idle_timeout_sec = idle_timeout_sec

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

        Optional user-provided identifier of the queue that could be subsequently used to reference the queue when submitting jobs. Note that name has to be unique within the project.  # noqa: E501

        :return: The job_queue_name of this JobQueueSpec.  # noqa: E501
        :rtype: str
        """
        return self._job_queue_name

    @job_queue_name.setter
    def job_queue_name(self, job_queue_name):
        """Sets the job_queue_name of this JobQueueSpec.

        Optional user-provided identifier of the queue that could be subsequently used to reference the queue when submitting jobs. Note that name has to be unique within the project.  # noqa: E501

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

        self._job_queue_name = job_queue_name

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

        Execution mode of the jobs submitted into the queue (one of: FIFO,LIFO,PRIORITY  # noqa: E501

        :return: The execution_mode of this JobQueueSpec.  # noqa: E501
        :rtype: JobQueueExecutionMode
        """
        return self._execution_mode

    @execution_mode.setter
    def execution_mode(self, execution_mode):
        """Sets the execution_mode of this JobQueueSpec.

        Execution mode of the jobs submitted into the queue (one of: FIFO,LIFO,PRIORITY  # noqa: E501

        :param execution_mode: The execution_mode of this JobQueueSpec.  # noqa: E501
        :type: JobQueueExecutionMode
        """

        self._execution_mode = execution_mode

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

        The id of the compute configuration that will be used to create cluster associated with the queue. Defaults to default compute config in the given project  # noqa: E501

        :return: The compute_config_id of this JobQueueSpec.  # noqa: E501
        :rtype: str
        """
        return self._compute_config_id

    @compute_config_id.setter
    def compute_config_id(self, compute_config_id):
        """Sets the compute_config_id of this JobQueueSpec.

        The id of the compute configuration that will be used to create cluster associated with the queue. Defaults to default compute config in the given project  # noqa: E501

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

        self._compute_config_id = compute_config_id

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

        The id of the cluster environment build that will be used to create cluster associated with the queue.  # noqa: E501

        :return: The cluster_environment_build_id of this JobQueueSpec.  # noqa: E501
        :rtype: str
        """
        return self._cluster_environment_build_id

    @cluster_environment_build_id.setter
    def cluster_environment_build_id(self, cluster_environment_build_id):
        """Sets the cluster_environment_build_id of this JobQueueSpec.

        The id of the cluster environment build that will be used to create cluster associated with the queue.  # noqa: E501

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

        self._cluster_environment_build_id = cluster_environment_build_id

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

        Max number of jobs to be run concurrently. Defaults to 1, ie running no more than 1 job at a time.  # noqa: E501

        :return: The max_concurrency of this JobQueueSpec.  # noqa: E501
        :rtype: int
        """
        return self._max_concurrency

    @max_concurrency.setter
    def max_concurrency(self, max_concurrency):
        """Sets the max_concurrency of this JobQueueSpec.

        Max number of jobs to be run concurrently. Defaults to 1, ie running no more than 1 job at a time.  # noqa: E501

        :param max_concurrency: The max_concurrency of this JobQueueSpec.  # noqa: E501
        :type: int
        """

        self._max_concurrency = max_concurrency

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

        Max period of time queue will be accepting new jobs, before being sealed off and its associated cluster being shutdown  # noqa: E501

        :return: The idle_timeout_sec of this JobQueueSpec.  # noqa: E501
        :rtype: int
        """
        return self._idle_timeout_sec

    @idle_timeout_sec.setter
    def idle_timeout_sec(self, idle_timeout_sec):
        """Sets the idle_timeout_sec of this JobQueueSpec.

        Max period of time queue will be accepting new jobs, before being sealed off and its associated cluster being shutdown  # noqa: E501

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

        self._idle_timeout_sec = idle_timeout_sec

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

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