# 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 ApplyProductionServiceMultiVersionV2Model(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 = {
        'rollout_strategy': 'RolloutStrategy',
        'cloud_id': 'str',
        'project_id': 'str',
        'service_versions': 'list[ApplyProductionServiceV2Model]'
    }

    attribute_map = {
        'rollout_strategy': 'rollout_strategy',
        'cloud_id': 'cloud_id',
        'project_id': 'project_id',
        'service_versions': 'service_versions'
    }

    def __init__(self, rollout_strategy=None, cloud_id=None, project_id=None, service_versions=None, local_vars_configuration=None):  # noqa: E501
        """ApplyProductionServiceMultiVersionV2Model - 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._rollout_strategy = None
        self._cloud_id = None
        self._project_id = None
        self._service_versions = None
        self.discriminator = None

        if rollout_strategy is not None:
            self.rollout_strategy = rollout_strategy
        if cloud_id is not None:
            self.cloud_id = cloud_id
        if project_id is not None:
            self.project_id = project_id
        self.service_versions = service_versions

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

        Strategy for rollout. The ROLLOUT strategy will deploy your Ray Serve configuration onto a newly started cluster, and then shift traffic over to the new cluster. You can manually control the speed of the rollout using the canary_percent configuration. The IN_PLACE strategy will use Ray Serve in place upgrade to update your existing cluster in place. When using this rollout strategy, you may only change the ray_serve_config field. You cannot partially shift traffic or rollback an in place upgrade. In place upgrades are faster and riskier than rollouts, and we recommend only using them for relatively safe changes (for example, increasing the number of replicas on a Ray Serve deployment). The MULTI_VERSION strategy will deploy multiple versions of the service. You can shift traffic between versions using the traffic_percent configuration.Default strategy is ROLLOUT.  # noqa: E501

        :return: The rollout_strategy of this ApplyProductionServiceMultiVersionV2Model.  # noqa: E501
        :rtype: RolloutStrategy
        """
        return self._rollout_strategy

    @rollout_strategy.setter
    def rollout_strategy(self, rollout_strategy):
        """Sets the rollout_strategy of this ApplyProductionServiceMultiVersionV2Model.

        Strategy for rollout. The ROLLOUT strategy will deploy your Ray Serve configuration onto a newly started cluster, and then shift traffic over to the new cluster. You can manually control the speed of the rollout using the canary_percent configuration. The IN_PLACE strategy will use Ray Serve in place upgrade to update your existing cluster in place. When using this rollout strategy, you may only change the ray_serve_config field. You cannot partially shift traffic or rollback an in place upgrade. In place upgrades are faster and riskier than rollouts, and we recommend only using them for relatively safe changes (for example, increasing the number of replicas on a Ray Serve deployment). The MULTI_VERSION strategy will deploy multiple versions of the service. You can shift traffic between versions using the traffic_percent configuration.Default strategy is ROLLOUT.  # noqa: E501

        :param rollout_strategy: The rollout_strategy of this ApplyProductionServiceMultiVersionV2Model.  # noqa: E501
        :type: RolloutStrategy
        """

        self._rollout_strategy = rollout_strategy

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

        Id of the cloud this Service will launch clusters in.  # noqa: E501

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

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

        Id of the cloud this Service will launch clusters in.  # noqa: E501

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

        self._cloud_id = cloud_id

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

        Id of the project this Service will start clusters in.  # noqa: E501

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

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

        Id of the project this Service will start clusters in.  # noqa: E501

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

        self._project_id = project_id

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

        List of versions to deploy. Each version is a deployment of the service.  # noqa: E501

        :return: The service_versions of this ApplyProductionServiceMultiVersionV2Model.  # noqa: E501
        :rtype: list[ApplyProductionServiceV2Model]
        """
        return self._service_versions

    @service_versions.setter
    def service_versions(self, service_versions):
        """Sets the service_versions of this ApplyProductionServiceMultiVersionV2Model.

        List of versions to deploy. Each version is a deployment of the service.  # noqa: E501

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

        self._service_versions = service_versions

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

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