# coding: utf-8

"""
    KubeVirt API

    This is KubeVirt API an add-on for Kubernetes.  # noqa: E501

    OpenAPI spec version: 1.0.0
    Contact: kubevirt-dev@googlegroups.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from kubevirt.configuration import Configuration


class V1PciHostDevice(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_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.
    """
    swagger_types = {
        'external_resource_provider': 'bool',
        'pci_vendor_selector': 'str',
        'resource_name': 'str'
    }

    attribute_map = {
        'external_resource_provider': 'externalResourceProvider',
        'pci_vendor_selector': 'pciVendorSelector',
        'resource_name': 'resourceName'
    }

    def __init__(self, external_resource_provider=None, pci_vendor_selector='', resource_name='', _configuration=None):  # noqa: E501
        """V1PciHostDevice - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._external_resource_provider = None
        self._pci_vendor_selector = None
        self._resource_name = None
        self.discriminator = None

        if external_resource_provider is not None:
            self.external_resource_provider = external_resource_provider
        self.pci_vendor_selector = pci_vendor_selector
        self.resource_name = resource_name

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

        If true, KubeVirt will leave the allocation and monitoring to an external device plugin  # noqa: E501

        :return: The external_resource_provider of this V1PciHostDevice.  # noqa: E501
        :rtype: bool
        """
        return self._external_resource_provider

    @external_resource_provider.setter
    def external_resource_provider(self, external_resource_provider):
        """Sets the external_resource_provider of this V1PciHostDevice.

        If true, KubeVirt will leave the allocation and monitoring to an external device plugin  # noqa: E501

        :param external_resource_provider: The external_resource_provider of this V1PciHostDevice.  # noqa: E501
        :type: bool
        """

        self._external_resource_provider = external_resource_provider

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

        The vendor_id:product_id tuple of the PCI device  # noqa: E501

        :return: The pci_vendor_selector of this V1PciHostDevice.  # noqa: E501
        :rtype: str
        """
        return self._pci_vendor_selector

    @pci_vendor_selector.setter
    def pci_vendor_selector(self, pci_vendor_selector):
        """Sets the pci_vendor_selector of this V1PciHostDevice.

        The vendor_id:product_id tuple of the PCI device  # noqa: E501

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

        self._pci_vendor_selector = pci_vendor_selector

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

        The name of the resource that is representing the device. Exposed by a device plugin and requested by VMs. Typically of the form vendor.com/product_name  # noqa: E501

        :return: The resource_name of this V1PciHostDevice.  # noqa: E501
        :rtype: str
        """
        return self._resource_name

    @resource_name.setter
    def resource_name(self, resource_name):
        """Sets the resource_name of this V1PciHostDevice.

        The name of the resource that is representing the device. Exposed by a device plugin and requested by VMs. Typically of the form vendor.com/product_name  # noqa: E501

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

        self._resource_name = resource_name

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_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
        if issubclass(V1PciHostDevice, dict):
            for key, value in self.items():
                result[key] = 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, V1PciHostDevice):
            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, V1PciHostDevice):
            return True

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