# coding: utf-8

"""
    Kubernetes

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

    The version of the OpenAPI document: release-1.36
    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 kubernetes.client.configuration import Configuration


class V1alpha3PoolStatus(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 = {
        'allocated_devices': 'int',
        'available_devices': 'int',
        'driver': 'str',
        'generation': 'int',
        'node_name': 'str',
        'pool_name': 'str',
        'resource_slice_count': 'int',
        'total_devices': 'int',
        'unavailable_devices': 'int',
        'validation_error': 'str'
    }

    attribute_map = {
        'allocated_devices': 'allocatedDevices',
        'available_devices': 'availableDevices',
        'driver': 'driver',
        'generation': 'generation',
        'node_name': 'nodeName',
        'pool_name': 'poolName',
        'resource_slice_count': 'resourceSliceCount',
        'total_devices': 'totalDevices',
        'unavailable_devices': 'unavailableDevices',
        'validation_error': 'validationError'
    }

    def __init__(self, allocated_devices=None, available_devices=None, driver=None, generation=None, node_name=None, pool_name=None, resource_slice_count=None, total_devices=None, unavailable_devices=None, validation_error=None, local_vars_configuration=None):  # noqa: E501
        """V1alpha3PoolStatus - 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._allocated_devices = None
        self._available_devices = None
        self._driver = None
        self._generation = None
        self._node_name = None
        self._pool_name = None
        self._resource_slice_count = None
        self._total_devices = None
        self._unavailable_devices = None
        self._validation_error = None
        self.discriminator = None

        if allocated_devices is not None:
            self.allocated_devices = allocated_devices
        if available_devices is not None:
            self.available_devices = available_devices
        self.driver = driver
        self.generation = generation
        if node_name is not None:
            self.node_name = node_name
        self.pool_name = pool_name
        if resource_slice_count is not None:
            self.resource_slice_count = resource_slice_count
        if total_devices is not None:
            self.total_devices = total_devices
        if unavailable_devices is not None:
            self.unavailable_devices = unavailable_devices
        if validation_error is not None:
            self.validation_error = validation_error

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

        AllocatedDevices is the number of devices currently allocated to claims. A value of 0 means no devices are allocated. May be unset when validationError is set.  # noqa: E501

        :return: The allocated_devices of this V1alpha3PoolStatus.  # noqa: E501
        :rtype: int
        """
        return self._allocated_devices

    @allocated_devices.setter
    def allocated_devices(self, allocated_devices):
        """Sets the allocated_devices of this V1alpha3PoolStatus.

        AllocatedDevices is the number of devices currently allocated to claims. A value of 0 means no devices are allocated. May be unset when validationError is set.  # noqa: E501

        :param allocated_devices: The allocated_devices of this V1alpha3PoolStatus.  # noqa: E501
        :type allocated_devices: int
        """

        self._allocated_devices = allocated_devices

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

        AvailableDevices is the number of devices available for allocation. This equals TotalDevices - AllocatedDevices - UnavailableDevices. A value of 0 means no devices are currently available. May be unset when validationError is set.  # noqa: E501

        :return: The available_devices of this V1alpha3PoolStatus.  # noqa: E501
        :rtype: int
        """
        return self._available_devices

    @available_devices.setter
    def available_devices(self, available_devices):
        """Sets the available_devices of this V1alpha3PoolStatus.

        AvailableDevices is the number of devices available for allocation. This equals TotalDevices - AllocatedDevices - UnavailableDevices. A value of 0 means no devices are currently available. May be unset when validationError is set.  # noqa: E501

        :param available_devices: The available_devices of this V1alpha3PoolStatus.  # noqa: E501
        :type available_devices: int
        """

        self._available_devices = available_devices

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

        Driver is the DRA driver name for this pool. Must be a DNS subdomain (e.g., \"gpu.example.com\").  # noqa: E501

        :return: The driver of this V1alpha3PoolStatus.  # noqa: E501
        :rtype: str
        """
        return self._driver

    @driver.setter
    def driver(self, driver):
        """Sets the driver of this V1alpha3PoolStatus.

        Driver is the DRA driver name for this pool. Must be a DNS subdomain (e.g., \"gpu.example.com\").  # noqa: E501

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

        self._driver = driver

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

        Generation is the pool generation observed across all ResourceSlices in this pool. Only the latest generation is reported. During a generation rollout, if not all slices at the latest generation have been published, the pool is included with a validationError and device counts unset.  # noqa: E501

        :return: The generation of this V1alpha3PoolStatus.  # noqa: E501
        :rtype: int
        """
        return self._generation

    @generation.setter
    def generation(self, generation):
        """Sets the generation of this V1alpha3PoolStatus.

        Generation is the pool generation observed across all ResourceSlices in this pool. Only the latest generation is reported. During a generation rollout, if not all slices at the latest generation have been published, the pool is included with a validationError and device counts unset.  # noqa: E501

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

        self._generation = generation

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

        NodeName is the node this pool is associated with. When omitted, the pool is not associated with a specific node. Must be a valid DNS subdomain name (RFC1123).  # noqa: E501

        :return: The node_name of this V1alpha3PoolStatus.  # noqa: E501
        :rtype: str
        """
        return self._node_name

    @node_name.setter
    def node_name(self, node_name):
        """Sets the node_name of this V1alpha3PoolStatus.

        NodeName is the node this pool is associated with. When omitted, the pool is not associated with a specific node. Must be a valid DNS subdomain name (RFC1123).  # noqa: E501

        :param node_name: The node_name of this V1alpha3PoolStatus.  # noqa: E501
        :type node_name: str
        """

        self._node_name = node_name

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

        PoolName is the name of the pool. Must be a valid resource pool name (DNS subdomains separated by \"/\").  # noqa: E501

        :return: The pool_name of this V1alpha3PoolStatus.  # noqa: E501
        :rtype: str
        """
        return self._pool_name

    @pool_name.setter
    def pool_name(self, pool_name):
        """Sets the pool_name of this V1alpha3PoolStatus.

        PoolName is the name of the pool. Must be a valid resource pool name (DNS subdomains separated by \"/\").  # noqa: E501

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

        self._pool_name = pool_name

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

        ResourceSliceCount is the number of ResourceSlices that make up this pool. May be unset when validationError is set.  # noqa: E501

        :return: The resource_slice_count of this V1alpha3PoolStatus.  # noqa: E501
        :rtype: int
        """
        return self._resource_slice_count

    @resource_slice_count.setter
    def resource_slice_count(self, resource_slice_count):
        """Sets the resource_slice_count of this V1alpha3PoolStatus.

        ResourceSliceCount is the number of ResourceSlices that make up this pool. May be unset when validationError is set.  # noqa: E501

        :param resource_slice_count: The resource_slice_count of this V1alpha3PoolStatus.  # noqa: E501
        :type resource_slice_count: int
        """

        self._resource_slice_count = resource_slice_count

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

        TotalDevices is the total number of devices in the pool across all slices. A value of 0 means the pool has no devices. May be unset when validationError is set.  # noqa: E501

        :return: The total_devices of this V1alpha3PoolStatus.  # noqa: E501
        :rtype: int
        """
        return self._total_devices

    @total_devices.setter
    def total_devices(self, total_devices):
        """Sets the total_devices of this V1alpha3PoolStatus.

        TotalDevices is the total number of devices in the pool across all slices. A value of 0 means the pool has no devices. May be unset when validationError is set.  # noqa: E501

        :param total_devices: The total_devices of this V1alpha3PoolStatus.  # noqa: E501
        :type total_devices: int
        """

        self._total_devices = total_devices

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

        UnavailableDevices is the number of devices that are not available due to taints or other conditions, but are not allocated. A value of 0 means all unallocated devices are available. May be unset when validationError is set.  # noqa: E501

        :return: The unavailable_devices of this V1alpha3PoolStatus.  # noqa: E501
        :rtype: int
        """
        return self._unavailable_devices

    @unavailable_devices.setter
    def unavailable_devices(self, unavailable_devices):
        """Sets the unavailable_devices of this V1alpha3PoolStatus.

        UnavailableDevices is the number of devices that are not available due to taints or other conditions, but are not allocated. A value of 0 means all unallocated devices are available. May be unset when validationError is set.  # noqa: E501

        :param unavailable_devices: The unavailable_devices of this V1alpha3PoolStatus.  # noqa: E501
        :type unavailable_devices: int
        """

        self._unavailable_devices = unavailable_devices

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

        ValidationError is set when the pool's data could not be fully validated (e.g., incomplete slice publication). When set, device count fields and ResourceSliceCount may be unset.  # noqa: E501

        :return: The validation_error of this V1alpha3PoolStatus.  # noqa: E501
        :rtype: str
        """
        return self._validation_error

    @validation_error.setter
    def validation_error(self, validation_error):
        """Sets the validation_error of this V1alpha3PoolStatus.

        ValidationError is set when the pool's data could not be fully validated (e.g., incomplete slice publication). When set, device count fields and ResourceSliceCount may be unset.  # noqa: E501

        :param validation_error: The validation_error of this V1alpha3PoolStatus.  # noqa: E501
        :type validation_error: str
        """

        self._validation_error = validation_error

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

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