# 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 EmrClusterDefinitionInstanceFleet(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 = {
        'name': 'str',
        'instance_fleet_type': 'str',
        'target_on_demand_capacity': 'int',
        'target_spot_capacity': 'int',
        'instance_type_configs': 'list[EmrClusterDefinitionInstanceTypeConfig]',
        'launch_specifications': 'EmrClusterDefinitionLaunchSpecifications'
    }

    attribute_map = {
        'name': 'name',
        'instance_fleet_type': 'instanceFleetType',
        'target_on_demand_capacity': 'targetOnDemandCapacity',
        'target_spot_capacity': 'targetSpotCapacity',
        'instance_type_configs': 'instanceTypeConfigs',
        'launch_specifications': 'launchSpecifications'
    }

    def __init__(self, name=None, instance_fleet_type=None, target_on_demand_capacity=None, target_spot_capacity=None, instance_type_configs=None, launch_specifications=None):  # noqa: E501
        """EmrClusterDefinitionInstanceFleet - a model defined in OpenAPI"""  # noqa: E501

        self._name = None
        self._instance_fleet_type = None
        self._target_on_demand_capacity = None
        self._target_spot_capacity = None
        self._instance_type_configs = None
        self._launch_specifications = None
        self.discriminator = None

        if name is not None:
            self.name = name
        if instance_fleet_type is not None:
            self.instance_fleet_type = instance_fleet_type
        if target_on_demand_capacity is not None:
            self.target_on_demand_capacity = target_on_demand_capacity
        if target_spot_capacity is not None:
            self.target_spot_capacity = target_spot_capacity
        if instance_type_configs is not None:
            self.instance_type_configs = instance_type_configs
        if launch_specifications is not None:
            self.launch_specifications = launch_specifications

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

        The friendly name of the instance fleet  # noqa: E501

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

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

        The friendly name of the instance fleet  # noqa: E501

        :param name: The name of this EmrClusterDefinitionInstanceFleet.  # noqa: E501
        :type: str
        """

        self._name = name

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

        The node type that the instance fleet hosts. Valid values are MASTER,CORE,and TASK  # noqa: E501

        :return: The instance_fleet_type of this EmrClusterDefinitionInstanceFleet.  # noqa: E501
        :rtype: str
        """
        return self._instance_fleet_type

    @instance_fleet_type.setter
    def instance_fleet_type(self, instance_fleet_type):
        """Sets the instance_fleet_type of this EmrClusterDefinitionInstanceFleet.

        The node type that the instance fleet hosts. Valid values are MASTER,CORE,and TASK  # noqa: E501

        :param instance_fleet_type: The instance_fleet_type of this EmrClusterDefinitionInstanceFleet.  # noqa: E501
        :type: str
        """

        self._instance_fleet_type = instance_fleet_type

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

        The target capacity of On-Demand units for the instance fleet, which determines how many On-Demand instances to provision. When                   the instance fleet launches, Amazon EMR tries to provision On-Demand instances as specified by InstanceTypeConfig. Each instance configuration                   has a specified WeightedCapacity. When an On-Demand instance is provisioned, the WeightedCapacity units count toward the target capacity.                   Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are                   2 units remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is                   provisioned, and the target capacity is exceeded by 3 units.                   NOTE: If not specified or set to 0, only Spot instances are provisioned for the instance fleet using TargetSpotCapacity. At least one of                   TargetSpotCapacity and TargetOnDemandCapacity should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity and                   TargetOnDemandCapacity can be specified, and its value must be 1.                  # noqa: E501

        :return: The target_on_demand_capacity of this EmrClusterDefinitionInstanceFleet.  # noqa: E501
        :rtype: int
        """
        return self._target_on_demand_capacity

    @target_on_demand_capacity.setter
    def target_on_demand_capacity(self, target_on_demand_capacity):
        """Sets the target_on_demand_capacity of this EmrClusterDefinitionInstanceFleet.

        The target capacity of On-Demand units for the instance fleet, which determines how many On-Demand instances to provision. When                   the instance fleet launches, Amazon EMR tries to provision On-Demand instances as specified by InstanceTypeConfig. Each instance configuration                   has a specified WeightedCapacity. When an On-Demand instance is provisioned, the WeightedCapacity units count toward the target capacity.                   Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are                   2 units remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is                   provisioned, and the target capacity is exceeded by 3 units.                   NOTE: If not specified or set to 0, only Spot instances are provisioned for the instance fleet using TargetSpotCapacity. At least one of                   TargetSpotCapacity and TargetOnDemandCapacity should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity and                   TargetOnDemandCapacity can be specified, and its value must be 1.                  # noqa: E501

        :param target_on_demand_capacity: The target_on_demand_capacity of this EmrClusterDefinitionInstanceFleet.  # noqa: E501
        :type: int
        """

        self._target_on_demand_capacity = target_on_demand_capacity

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

        The target capacity of Spot units for the instance fleet, which determines how many Spot instances to provision. When the                   instance fleet launches, Amazon EMR tries to provision Spot instances as specified by InstanceTypeConfig. Each instance configuration has a                   specified WeightedCapacity. When a Spot instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR                   provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units                   remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned,                   and the target capacity is exceeded by 3 units.                   NOTE: If not specified or set to 0, only On-Demand instances are provisioned for the instance fleet. At least one of TargetSpotCapacity and                   TargetOnDemandCapacity should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be                   specified, and its value must be 1.                  # noqa: E501

        :return: The target_spot_capacity of this EmrClusterDefinitionInstanceFleet.  # noqa: E501
        :rtype: int
        """
        return self._target_spot_capacity

    @target_spot_capacity.setter
    def target_spot_capacity(self, target_spot_capacity):
        """Sets the target_spot_capacity of this EmrClusterDefinitionInstanceFleet.

        The target capacity of Spot units for the instance fleet, which determines how many Spot instances to provision. When the                   instance fleet launches, Amazon EMR tries to provision Spot instances as specified by InstanceTypeConfig. Each instance configuration has a                   specified WeightedCapacity. When a Spot instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR                   provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units                   remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned,                   and the target capacity is exceeded by 3 units.                   NOTE: If not specified or set to 0, only On-Demand instances are provisioned for the instance fleet. At least one of TargetSpotCapacity and                   TargetOnDemandCapacity should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be                   specified, and its value must be 1.                  # noqa: E501

        :param target_spot_capacity: The target_spot_capacity of this EmrClusterDefinitionInstanceFleet.  # noqa: E501
        :type: int
        """

        self._target_spot_capacity = target_spot_capacity

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

        The instance type configurations that define the EC2 instances in the instance fleet  # noqa: E501

        :return: The instance_type_configs of this EmrClusterDefinitionInstanceFleet.  # noqa: E501
        :rtype: list[EmrClusterDefinitionInstanceTypeConfig]
        """
        return self._instance_type_configs

    @instance_type_configs.setter
    def instance_type_configs(self, instance_type_configs):
        """Sets the instance_type_configs of this EmrClusterDefinitionInstanceFleet.

        The instance type configurations that define the EC2 instances in the instance fleet  # noqa: E501

        :param instance_type_configs: The instance_type_configs of this EmrClusterDefinitionInstanceFleet.  # noqa: E501
        :type: list[EmrClusterDefinitionInstanceTypeConfig]
        """

        self._instance_type_configs = instance_type_configs

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


        :return: The launch_specifications of this EmrClusterDefinitionInstanceFleet.  # noqa: E501
        :rtype: EmrClusterDefinitionLaunchSpecifications
        """
        return self._launch_specifications

    @launch_specifications.setter
    def launch_specifications(self, launch_specifications):
        """Sets the launch_specifications of this EmrClusterDefinitionInstanceFleet.


        :param launch_specifications: The launch_specifications of this EmrClusterDefinitionInstanceFleet.  # noqa: E501
        :type: EmrClusterDefinitionLaunchSpecifications
        """

        self._launch_specifications = launch_specifications

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

        return self.__dict__ == other.__dict__

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