# Path: os_vif/objects/base.py
# class VersionedObject(ovo_base.VersionedObject):
# class VersionedObjectPrintableMixin(object):
#     OBJ_PROJECT_NAMESPACE = 'os_vif'
#     def __str__(self):
# 
# Path: os_vif/objects/fields.py
# class VIFDirectMode(fields.Enum):
# class VIFDirectModeField(fields.BaseEnumField):
# class VIFVHostUserMode(fields.Enum):
# class VIFVHostUserModeField(fields.BaseEnumField):
# class ListOfIPAddressField(fields.AutoTypedField):
# class VIFHostDeviceDevType(fields.Enum):
# class VIFHostDeviceDevTypeField(fields.BaseEnumField):
#     VEPA = 'vepa'
#     PASSTHROUGH = 'passthrough'
#     BRIDGE = 'bridge'
#     ALL = (VEPA, PASSTHROUGH, BRIDGE)
#     AUTO_TYPE = VIFDirectMode()
#     CLIENT = "client"
#     SERVER = "server"
#     ALL = (CLIENT, SERVER)
#     AUTO_TYPE = VIFVHostUserMode()
#     AUTO_TYPE = fields.List(fields.IPAddress())
#     ETHERNET = 'ethernet'
#     GENERIC = 'generic'
#     ALL = (ETHERNET, GENERIC)
#     AUTO_TYPE = VIFHostDeviceDevType()
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):


from debtcollector import removals
from oslo_utils import versionutils
from oslo_versionedobjects import base
from oslo_versionedobjects import fields
from os_vif.objects import base as osv_base
from os_vif.objects import fields as osv_fields

    def obj_make_compatible(self, primitive, target_version):
        target_version = versionutils.convert_version_to_tuple(target_version)
        if target_version < (1, 1) and 'vif_name' in primitive:
            del primitive['vif_name']
        super(VIFVHostUser, self).obj_make_compatible(primitive, '1.0')


@base.VersionedObjectRegistry.register
class VIFHostDevice(VIFBase):
    """A hostdev-style VIF.

    Hostdev-style VIFs provide a guest with direct access to an :term:`SR-IOV`
    :term:`Virtual Function` (VF) or an entire :term:`Physical Function` (PF).
    Contrast this with :class:`~ovs_vif.objects.vif.VIFDirect`, which includes
    a software layer between the interface and the guest.

    For libvirt drivers, this maps to type='hostdev'
    """

    # Version 1.0: Initial release
    VERSION = '1.0'

    fields = {
        #: The type of the host device.
        #:
        #: Valid values are ``ethernet`` and ``generic``.
        #:
        #: - ``ethernet`` is ``<interface type='hostdev'>``
        #: - ``generic`` is ``<hostdev mode='subsystem' type='pci'>``

# Path: os_vif/objects/base.py
# class VersionedObject(ovo_base.VersionedObject):
# class VersionedObjectPrintableMixin(object):
#     OBJ_PROJECT_NAMESPACE = 'os_vif'
#     def __str__(self):
# 
# Path: os_vif/objects/fields.py
# class VIFDirectMode(fields.Enum):
# class VIFDirectModeField(fields.BaseEnumField):
# class VIFVHostUserMode(fields.Enum):
# class VIFVHostUserModeField(fields.BaseEnumField):
# class ListOfIPAddressField(fields.AutoTypedField):
# class VIFHostDeviceDevType(fields.Enum):
# class VIFHostDeviceDevTypeField(fields.BaseEnumField):
#     VEPA = 'vepa'
#     PASSTHROUGH = 'passthrough'
#     BRIDGE = 'bridge'
#     ALL = (VEPA, PASSTHROUGH, BRIDGE)
#     AUTO_TYPE = VIFDirectMode()
#     CLIENT = "client"
#     SERVER = "server"
#     ALL = (CLIENT, SERVER)
#     AUTO_TYPE = VIFVHostUserMode()
#     AUTO_TYPE = fields.List(fields.IPAddress())
#     ETHERNET = 'ethernet'
#     GENERIC = 'generic'
#     ALL = (ETHERNET, GENERIC)
#     AUTO_TYPE = VIFHostDeviceDevType()
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):


# Path: os_vif/objects/vif.py
from debtcollector import removals
from oslo_utils import versionutils
from oslo_versionedobjects import base
from oslo_versionedobjects import fields
from os_vif.objects import base as osv_base
from os_vif.objects import fields as osv_fields


    def obj_make_compatible(self, primitive, target_version):
        target_version = versionutils.convert_version_to_tuple(target_version)
        if target_version < (1, 1) and 'vif_name' in primitive:
            del primitive['vif_name']
        super(VIFVHostUser, self).obj_make_compatible(primitive, '1.0')


@base.VersionedObjectRegistry.register
class VIFHostDevice(VIFBase):
    """A hostdev-style VIF.

    Hostdev-style VIFs provide a guest with direct access to an :term:`SR-IOV`
    :term:`Virtual Function` (VF) or an entire :term:`Physical Function` (PF).
    Contrast this with :class:`~ovs_vif.objects.vif.VIFDirect`, which includes
    a software layer between the interface and the guest.

    For libvirt drivers, this maps to type='hostdev'
    """

    # Version 1.0: Initial release
    VERSION = '1.0'

    fields = {
        #: The type of the host device.
        #:
        #: Valid values are ``ethernet`` and ``generic``.
        #:
        #: - ``ethernet`` is ``<interface type='hostdev'>``
        #: - ``generic`` is ``<hostdev mode='subsystem' type='pci'>``

        'dev_type': osv_fields.VIFHostDeviceDevTypeField(),