# 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 MasterInstanceDefinition(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 = {
        'instance_count': 'int',
        'instance_type': 'str',
        'ebs_configuration': 'EmrClusterDefinitionEbsConfiguration',
        'instance_spot_price': 'float',
        'instance_max_search_price': 'float',
        'instance_on_demand_threshold': 'float'
    }

    attribute_map = {
        'instance_count': 'instanceCount',
        'instance_type': 'instanceType',
        'ebs_configuration': 'ebsConfiguration',
        'instance_spot_price': 'instanceSpotPrice',
        'instance_max_search_price': 'instanceMaxSearchPrice',
        'instance_on_demand_threshold': 'instanceOnDemandThreshold'
    }

    def __init__(self, instance_count=None, instance_type=None, ebs_configuration=None, instance_spot_price=None, instance_max_search_price=None, instance_on_demand_threshold=None):  # noqa: E501
        """MasterInstanceDefinition - a model defined in OpenAPI"""  # noqa: E501

        self._instance_count = None
        self._instance_type = None
        self._ebs_configuration = None
        self._instance_spot_price = None
        self._instance_max_search_price = None
        self._instance_on_demand_threshold = None
        self.discriminator = None

        if instance_count is not None:
            self.instance_count = instance_count
        self.instance_type = instance_type
        if ebs_configuration is not None:
            self.ebs_configuration = ebs_configuration
        if instance_spot_price is not None:
            self.instance_spot_price = instance_spot_price
        if instance_max_search_price is not None:
            self.instance_max_search_price = instance_max_search_price
        if instance_on_demand_threshold is not None:
            self.instance_on_demand_threshold = instance_on_demand_threshold

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


        :return: The instance_count of this MasterInstanceDefinition.  # noqa: E501
        :rtype: int
        """
        return self._instance_count

    @instance_count.setter
    def instance_count(self, instance_count):
        """Sets the instance_count of this MasterInstanceDefinition.


        :param instance_count: The instance_count of this MasterInstanceDefinition.  # noqa: E501
        :type: int
        """

        self._instance_count = instance_count

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


        :return: The instance_type of this MasterInstanceDefinition.  # noqa: E501
        :rtype: str
        """
        return self._instance_type

    @instance_type.setter
    def instance_type(self, instance_type):
        """Sets the instance_type of this MasterInstanceDefinition.


        :param instance_type: The instance_type of this MasterInstanceDefinition.  # noqa: E501
        :type: str
        """
        if instance_type is None:
            raise ValueError("Invalid value for `instance_type`, must not be `None`")  # noqa: E501

        self._instance_type = instance_type

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


        :return: The ebs_configuration of this MasterInstanceDefinition.  # noqa: E501
        :rtype: EmrClusterDefinitionEbsConfiguration
        """
        return self._ebs_configuration

    @ebs_configuration.setter
    def ebs_configuration(self, ebs_configuration):
        """Sets the ebs_configuration of this MasterInstanceDefinition.


        :param ebs_configuration: The ebs_configuration of this MasterInstanceDefinition.  # noqa: E501
        :type: EmrClusterDefinitionEbsConfiguration
        """

        self._ebs_configuration = ebs_configuration

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

        The instance bid price, in USD. If not specified, uses on-demand  # noqa: E501

        :return: The instance_spot_price of this MasterInstanceDefinition.  # noqa: E501
        :rtype: float
        """
        return self._instance_spot_price

    @instance_spot_price.setter
    def instance_spot_price(self, instance_spot_price):
        """Sets the instance_spot_price of this MasterInstanceDefinition.

        The instance bid price, in USD. If not specified, uses on-demand  # noqa: E501

        :param instance_spot_price: The instance_spot_price of this MasterInstanceDefinition.  # noqa: E501
        :type: float
        """

        self._instance_spot_price = instance_spot_price

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

        The maximum amount, in USD, to search for the best price. The best price search will only search for prices lower than this                   value. If a spot instance is selected by the search, this value will be the bid price                  # noqa: E501

        :return: The instance_max_search_price of this MasterInstanceDefinition.  # noqa: E501
        :rtype: float
        """
        return self._instance_max_search_price

    @instance_max_search_price.setter
    def instance_max_search_price(self, instance_max_search_price):
        """Sets the instance_max_search_price of this MasterInstanceDefinition.

        The maximum amount, in USD, to search for the best price. The best price search will only search for prices lower than this                   value. If a spot instance is selected by the search, this value will be the bid price                  # noqa: E501

        :param instance_max_search_price: The instance_max_search_price of this MasterInstanceDefinition.  # noqa: E501
        :type: float
        """

        self._instance_max_search_price = instance_max_search_price

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

        <p>The amount, in USD, you are willing to pay over the lowest spot price for an on-demand instance. Use this to                   dynamically balance the cost vs. stability of your instances.</p>                   <p>If not specified, the search will not attempt to find an on-demand instance when a spot is found. This is the same behavior as when                   this parameter is set to $0.</p>                  # noqa: E501

        :return: The instance_on_demand_threshold of this MasterInstanceDefinition.  # noqa: E501
        :rtype: float
        """
        return self._instance_on_demand_threshold

    @instance_on_demand_threshold.setter
    def instance_on_demand_threshold(self, instance_on_demand_threshold):
        """Sets the instance_on_demand_threshold of this MasterInstanceDefinition.

        <p>The amount, in USD, you are willing to pay over the lowest spot price for an on-demand instance. Use this to                   dynamically balance the cost vs. stability of your instances.</p>                   <p>If not specified, the search will not attempt to find an on-demand instance when a spot is found. This is the same behavior as when                   this parameter is set to $0.</p>                  # noqa: E501

        :param instance_on_demand_threshold: The instance_on_demand_threshold of this MasterInstanceDefinition.  # noqa: E501
        :type: float
        """

        self._instance_on_demand_threshold = instance_on_demand_threshold

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

        return self.__dict__ == other.__dict__

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