# coding: utf-8

"""
    Aron API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 1.0.0
    Generated by: https://openapi-generator.tech
"""


try:
    from inspect import getfullargspec
except ImportError:
    from inspect import getargspec as getfullargspec
import pprint
import re  # noqa: F401
import six

from vessl.openapi_client.configuration import Configuration


class OrmModelServiceRolloutSpec(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 = {
        'no_rollback_on_failure': 'bool',
        'rollback_of_rollout_number': 'int',
        'step_timeout_second': 'int',
        'steps': 'list[OrmModelServiceRolloutStepWrapper]'
    }

    attribute_map = {
        'no_rollback_on_failure': 'no_rollback_on_failure',
        'rollback_of_rollout_number': 'rollback_of_rollout_number',
        'step_timeout_second': 'step_timeout_second',
        'steps': 'steps'
    }

    def __init__(self, no_rollback_on_failure=None, rollback_of_rollout_number=None, step_timeout_second=None, steps=None, local_vars_configuration=None):  # noqa: E501
        """OrmModelServiceRolloutSpec - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration.get_default_copy()
        self.local_vars_configuration = local_vars_configuration

        self._no_rollback_on_failure = None
        self._rollback_of_rollout_number = None
        self._step_timeout_second = None
        self._steps = None
        self.discriminator = None

        if no_rollback_on_failure is not None:
            self.no_rollback_on_failure = no_rollback_on_failure
        self.rollback_of_rollout_number = rollback_of_rollout_number
        if step_timeout_second is not None:
            self.step_timeout_second = step_timeout_second
        self.steps = steps

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


        :return: The no_rollback_on_failure of this OrmModelServiceRolloutSpec.  # noqa: E501
        :rtype: bool
        """
        return self._no_rollback_on_failure

    @no_rollback_on_failure.setter
    def no_rollback_on_failure(self, no_rollback_on_failure):
        """Sets the no_rollback_on_failure of this OrmModelServiceRolloutSpec.


        :param no_rollback_on_failure: The no_rollback_on_failure of this OrmModelServiceRolloutSpec.  # noqa: E501
        :type no_rollback_on_failure: bool
        """

        self._no_rollback_on_failure = no_rollback_on_failure

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


        :return: The rollback_of_rollout_number of this OrmModelServiceRolloutSpec.  # noqa: E501
        :rtype: int
        """
        return self._rollback_of_rollout_number

    @rollback_of_rollout_number.setter
    def rollback_of_rollout_number(self, rollback_of_rollout_number):
        """Sets the rollback_of_rollout_number of this OrmModelServiceRolloutSpec.


        :param rollback_of_rollout_number: The rollback_of_rollout_number of this OrmModelServiceRolloutSpec.  # noqa: E501
        :type rollback_of_rollout_number: int
        """

        self._rollback_of_rollout_number = rollback_of_rollout_number

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


        :return: The step_timeout_second of this OrmModelServiceRolloutSpec.  # noqa: E501
        :rtype: int
        """
        return self._step_timeout_second

    @step_timeout_second.setter
    def step_timeout_second(self, step_timeout_second):
        """Sets the step_timeout_second of this OrmModelServiceRolloutSpec.


        :param step_timeout_second: The step_timeout_second of this OrmModelServiceRolloutSpec.  # noqa: E501
        :type step_timeout_second: int
        """

        self._step_timeout_second = step_timeout_second

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


        :return: The steps of this OrmModelServiceRolloutSpec.  # noqa: E501
        :rtype: list[OrmModelServiceRolloutStepWrapper]
        """
        return self._steps

    @steps.setter
    def steps(self, steps):
        """Sets the steps of this OrmModelServiceRolloutSpec.


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

        self._steps = steps

    def to_dict(self, serialize=False):
        """Returns the model properties as a dict"""
        result = {}

        def convert(x):
            if hasattr(x, "to_dict"):
                args = getfullargspec(x.to_dict).args
                if len(args) == 1:
                    return x.to_dict()
                else:
                    return x.to_dict(serialize)
            else:
                return x

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            attr = self.attribute_map.get(attr, attr) if serialize else attr
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: convert(x),
                    value
                ))
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], convert(item[1])),
                    value.items()
                ))
            else:
                result[attr] = convert(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, OrmModelServiceRolloutSpec):
            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, OrmModelServiceRolloutSpec):
            return True

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