# coding: utf-8

"""
    Anyscale 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 anyscale_client.configuration import Configuration


class ComputeNodeType(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_type': 'str',
        'resources': 'Resources',
        'physical_resources': 'PhysicalResources',
        'required_resources': 'PhysicalResources',
        'labels': 'dict(str, str)',
        'required_labels': 'dict(str, str)',
        'aws_advanced_configurations_json': 'object',
        'gcp_advanced_configurations_json': 'object',
        'advanced_configurations_json': 'object',
        'flags': 'object'
    }

    attribute_map = {
        'name': 'name',
        'instance_type': 'instance_type',
        'resources': 'resources',
        'physical_resources': 'physical_resources',
        'required_resources': 'required_resources',
        'labels': 'labels',
        'required_labels': 'required_labels',
        'aws_advanced_configurations_json': 'aws_advanced_configurations_json',
        'gcp_advanced_configurations_json': 'gcp_advanced_configurations_json',
        'advanced_configurations_json': 'advanced_configurations_json',
        'flags': 'flags'
    }

    def __init__(self, name=None, instance_type=None, resources=None, physical_resources=None, required_resources=None, labels=None, required_labels=None, aws_advanced_configurations_json=None, gcp_advanced_configurations_json=None, advanced_configurations_json=None, flags=None, local_vars_configuration=None):  # noqa: E501
        """ComputeNodeType - 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._name = None
        self._instance_type = None
        self._resources = None
        self._physical_resources = None
        self._required_resources = None
        self._labels = None
        self._required_labels = None
        self._aws_advanced_configurations_json = None
        self._gcp_advanced_configurations_json = None
        self._advanced_configurations_json = None
        self._flags = None
        self.discriminator = None

        self.name = name
        if instance_type is not None:
            self.instance_type = instance_type
        if resources is not None:
            self.resources = resources
        if physical_resources is not None:
            self.physical_resources = physical_resources
        if required_resources is not None:
            self.required_resources = required_resources
        if labels is not None:
            self.labels = labels
        if required_labels is not None:
            self.required_labels = required_labels
        if aws_advanced_configurations_json is not None:
            self.aws_advanced_configurations_json = aws_advanced_configurations_json
        if gcp_advanced_configurations_json is not None:
            self.gcp_advanced_configurations_json = gcp_advanced_configurations_json
        if advanced_configurations_json is not None:
            self.advanced_configurations_json = advanced_configurations_json
        if flags is not None:
            self.flags = flags

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

        An arbitrary name for this node type, which will be registered with OSS available_node_types.   # noqa: E501

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

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

        An arbitrary name for this node type, which will be registered with OSS available_node_types.   # noqa: E501

        :param name: The name of this ComputeNodeType.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and name is None:  # noqa: E501
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501

        self._name = name

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

        The cloud provider instance type to use for this node. Optional when using free pod shapes with required_resources.  # noqa: E501

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

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

        The cloud provider instance type to use for this node. Optional when using free pod shapes with required_resources.  # noqa: E501

        :param instance_type: The instance_type of this ComputeNodeType.  # noqa: E501
        :type: str
        """

        self._instance_type = instance_type

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

        Declaration of node resources for Autoscaler.  # noqa: E501

        :return: The resources of this ComputeNodeType.  # noqa: E501
        :rtype: Resources
        """
        return self._resources

    @resources.setter
    def resources(self, resources):
        """Sets the resources of this ComputeNodeType.

        Declaration of node resources for Autoscaler.  # noqa: E501

        :param resources: The resources of this ComputeNodeType.  # noqa: E501
        :type: Resources
        """

        self._resources = resources

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

        DEPRECATED: This field is deprecated. Please use required_resources instead.  # noqa: E501

        :return: The physical_resources of this ComputeNodeType.  # noqa: E501
        :rtype: PhysicalResources
        """
        return self._physical_resources

    @physical_resources.setter
    def physical_resources(self, physical_resources):
        """Sets the physical_resources of this ComputeNodeType.

        DEPRECATED: This field is deprecated. Please use required_resources instead.  # noqa: E501

        :param physical_resources: The physical_resources of this ComputeNodeType.  # noqa: E501
        :type: PhysicalResources
        """

        self._physical_resources = physical_resources

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

        Required resources for compute node type which specifies the actual CPU, memory, and GPU resources that should be allocated for this node type.  # noqa: E501

        :return: The required_resources of this ComputeNodeType.  # noqa: E501
        :rtype: PhysicalResources
        """
        return self._required_resources

    @required_resources.setter
    def required_resources(self, required_resources):
        """Sets the required_resources of this ComputeNodeType.

        Required resources for compute node type which specifies the actual CPU, memory, and GPU resources that should be allocated for this node type.  # noqa: E501

        :param required_resources: The required_resources of this ComputeNodeType.  # noqa: E501
        :type: PhysicalResources
        """

        self._required_resources = required_resources

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

        Labels to associate the node with for scheduling purposes. Defaults to the list of Ray & Anyscale default labels.  # noqa: E501

        :return: The labels of this ComputeNodeType.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._labels

    @labels.setter
    def labels(self, labels):
        """Sets the labels of this ComputeNodeType.

        Labels to associate the node with for scheduling purposes. Defaults to the list of Ray & Anyscale default labels.  # noqa: E501

        :param labels: The labels of this ComputeNodeType.  # noqa: E501
        :type: dict(str, str)
        """

        self._labels = labels

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

        Required labels that must be present on the node for scheduling purposes.  # noqa: E501

        :return: The required_labels of this ComputeNodeType.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._required_labels

    @required_labels.setter
    def required_labels(self, required_labels):
        """Sets the required_labels of this ComputeNodeType.

        Required labels that must be present on the node for scheduling purposes.  # noqa: E501

        :param required_labels: The required_labels of this ComputeNodeType.  # noqa: E501
        :type: dict(str, str)
        """

        self._required_labels = required_labels

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

        The advanced configuration json that we pass directly AWS APIs when launching an instance. We may do some validation on this json and reject the json if it is using a configuration that Anyscale does not support.  # noqa: E501

        :return: The aws_advanced_configurations_json of this ComputeNodeType.  # noqa: E501
        :rtype: object
        """
        return self._aws_advanced_configurations_json

    @aws_advanced_configurations_json.setter
    def aws_advanced_configurations_json(self, aws_advanced_configurations_json):
        """Sets the aws_advanced_configurations_json of this ComputeNodeType.

        The advanced configuration json that we pass directly AWS APIs when launching an instance. We may do some validation on this json and reject the json if it is using a configuration that Anyscale does not support.  # noqa: E501

        :param aws_advanced_configurations_json: The aws_advanced_configurations_json of this ComputeNodeType.  # noqa: E501
        :type: object
        """

        self._aws_advanced_configurations_json = aws_advanced_configurations_json

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

        The advanced configuration json that we pass directly GCP APIs when launching an instance. We may do some validation on this json and reject the json if it is using a configuration that Anyscale does not support.  # noqa: E501

        :return: The gcp_advanced_configurations_json of this ComputeNodeType.  # noqa: E501
        :rtype: object
        """
        return self._gcp_advanced_configurations_json

    @gcp_advanced_configurations_json.setter
    def gcp_advanced_configurations_json(self, gcp_advanced_configurations_json):
        """Sets the gcp_advanced_configurations_json of this ComputeNodeType.

        The advanced configuration json that we pass directly GCP APIs when launching an instance. We may do some validation on this json and reject the json if it is using a configuration that Anyscale does not support.  # noqa: E501

        :param gcp_advanced_configurations_json: The gcp_advanced_configurations_json of this ComputeNodeType.  # noqa: E501
        :type: object
        """

        self._gcp_advanced_configurations_json = gcp_advanced_configurations_json

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

        Advanced configurations for this compute node type to pass to the cloud provider when launching this instance.  # noqa: E501

        :return: The advanced_configurations_json of this ComputeNodeType.  # noqa: E501
        :rtype: object
        """
        return self._advanced_configurations_json

    @advanced_configurations_json.setter
    def advanced_configurations_json(self, advanced_configurations_json):
        """Sets the advanced_configurations_json of this ComputeNodeType.

        Advanced configurations for this compute node type to pass to the cloud provider when launching this instance.  # noqa: E501

        :param advanced_configurations_json: The advanced_configurations_json of this ComputeNodeType.  # noqa: E501
        :type: object
        """

        self._advanced_configurations_json = advanced_configurations_json

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

        A set of advanced node-level flags that can be used to configure a particular workload.  # noqa: E501

        :return: The flags of this ComputeNodeType.  # noqa: E501
        :rtype: object
        """
        return self._flags

    @flags.setter
    def flags(self, flags):
        """Sets the flags of this ComputeNodeType.

        A set of advanced node-level flags that can be used to configure a particular workload.  # noqa: E501

        :param flags: The flags of this ComputeNodeType.  # noqa: E501
        :type: object
        """

        self._flags = flags

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

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