# 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 ServiceConfig(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 = {
        'max_uptime_timeout_sec': 'int',
        'access': 'AccessConfig',
        'protocols': 'Protocols',
        'env_vars': 'object'
    }

    attribute_map = {
        'max_uptime_timeout_sec': 'max_uptime_timeout_sec',
        'access': 'access',
        'protocols': 'protocols',
        'env_vars': 'env_vars'
    }

    def __init__(self, max_uptime_timeout_sec=0, access=None, protocols=None, env_vars=None, local_vars_configuration=None):  # noqa: E501
        """ServiceConfig - 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._max_uptime_timeout_sec = None
        self._access = None
        self._protocols = None
        self._env_vars = None
        self.discriminator = None

        if max_uptime_timeout_sec is not None:
            self.max_uptime_timeout_sec = max_uptime_timeout_sec
        if access is not None:
            self.access = access
        if protocols is not None:
            self.protocols = protocols
        if env_vars is not None:
            self.env_vars = env_vars

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

        Auto-termination timeout (in seconds) for target Service to be unconditionally terminated after specified period. Setting this to 0 disables auto-termination (default).  # noqa: E501

        :return: The max_uptime_timeout_sec of this ServiceConfig.  # noqa: E501
        :rtype: int
        """
        return self._max_uptime_timeout_sec

    @max_uptime_timeout_sec.setter
    def max_uptime_timeout_sec(self, max_uptime_timeout_sec):
        """Sets the max_uptime_timeout_sec of this ServiceConfig.

        Auto-termination timeout (in seconds) for target Service to be unconditionally terminated after specified period. Setting this to 0 disables auto-termination (default).  # noqa: E501

        :param max_uptime_timeout_sec: The max_uptime_timeout_sec of this ServiceConfig.  # noqa: E501
        :type: int
        """

        self._max_uptime_timeout_sec = max_uptime_timeout_sec

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

        Access configuration  # noqa: E501

        :return: The access of this ServiceConfig.  # noqa: E501
        :rtype: AccessConfig
        """
        return self._access

    @access.setter
    def access(self, access):
        """Sets the access of this ServiceConfig.

        Access configuration  # noqa: E501

        :param access: The access of this ServiceConfig.  # noqa: E501
        :type: AccessConfig
        """

        self._access = access

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

        Protocol setups for the service  # noqa: E501

        :return: The protocols of this ServiceConfig.  # noqa: E501
        :rtype: Protocols
        """
        return self._protocols

    @protocols.setter
    def protocols(self, protocols):
        """Sets the protocols of this ServiceConfig.

        Protocol setups for the service  # noqa: E501

        :param protocols: The protocols of this ServiceConfig.  # noqa: E501
        :type: Protocols
        """

        self._protocols = protocols

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

        Environment variables to set on the service cluster  # noqa: E501

        :return: The env_vars of this ServiceConfig.  # noqa: E501
        :rtype: object
        """
        return self._env_vars

    @env_vars.setter
    def env_vars(self, env_vars):
        """Sets the env_vars of this ServiceConfig.

        Environment variables to set on the service cluster  # noqa: E501

        :param env_vars: The env_vars of this ServiceConfig.  # noqa: E501
        :type: object
        """

        self._env_vars = env_vars

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

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