# 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 CreateProductionJobConfig(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 = {
        'entrypoint': 'str',
        'ray_serve_config': 'object',
        'runtime_env': 'RayRuntimeEnvConfig',
        'build_id': 'str',
        'image_uri': 'str',
        'registry_login_secret': 'str',
        'compute_config_id': 'str',
        'compute_config': 'CreateClusterComputeConfig',
        'max_retries': 'int',
        'timeout_s': 'int',
        'runtime_env_config': 'RayRuntimeEnvConfig'
    }

    attribute_map = {
        'entrypoint': 'entrypoint',
        'ray_serve_config': 'ray_serve_config',
        'runtime_env': 'runtime_env',
        'build_id': 'build_id',
        'image_uri': 'image_uri',
        'registry_login_secret': 'registry_login_secret',
        'compute_config_id': 'compute_config_id',
        'compute_config': 'compute_config',
        'max_retries': 'max_retries',
        'timeout_s': 'timeout_s',
        'runtime_env_config': 'runtime_env_config'
    }

    def __init__(self, entrypoint='', ray_serve_config=None, runtime_env=None, build_id=None, image_uri=None, registry_login_secret=None, compute_config_id=None, compute_config=None, max_retries=5, timeout_s=None, runtime_env_config=None, local_vars_configuration=None):  # noqa: E501
        """CreateProductionJobConfig - 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._entrypoint = None
        self._ray_serve_config = None
        self._runtime_env = None
        self._build_id = None
        self._image_uri = None
        self._registry_login_secret = None
        self._compute_config_id = None
        self._compute_config = None
        self._max_retries = None
        self._timeout_s = None
        self._runtime_env_config = None
        self.discriminator = None

        if entrypoint is not None:
            self.entrypoint = entrypoint
        if ray_serve_config is not None:
            self.ray_serve_config = ray_serve_config
        if runtime_env is not None:
            self.runtime_env = runtime_env
        if build_id is not None:
            self.build_id = build_id
        if image_uri is not None:
            self.image_uri = image_uri
        if registry_login_secret is not None:
            self.registry_login_secret = registry_login_secret
        if compute_config_id is not None:
            self.compute_config_id = compute_config_id
        if compute_config is not None:
            self.compute_config = compute_config
        if max_retries is not None:
            self.max_retries = max_retries
        if timeout_s is not None:
            self.timeout_s = timeout_s
        if runtime_env_config is not None:
            self.runtime_env_config = runtime_env_config

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

        A script that will be run to start your job.This command will be run in the root directory of the specified runtime env. Eg. 'python script.py'  # noqa: E501

        :return: The entrypoint of this CreateProductionJobConfig.  # noqa: E501
        :rtype: str
        """
        return self._entrypoint

    @entrypoint.setter
    def entrypoint(self, entrypoint):
        """Sets the entrypoint of this CreateProductionJobConfig.

        A script that will be run to start your job.This command will be run in the root directory of the specified runtime env. Eg. 'python script.py'  # noqa: E501

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

        self._entrypoint = entrypoint

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

        The Ray Serve config to use for this Production service. This config defines your Ray Serve application, and will be passed directly to Ray Serve. You can learn more about Ray Serve config files here: https://docs.ray.io/en/latest/serve/production-guide/config.html  # noqa: E501

        :return: The ray_serve_config of this CreateProductionJobConfig.  # noqa: E501
        :rtype: object
        """
        return self._ray_serve_config

    @ray_serve_config.setter
    def ray_serve_config(self, ray_serve_config):
        """Sets the ray_serve_config of this CreateProductionJobConfig.

        The Ray Serve config to use for this Production service. This config defines your Ray Serve application, and will be passed directly to Ray Serve. You can learn more about Ray Serve config files here: https://docs.ray.io/en/latest/serve/production-guide/config.html  # noqa: E501

        :param ray_serve_config: The ray_serve_config of this CreateProductionJobConfig.  # noqa: E501
        :type: object
        """

        self._ray_serve_config = ray_serve_config

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

        A ray runtime env json. Your entrypoint will be run in the environment specified by this runtime env.  # noqa: E501

        :return: The runtime_env of this CreateProductionJobConfig.  # noqa: E501
        :rtype: RayRuntimeEnvConfig
        """
        return self._runtime_env

    @runtime_env.setter
    def runtime_env(self, runtime_env):
        """Sets the runtime_env of this CreateProductionJobConfig.

        A ray runtime env json. Your entrypoint will be run in the environment specified by this runtime env.  # noqa: E501

        :param runtime_env: The runtime_env of this CreateProductionJobConfig.  # noqa: E501
        :type: RayRuntimeEnvConfig
        """

        self._runtime_env = runtime_env

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

        The id of the cluster env build. This id will determine the docker image your job is run on. Either build_id or image_uri must be provided.  # noqa: E501

        :return: The build_id of this CreateProductionJobConfig.  # noqa: E501
        :rtype: str
        """
        return self._build_id

    @build_id.setter
    def build_id(self, build_id):
        """Sets the build_id of this CreateProductionJobConfig.

        The id of the cluster env build. This id will determine the docker image your job is run on. Either build_id or image_uri must be provided.  # noqa: E501

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

        self._build_id = build_id

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

        The image URI of the container in which the job will run. Can be an Anyscale image (anyscale/ray:*), cluster environment image (anyscale/image/*), or a BYOD image from an external registry. Either build_id or image_uri must be provided.  # noqa: E501

        :return: The image_uri of this CreateProductionJobConfig.  # noqa: E501
        :rtype: str
        """
        return self._image_uri

    @image_uri.setter
    def image_uri(self, image_uri):
        """Sets the image_uri of this CreateProductionJobConfig.

        The image URI of the container in which the job will run. Can be an Anyscale image (anyscale/ray:*), cluster environment image (anyscale/image/*), or a BYOD image from an external registry. Either build_id or image_uri must be provided.  # noqa: E501

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

        self._image_uri = image_uri

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

        The name or identifier of a secret containing credentials to authenticate to the docker registry hosting the image. Only used with image_uri for BYOD images from external registries.  # noqa: E501

        :return: The registry_login_secret of this CreateProductionJobConfig.  # noqa: E501
        :rtype: str
        """
        return self._registry_login_secret

    @registry_login_secret.setter
    def registry_login_secret(self, registry_login_secret):
        """Sets the registry_login_secret of this CreateProductionJobConfig.

        The name or identifier of a secret containing credentials to authenticate to the docker registry hosting the image. Only used with image_uri for BYOD images from external registries.  # noqa: E501

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

        self._registry_login_secret = registry_login_secret

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

        The id of the compute configuration that you want to use. This id will specify the resources required for your job  # noqa: E501

        :return: The compute_config_id of this CreateProductionJobConfig.  # 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 CreateProductionJobConfig.

        The id of the compute configuration that you want to use. This id will specify the resources required for your job  # noqa: E501

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

        self._compute_config_id = compute_config_id

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

        One-off compute that the cluster will use.  # noqa: E501

        :return: The compute_config of this CreateProductionJobConfig.  # noqa: E501
        :rtype: CreateClusterComputeConfig
        """
        return self._compute_config

    @compute_config.setter
    def compute_config(self, compute_config):
        """Sets the compute_config of this CreateProductionJobConfig.

        One-off compute that the cluster will use.  # noqa: E501

        :param compute_config: The compute_config of this CreateProductionJobConfig.  # noqa: E501
        :type: CreateClusterComputeConfig
        """

        self._compute_config = compute_config

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

        The number of retries this job will attempt on failure. Set to None to set infinite retries  # noqa: E501

        :return: The max_retries of this CreateProductionJobConfig.  # noqa: E501
        :rtype: int
        """
        return self._max_retries

    @max_retries.setter
    def max_retries(self, max_retries):
        """Sets the max_retries of this CreateProductionJobConfig.

        The number of retries this job will attempt on failure. Set to None to set infinite retries  # noqa: E501

        :param max_retries: The max_retries of this CreateProductionJobConfig.  # noqa: E501
        :type: int
        """

        self._max_retries = max_retries

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

        The timeout in seconds for each job run. Set to None for no limit to be set  # noqa: E501

        :return: The timeout_s of this CreateProductionJobConfig.  # noqa: E501
        :rtype: int
        """
        return self._timeout_s

    @timeout_s.setter
    def timeout_s(self, timeout_s):
        """Sets the timeout_s of this CreateProductionJobConfig.

        The timeout in seconds for each job run. Set to None for no limit to be set  # noqa: E501

        :param timeout_s: The timeout_s of this CreateProductionJobConfig.  # noqa: E501
        :type: int
        """

        self._timeout_s = timeout_s

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

        DEPRECATED: Use runtime_env  # noqa: E501

        :return: The runtime_env_config of this CreateProductionJobConfig.  # noqa: E501
        :rtype: RayRuntimeEnvConfig
        """
        return self._runtime_env_config

    @runtime_env_config.setter
    def runtime_env_config(self, runtime_env_config):
        """Sets the runtime_env_config of this CreateProductionJobConfig.

        DEPRECATED: Use runtime_env  # noqa: E501

        :param runtime_env_config: The runtime_env_config of this CreateProductionJobConfig.  # noqa: E501
        :type: RayRuntimeEnvConfig
        """

        self._runtime_env_config = runtime_env_config

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

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