# coding: utf-8

"""
    herd

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

    OpenAPI spec version: 0.178.0-SNAPSHOT
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six


class EmrClusterDefinitionSpotSpecification(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 = {
        'timeout_duration_minutes': 'int',
        'timeout_action': 'str',
        'block_duration_minutes': 'int',
        'allocation_strategy': 'str'
    }

    attribute_map = {
        'timeout_duration_minutes': 'timeoutDurationMinutes',
        'timeout_action': 'timeoutAction',
        'block_duration_minutes': 'blockDurationMinutes',
        'allocation_strategy': 'allocationStrategy'
    }

    def __init__(self, timeout_duration_minutes=None, timeout_action=None, block_duration_minutes=None, allocation_strategy=None):  # noqa: E501
        """EmrClusterDefinitionSpotSpecification - a model defined in OpenAPI"""  # noqa: E501

        self._timeout_duration_minutes = None
        self._timeout_action = None
        self._block_duration_minutes = None
        self._allocation_strategy = None
        self.discriminator = None

        if timeout_duration_minutes is not None:
            self.timeout_duration_minutes = timeout_duration_minutes
        if timeout_action is not None:
            self.timeout_action = timeout_action
        if block_duration_minutes is not None:
            self.block_duration_minutes = block_duration_minutes
        if allocation_strategy is not None:
            self.allocation_strategy = allocation_strategy

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

        The spot provisioning timeout period in minutes. If Spot instances are not provisioned within this time period, the                   TimeOutAction is taken. Minimum value is 5 and maximum value is 1440. The timeout applies only during initial provisioning, when the cluster                   is first created                  # noqa: E501

        :return: The timeout_duration_minutes of this EmrClusterDefinitionSpotSpecification.  # noqa: E501
        :rtype: int
        """
        return self._timeout_duration_minutes

    @timeout_duration_minutes.setter
    def timeout_duration_minutes(self, timeout_duration_minutes):
        """Sets the timeout_duration_minutes of this EmrClusterDefinitionSpotSpecification.

        The spot provisioning timeout period in minutes. If Spot instances are not provisioned within this time period, the                   TimeOutAction is taken. Minimum value is 5 and maximum value is 1440. The timeout applies only during initial provisioning, when the cluster                   is first created                  # noqa: E501

        :param timeout_duration_minutes: The timeout_duration_minutes of this EmrClusterDefinitionSpotSpecification.  # noqa: E501
        :type: int
        """

        self._timeout_duration_minutes = timeout_duration_minutes

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

        The action to take when TargetSpotCapacity has not been fulfilled when the TimeoutDurationMinutes has expired. Spot instances                   are not uprovisioned within the Spot provisioining timeout. Valid values are TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND to fulfill the                   remaining capacity                  # noqa: E501

        :return: The timeout_action of this EmrClusterDefinitionSpotSpecification.  # noqa: E501
        :rtype: str
        """
        return self._timeout_action

    @timeout_action.setter
    def timeout_action(self, timeout_action):
        """Sets the timeout_action of this EmrClusterDefinitionSpotSpecification.

        The action to take when TargetSpotCapacity has not been fulfilled when the TimeoutDurationMinutes has expired. Spot instances                   are not uprovisioned within the Spot provisioining timeout. Valid values are TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND to fulfill the                   remaining capacity                  # noqa: E501

        :param timeout_action: The timeout_action of this EmrClusterDefinitionSpotSpecification.  # noqa: E501
        :type: str
        """

        self._timeout_action = timeout_action

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

        The defined duration for Spot instances (also known as Spot blocks) in minutes. When specified, the Spot instance does not                   terminate before the defined duration expires, and defined duration pricing for Spot instances applies. Valid values are 60, 120, 180, 240,                   300, or 360. The duration period starts as soon as a Spot instance receives its instance ID. At the end of the duration, Amazon EC2 marks the                   Spot instance for termination and provides a Spot instance termination notice, which gives the instance a two-minute warning before it                   terminates                  # noqa: E501

        :return: The block_duration_minutes of this EmrClusterDefinitionSpotSpecification.  # noqa: E501
        :rtype: int
        """
        return self._block_duration_minutes

    @block_duration_minutes.setter
    def block_duration_minutes(self, block_duration_minutes):
        """Sets the block_duration_minutes of this EmrClusterDefinitionSpotSpecification.

        The defined duration for Spot instances (also known as Spot blocks) in minutes. When specified, the Spot instance does not                   terminate before the defined duration expires, and defined duration pricing for Spot instances applies. Valid values are 60, 120, 180, 240,                   300, or 360. The duration period starts as soon as a Spot instance receives its instance ID. At the end of the duration, Amazon EC2 marks the                   Spot instance for termination and provides a Spot instance termination notice, which gives the instance a two-minute warning before it                   terminates                  # noqa: E501

        :param block_duration_minutes: The block_duration_minutes of this EmrClusterDefinitionSpotSpecification.  # noqa: E501
        :type: int
        """

        self._block_duration_minutes = block_duration_minutes

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

        Specifies the strategy to use in launching Spot instance fleets. Currently, the only option is \"capacity-optimized\" (the                   default), which launches instances from Spot instance pools with optimal capacity for the number of instances that are launching                  # noqa: E501

        :return: The allocation_strategy of this EmrClusterDefinitionSpotSpecification.  # noqa: E501
        :rtype: str
        """
        return self._allocation_strategy

    @allocation_strategy.setter
    def allocation_strategy(self, allocation_strategy):
        """Sets the allocation_strategy of this EmrClusterDefinitionSpotSpecification.

        Specifies the strategy to use in launching Spot instance fleets. Currently, the only option is \"capacity-optimized\" (the                   default), which launches instances from Spot instance pools with optimal capacity for the number of instances that are launching                  # noqa: E501

        :param allocation_strategy: The allocation_strategy of this EmrClusterDefinitionSpotSpecification.  # noqa: E501
        :type: str
        """

        self._allocation_strategy = allocation_strategy

    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, EmrClusterDefinitionSpotSpecification):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other
