# 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 ProductionServiceV2Model(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 = {
        'id': 'str',
        'name': 'str',
        'description': 'str',
        'project_id': 'str',
        'cloud_id': 'str',
        'creator_id': 'str',
        'created_at': 'datetime',
        'hostname': 'str',
        'current_state': 'ServiceEventCurrentState',
        'goal_state': 'ServiceGoalStates',
        'auth_token': 'str',
        'auto_rollout_enabled': 'bool',
        'versions': 'list[ProductionServiceV2VersionModel]',
        'service_observability_urls': 'ServiceObservabilityUrls'
    }

    attribute_map = {
        'id': 'id',
        'name': 'name',
        'description': 'description',
        'project_id': 'project_id',
        'cloud_id': 'cloud_id',
        'creator_id': 'creator_id',
        'created_at': 'created_at',
        'hostname': 'hostname',
        'current_state': 'current_state',
        'goal_state': 'goal_state',
        'auth_token': 'auth_token',
        'auto_rollout_enabled': 'auto_rollout_enabled',
        'versions': 'versions',
        'service_observability_urls': 'service_observability_urls'
    }

    def __init__(self, id=None, name=None, description=None, project_id=None, cloud_id=None, creator_id=None, created_at=None, hostname=None, current_state=None, goal_state=None, auth_token=None, auto_rollout_enabled=None, versions=None, service_observability_urls=None, local_vars_configuration=None):  # noqa: E501
        """ProductionServiceV2Model - 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._id = None
        self._name = None
        self._description = None
        self._project_id = None
        self._cloud_id = None
        self._creator_id = None
        self._created_at = None
        self._hostname = None
        self._current_state = None
        self._goal_state = None
        self._auth_token = None
        self._auto_rollout_enabled = None
        self._versions = None
        self._service_observability_urls = None
        self.discriminator = None

        self.id = id
        self.name = name
        if description is not None:
            self.description = description
        self.project_id = project_id
        self.cloud_id = cloud_id
        self.creator_id = creator_id
        self.created_at = created_at
        self.hostname = hostname
        self.current_state = current_state
        self.goal_state = goal_state
        self.auth_token = auth_token
        self.auto_rollout_enabled = auto_rollout_enabled
        self.versions = versions
        self.service_observability_urls = service_observability_urls

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

        Id of the Service  # noqa: E501

        :return: The id of this ProductionServiceV2Model.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this ProductionServiceV2Model.

        Id of the Service  # noqa: E501

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

        self._id = id

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

        Name of the Service  # noqa: E501

        :return: The name of this ProductionServiceV2Model.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this ProductionServiceV2Model.

        Name of the Service  # noqa: E501

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

        self._name = name

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

        Description of the Service  # noqa: E501

        :return: The description of this ProductionServiceV2Model.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this ProductionServiceV2Model.

        Description of the Service  # noqa: E501

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

        self._description = description

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

        Id of the project this Service will start clusters in. This configuration cannot be changed after the service is created.  # noqa: E501

        :return: The project_id of this ProductionServiceV2Model.  # noqa: E501
        :rtype: str
        """
        return self._project_id

    @project_id.setter
    def project_id(self, project_id):
        """Sets the project_id of this ProductionServiceV2Model.

        Id of the project this Service will start clusters in. This configuration cannot be changed after the service is created.  # noqa: E501

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

        self._project_id = project_id

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

        Id of the cloud this Service belongs to, and will launch clusters in. This configuration cannot be changed.  # noqa: E501

        :return: The cloud_id of this ProductionServiceV2Model.  # noqa: E501
        :rtype: str
        """
        return self._cloud_id

    @cloud_id.setter
    def cloud_id(self, cloud_id):
        """Sets the cloud_id of this ProductionServiceV2Model.

        Id of the cloud this Service belongs to, and will launch clusters in. This configuration cannot be changed.  # noqa: E501

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

        self._cloud_id = cloud_id

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

        Id of the user who created the Service  # noqa: E501

        :return: The creator_id of this ProductionServiceV2Model.  # noqa: E501
        :rtype: str
        """
        return self._creator_id

    @creator_id.setter
    def creator_id(self, creator_id):
        """Sets the creator_id of this ProductionServiceV2Model.

        Id of the user who created the Service  # noqa: E501

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

        self._creator_id = creator_id

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

        Time the Service was created  # noqa: E501

        :return: The created_at of this ProductionServiceV2Model.  # noqa: E501
        :rtype: datetime
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """Sets the created_at of this ProductionServiceV2Model.

        Time the Service was created  # noqa: E501

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

        self._created_at = created_at

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

        The hostname of the service  # noqa: E501

        :return: The hostname of this ProductionServiceV2Model.  # noqa: E501
        :rtype: str
        """
        return self._hostname

    @hostname.setter
    def hostname(self, hostname):
        """Sets the hostname of this ProductionServiceV2Model.

        The hostname of the service  # noqa: E501

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

        self._hostname = hostname

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

        The current state of this service  # noqa: E501

        :return: The current_state of this ProductionServiceV2Model.  # noqa: E501
        :rtype: ServiceEventCurrentState
        """
        return self._current_state

    @current_state.setter
    def current_state(self, current_state):
        """Sets the current_state of this ProductionServiceV2Model.

        The current state of this service  # noqa: E501

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

        self._current_state = current_state

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

        The goal state of this service  # noqa: E501

        :return: The goal_state of this ProductionServiceV2Model.  # noqa: E501
        :rtype: ServiceGoalStates
        """
        return self._goal_state

    @goal_state.setter
    def goal_state(self, goal_state):
        """Sets the goal_state of this ProductionServiceV2Model.

        The goal state of this service  # noqa: E501

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

        self._goal_state = goal_state

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

        Token to use for service auth. To use the token, add it as a header with the key 'Authorization' and the value 'Bearer <token>'  # noqa: E501

        :return: The auth_token of this ProductionServiceV2Model.  # noqa: E501
        :rtype: str
        """
        return self._auth_token

    @auth_token.setter
    def auth_token(self, auth_token):
        """Sets the auth_token of this ProductionServiceV2Model.

        Token to use for service auth. To use the token, add it as a header with the key 'Authorization' and the value 'Bearer <token>'  # noqa: E501

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

        self._auth_token = auth_token

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

        Whether or not the service is using auto rollout  # noqa: E501

        :return: The auto_rollout_enabled of this ProductionServiceV2Model.  # noqa: E501
        :rtype: bool
        """
        return self._auto_rollout_enabled

    @auto_rollout_enabled.setter
    def auto_rollout_enabled(self, auto_rollout_enabled):
        """Sets the auto_rollout_enabled of this ProductionServiceV2Model.

        Whether or not the service is using auto rollout  # noqa: E501

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

        self._auto_rollout_enabled = auto_rollout_enabled

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

        Active versions of this service, sorted by creation time in ascending order.  # noqa: E501

        :return: The versions of this ProductionServiceV2Model.  # noqa: E501
        :rtype: list[ProductionServiceV2VersionModel]
        """
        return self._versions

    @versions.setter
    def versions(self, versions):
        """Sets the versions of this ProductionServiceV2Model.

        Active versions of this service, sorted by creation time in ascending order.  # noqa: E501

        :param versions: The versions of this ProductionServiceV2Model.  # noqa: E501
        :type: list[ProductionServiceV2VersionModel]
        """
        if self.local_vars_configuration.client_side_validation and versions is None:  # noqa: E501
            raise ValueError("Invalid value for `versions`, must not be `None`")  # noqa: E501

        self._versions = versions

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

        A JSON object with useful urls pointing to Grafana dashboards.  # noqa: E501

        :return: The service_observability_urls of this ProductionServiceV2Model.  # noqa: E501
        :rtype: ServiceObservabilityUrls
        """
        return self._service_observability_urls

    @service_observability_urls.setter
    def service_observability_urls(self, service_observability_urls):
        """Sets the service_observability_urls of this ProductionServiceV2Model.

        A JSON object with useful urls pointing to Grafana dashboards.  # noqa: E501

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

        self._service_observability_urls = service_observability_urls

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

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