
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from decimal import Decimal
from bitarray import bitarray
import __builtin__
import sfp
import on_board
import gbc
import xfp
import xff
import xfpe
import unknown
import qsfp
import qsfpp
import cfp
import qsfp28
import cfp2
class interface(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-interface-ext - based on the path /brocade_interface_ext_rpc/get-media-detail/output/interface. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: A list of interface entries. Each row represents
management information applicable to a particular 
interface.
  """
  __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__interface_type','__interface_name','__sfp','__on_board','__gbc','__xfp','__xff','__xfpe','__unknown','__qsfp','__qsfpp','__cfp','__qsfp28','__cfp2',)

  _yang_name = 'interface'
  _rest_name = 'interface'

  _pybind_generated_by = 'container'

  def __init__(self, *args, **kwargs):

    path_helper_ = kwargs.pop("path_helper", None)
    if path_helper_ is False:
      self._path_helper = False
    elif path_helper_ is not None and isinstance(path_helper_, xpathhelper.YANGPathHelper):
      self._path_helper = path_helper_
    elif hasattr(self, "_parent"):
      path_helper_ = getattr(self._parent, "_path_helper", False)
      self._path_helper = path_helper_
    else:
      self._path_helper = False

    extmethods = kwargs.pop("extmethods", None)
    if extmethods is False:
      self._extmethods = False
    elif extmethods is not None and isinstance(extmethods, dict):
      self._extmethods = extmethods
    elif hasattr(self, "_parent"):
      extmethods = getattr(self._parent, "_extmethods", None)
      self._extmethods = extmethods
    else:
      self._extmethods = False
    self.__cfp2 = YANGDynClass(base=cfp2.cfp2, is_container='container', presence=False, yang_name="cfp2", rest_name="cfp2", parent=self, choice=(u'interface-identifier', u'cfp2'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    self.__qsfp28 = YANGDynClass(base=qsfp28.qsfp28, is_container='container', presence=False, yang_name="qsfp28", rest_name="qsfp28", parent=self, choice=(u'interface-identifier', u'qsfp28'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    self.__gbc = YANGDynClass(base=gbc.gbc, is_container='container', presence=False, yang_name="gbc", rest_name="gbc", parent=self, choice=(u'interface-identifier', u'gbic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    self.__qsfp = YANGDynClass(base=qsfp.qsfp, is_container='container', presence=False, yang_name="qsfp", rest_name="qsfp", parent=self, choice=(u'interface-identifier', u'qsfp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    self.__unknown = YANGDynClass(base=unknown.unknown, is_container='container', presence=False, yang_name="unknown", rest_name="unknown", parent=self, choice=(u'interface-identifier', u'unknown'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    self.__interface_type = YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u've': {'value': 8}, u'loopback': {'value': 7}, u'tunnel': {'value': 12}, u'unknown': {'value': 1}, u'port-channel': {'value': 5}, u'fibrechannel': {'value': 11}, u'ethernet': {'value': 10}, u'l2vlan': {'value': 6}},), is_leaf=True, yang_name="interface-type", rest_name="interface-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions={u'tailf-common': {u'info': u"The type of the interface. An 'unknown' type \nrepresents error scenario and should not be used."}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='enumeration', is_config=True)
    self.__on_board = YANGDynClass(base=on_board.on_board, is_container='container', presence=False, yang_name="on-board", rest_name="on-board", parent=self, choice=(u'interface-identifier', u'on-board'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    self.__xff = YANGDynClass(base=xff.xff, is_container='container', presence=False, yang_name="xff", rest_name="xff", parent=self, choice=(u'interface-identifier', u'xff'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    self.__xfpe = YANGDynClass(base=xfpe.xfpe, is_container='container', presence=False, yang_name="xfpe", rest_name="xfpe", parent=self, choice=(u'interface-identifier', u'xfpe'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    self.__sfp = YANGDynClass(base=sfp.sfp, is_container='container', presence=False, yang_name="sfp", rest_name="sfp", parent=self, choice=(u'interface-identifier', u'sfp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    self.__xfp = YANGDynClass(base=xfp.xfp, is_container='container', presence=False, yang_name="xfp", rest_name="xfp", parent=self, choice=(u'interface-identifier', u'xfp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    self.__interface_name = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((([0-9]|[1][0-6]))/([1-9]|[1-9][0-9]|[1-9][0-9][0-9])(:[1-4])?)', 'length': [u'3..16']}),RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..1024']}),RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..4090']}),], is_leaf=True, yang_name="interface-name", rest_name="interface-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions={u'tailf-common': {u'info': u'The Interface value.'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='union', is_config=True)
    self.__qsfpp = YANGDynClass(base=qsfpp.qsfpp, is_container='container', presence=False, yang_name="qsfpp", rest_name="qsfpp", parent=self, choice=(u'interface-identifier', u'qsfpp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    self.__cfp = YANGDynClass(base=cfp.cfp, is_container='container', presence=False, yang_name="cfp", rest_name="cfp", parent=self, choice=(u'interface-identifier', u'cfp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)

    load = kwargs.pop("load", None)
    if args:
      if len(args) > 1:
        raise TypeError("cannot create a YANG container with >1 argument")
      all_attr = True
      for e in self._pyangbind_elements:
        if not hasattr(args[0], e):
          all_attr = False
          break
      if not all_attr:
        raise ValueError("Supplied object did not have the correct attributes")
      for e in self._pyangbind_elements:
        nobj = getattr(args[0], e)
        if nobj._changed() is False:
          continue
        setmethod = getattr(self, "_set_%s" % e)
        if load is None:
          setmethod(getattr(args[0], e))
        else:
          setmethod(getattr(args[0], e), load=load)

  def _path(self):
    if hasattr(self, "_parent"):
      return self._parent._path()+[self._yang_name]
    else:
      return [u'brocade_interface_ext_rpc', u'get-media-detail', u'output', u'interface']

  def _rest_path(self):
    if hasattr(self, "_parent"):
      if self._rest_name:
        return self._parent._rest_path()+[self._rest_name]
      else:
        return self._parent._rest_path()
    else:
      return [u'get-media-detail', u'output', u'interface']

  def _get_interface_type(self):
    """
    Getter method for interface_type, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/interface_type (enumeration)

    YANG Description: The type of the interface. An 'unknown' type 
represents error scenario and should not be used.
    """
    return self.__interface_type
      
  def _set_interface_type(self, v, load=False):
    """
    Setter method for interface_type, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/interface_type (enumeration)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_interface_type is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_interface_type() directly.

    YANG Description: The type of the interface. An 'unknown' type 
represents error scenario and should not be used.
    """
    parent = getattr(self, "_parent", None)
    if parent is not None and load is False:
      raise AttributeError("Cannot set keys directly when" +
                             " within an instantiated list")

    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u've': {'value': 8}, u'loopback': {'value': 7}, u'tunnel': {'value': 12}, u'unknown': {'value': 1}, u'port-channel': {'value': 5}, u'fibrechannel': {'value': 11}, u'ethernet': {'value': 10}, u'l2vlan': {'value': 6}},), is_leaf=True, yang_name="interface-type", rest_name="interface-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions={u'tailf-common': {u'info': u"The type of the interface. An 'unknown' type \nrepresents error scenario and should not be used."}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='enumeration', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """interface_type must be of a type compatible with enumeration""",
          'defined-type': "brocade-interface-ext:enumeration",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u've': {'value': 8}, u'loopback': {'value': 7}, u'tunnel': {'value': 12}, u'unknown': {'value': 1}, u'port-channel': {'value': 5}, u'fibrechannel': {'value': 11}, u'ethernet': {'value': 10}, u'l2vlan': {'value': 6}},), is_leaf=True, yang_name="interface-type", rest_name="interface-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions={u'tailf-common': {u'info': u"The type of the interface. An 'unknown' type \nrepresents error scenario and should not be used."}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='enumeration', is_config=True)""",
        })

    self.__interface_type = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_interface_type(self):
    self.__interface_type = YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u've': {'value': 8}, u'loopback': {'value': 7}, u'tunnel': {'value': 12}, u'unknown': {'value': 1}, u'port-channel': {'value': 5}, u'fibrechannel': {'value': 11}, u'ethernet': {'value': 10}, u'l2vlan': {'value': 6}},), is_leaf=True, yang_name="interface-type", rest_name="interface-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions={u'tailf-common': {u'info': u"The type of the interface. An 'unknown' type \nrepresents error scenario and should not be used."}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='enumeration', is_config=True)


  def _get_interface_name(self):
    """
    Getter method for interface_name, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/interface_name (union)

    YANG Description: The Interface value. The interface value is always 
interpreted within the context of the value of 
'interface-type' leaf:

interface-type         interface-name
-----------------      --------------------
ethernet               slot/port
port-channel           Port channel ID
l2vlan                 Vlan ID
loopback               Loopback ID
ve                     VE Interface ID
unknown                Zero-length string.

The value of an 'interface-name' must always be 
consistent with the value of the associated 
'interface-type'.  Attempts to set an interface-name
to a value inconsistent with the associated 
'interface-type' must fail with an error.
    """
    return self.__interface_name
      
  def _set_interface_name(self, v, load=False):
    """
    Setter method for interface_name, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/interface_name (union)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_interface_name is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_interface_name() directly.

    YANG Description: The Interface value. The interface value is always 
interpreted within the context of the value of 
'interface-type' leaf:

interface-type         interface-name
-----------------      --------------------
ethernet               slot/port
port-channel           Port channel ID
l2vlan                 Vlan ID
loopback               Loopback ID
ve                     VE Interface ID
unknown                Zero-length string.

The value of an 'interface-name' must always be 
consistent with the value of the associated 
'interface-type'.  Attempts to set an interface-name
to a value inconsistent with the associated 
'interface-type' must fail with an error.
    """
    parent = getattr(self, "_parent", None)
    if parent is not None and load is False:
      raise AttributeError("Cannot set keys directly when" +
                             " within an instantiated list")

    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((([0-9]|[1][0-6]))/([1-9]|[1-9][0-9]|[1-9][0-9][0-9])(:[1-4])?)', 'length': [u'3..16']}),RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..1024']}),RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..4090']}),], is_leaf=True, yang_name="interface-name", rest_name="interface-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions={u'tailf-common': {u'info': u'The Interface value.'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='union', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """interface_name must be of a type compatible with union""",
          'defined-type': "brocade-interface-ext:union",
          'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((([0-9]|[1][0-6]))/([1-9]|[1-9][0-9]|[1-9][0-9][0-9])(:[1-4])?)', 'length': [u'3..16']}),RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..1024']}),RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..4090']}),], is_leaf=True, yang_name="interface-name", rest_name="interface-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions={u'tailf-common': {u'info': u'The Interface value.'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='union', is_config=True)""",
        })

    self.__interface_name = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_interface_name(self):
    self.__interface_name = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((([0-9]|[1][0-6]))/([1-9]|[1-9][0-9]|[1-9][0-9][0-9])(:[1-4])?)', 'length': [u'3..16']}),RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..1024']}),RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..4090']}),], is_leaf=True, yang_name="interface-name", rest_name="interface-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions={u'tailf-common': {u'info': u'The Interface value.'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='union', is_config=True)


  def _get_sfp(self):
    """
    Getter method for sfp, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/sfp (container)
    """
    return self.__sfp
      
  def _set_sfp(self, v, load=False):
    """
    Setter method for sfp, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/sfp (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_sfp is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_sfp() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=sfp.sfp, is_container='container', presence=False, yang_name="sfp", rest_name="sfp", parent=self, choice=(u'interface-identifier', u'sfp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """sfp must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=sfp.sfp, is_container='container', presence=False, yang_name="sfp", rest_name="sfp", parent=self, choice=(u'interface-identifier', u'sfp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)""",
        })

    self.__sfp = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_sfp(self):
    self.__sfp = YANGDynClass(base=sfp.sfp, is_container='container', presence=False, yang_name="sfp", rest_name="sfp", parent=self, choice=(u'interface-identifier', u'sfp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)


  def _get_on_board(self):
    """
    Getter method for on_board, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/on_board (container)
    """
    return self.__on_board
      
  def _set_on_board(self, v, load=False):
    """
    Setter method for on_board, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/on_board (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_on_board is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_on_board() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=on_board.on_board, is_container='container', presence=False, yang_name="on-board", rest_name="on-board", parent=self, choice=(u'interface-identifier', u'on-board'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """on_board must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=on_board.on_board, is_container='container', presence=False, yang_name="on-board", rest_name="on-board", parent=self, choice=(u'interface-identifier', u'on-board'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)""",
        })

    self.__on_board = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_on_board(self):
    self.__on_board = YANGDynClass(base=on_board.on_board, is_container='container', presence=False, yang_name="on-board", rest_name="on-board", parent=self, choice=(u'interface-identifier', u'on-board'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)


  def _get_gbc(self):
    """
    Getter method for gbc, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/gbc (container)
    """
    return self.__gbc
      
  def _set_gbc(self, v, load=False):
    """
    Setter method for gbc, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/gbc (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_gbc is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_gbc() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=gbc.gbc, is_container='container', presence=False, yang_name="gbc", rest_name="gbc", parent=self, choice=(u'interface-identifier', u'gbic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """gbc must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=gbc.gbc, is_container='container', presence=False, yang_name="gbc", rest_name="gbc", parent=self, choice=(u'interface-identifier', u'gbic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)""",
        })

    self.__gbc = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_gbc(self):
    self.__gbc = YANGDynClass(base=gbc.gbc, is_container='container', presence=False, yang_name="gbc", rest_name="gbc", parent=self, choice=(u'interface-identifier', u'gbic'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)


  def _get_xfp(self):
    """
    Getter method for xfp, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/xfp (container)
    """
    return self.__xfp
      
  def _set_xfp(self, v, load=False):
    """
    Setter method for xfp, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/xfp (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_xfp is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_xfp() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=xfp.xfp, is_container='container', presence=False, yang_name="xfp", rest_name="xfp", parent=self, choice=(u'interface-identifier', u'xfp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """xfp must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=xfp.xfp, is_container='container', presence=False, yang_name="xfp", rest_name="xfp", parent=self, choice=(u'interface-identifier', u'xfp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)""",
        })

    self.__xfp = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_xfp(self):
    self.__xfp = YANGDynClass(base=xfp.xfp, is_container='container', presence=False, yang_name="xfp", rest_name="xfp", parent=self, choice=(u'interface-identifier', u'xfp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)


  def _get_xff(self):
    """
    Getter method for xff, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/xff (container)
    """
    return self.__xff
      
  def _set_xff(self, v, load=False):
    """
    Setter method for xff, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/xff (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_xff is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_xff() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=xff.xff, is_container='container', presence=False, yang_name="xff", rest_name="xff", parent=self, choice=(u'interface-identifier', u'xff'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """xff must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=xff.xff, is_container='container', presence=False, yang_name="xff", rest_name="xff", parent=self, choice=(u'interface-identifier', u'xff'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)""",
        })

    self.__xff = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_xff(self):
    self.__xff = YANGDynClass(base=xff.xff, is_container='container', presence=False, yang_name="xff", rest_name="xff", parent=self, choice=(u'interface-identifier', u'xff'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)


  def _get_xfpe(self):
    """
    Getter method for xfpe, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/xfpe (container)
    """
    return self.__xfpe
      
  def _set_xfpe(self, v, load=False):
    """
    Setter method for xfpe, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/xfpe (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_xfpe is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_xfpe() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=xfpe.xfpe, is_container='container', presence=False, yang_name="xfpe", rest_name="xfpe", parent=self, choice=(u'interface-identifier', u'xfpe'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """xfpe must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=xfpe.xfpe, is_container='container', presence=False, yang_name="xfpe", rest_name="xfpe", parent=self, choice=(u'interface-identifier', u'xfpe'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)""",
        })

    self.__xfpe = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_xfpe(self):
    self.__xfpe = YANGDynClass(base=xfpe.xfpe, is_container='container', presence=False, yang_name="xfpe", rest_name="xfpe", parent=self, choice=(u'interface-identifier', u'xfpe'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)


  def _get_unknown(self):
    """
    Getter method for unknown, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/unknown (container)
    """
    return self.__unknown
      
  def _set_unknown(self, v, load=False):
    """
    Setter method for unknown, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/unknown (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_unknown is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_unknown() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=unknown.unknown, is_container='container', presence=False, yang_name="unknown", rest_name="unknown", parent=self, choice=(u'interface-identifier', u'unknown'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """unknown must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=unknown.unknown, is_container='container', presence=False, yang_name="unknown", rest_name="unknown", parent=self, choice=(u'interface-identifier', u'unknown'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)""",
        })

    self.__unknown = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_unknown(self):
    self.__unknown = YANGDynClass(base=unknown.unknown, is_container='container', presence=False, yang_name="unknown", rest_name="unknown", parent=self, choice=(u'interface-identifier', u'unknown'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)


  def _get_qsfp(self):
    """
    Getter method for qsfp, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/qsfp (container)
    """
    return self.__qsfp
      
  def _set_qsfp(self, v, load=False):
    """
    Setter method for qsfp, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/qsfp (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_qsfp is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_qsfp() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=qsfp.qsfp, is_container='container', presence=False, yang_name="qsfp", rest_name="qsfp", parent=self, choice=(u'interface-identifier', u'qsfp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """qsfp must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=qsfp.qsfp, is_container='container', presence=False, yang_name="qsfp", rest_name="qsfp", parent=self, choice=(u'interface-identifier', u'qsfp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)""",
        })

    self.__qsfp = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_qsfp(self):
    self.__qsfp = YANGDynClass(base=qsfp.qsfp, is_container='container', presence=False, yang_name="qsfp", rest_name="qsfp", parent=self, choice=(u'interface-identifier', u'qsfp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)


  def _get_qsfpp(self):
    """
    Getter method for qsfpp, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/qsfpp (container)
    """
    return self.__qsfpp
      
  def _set_qsfpp(self, v, load=False):
    """
    Setter method for qsfpp, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/qsfpp (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_qsfpp is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_qsfpp() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=qsfpp.qsfpp, is_container='container', presence=False, yang_name="qsfpp", rest_name="qsfpp", parent=self, choice=(u'interface-identifier', u'qsfpp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """qsfpp must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=qsfpp.qsfpp, is_container='container', presence=False, yang_name="qsfpp", rest_name="qsfpp", parent=self, choice=(u'interface-identifier', u'qsfpp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)""",
        })

    self.__qsfpp = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_qsfpp(self):
    self.__qsfpp = YANGDynClass(base=qsfpp.qsfpp, is_container='container', presence=False, yang_name="qsfpp", rest_name="qsfpp", parent=self, choice=(u'interface-identifier', u'qsfpp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)


  def _get_cfp(self):
    """
    Getter method for cfp, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/cfp (container)
    """
    return self.__cfp
      
  def _set_cfp(self, v, load=False):
    """
    Setter method for cfp, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/cfp (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_cfp is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_cfp() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=cfp.cfp, is_container='container', presence=False, yang_name="cfp", rest_name="cfp", parent=self, choice=(u'interface-identifier', u'cfp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """cfp must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=cfp.cfp, is_container='container', presence=False, yang_name="cfp", rest_name="cfp", parent=self, choice=(u'interface-identifier', u'cfp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)""",
        })

    self.__cfp = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_cfp(self):
    self.__cfp = YANGDynClass(base=cfp.cfp, is_container='container', presence=False, yang_name="cfp", rest_name="cfp", parent=self, choice=(u'interface-identifier', u'cfp'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)


  def _get_qsfp28(self):
    """
    Getter method for qsfp28, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/qsfp28 (container)
    """
    return self.__qsfp28
      
  def _set_qsfp28(self, v, load=False):
    """
    Setter method for qsfp28, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/qsfp28 (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_qsfp28 is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_qsfp28() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=qsfp28.qsfp28, is_container='container', presence=False, yang_name="qsfp28", rest_name="qsfp28", parent=self, choice=(u'interface-identifier', u'qsfp28'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """qsfp28 must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=qsfp28.qsfp28, is_container='container', presence=False, yang_name="qsfp28", rest_name="qsfp28", parent=self, choice=(u'interface-identifier', u'qsfp28'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)""",
        })

    self.__qsfp28 = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_qsfp28(self):
    self.__qsfp28 = YANGDynClass(base=qsfp28.qsfp28, is_container='container', presence=False, yang_name="qsfp28", rest_name="qsfp28", parent=self, choice=(u'interface-identifier', u'qsfp28'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)


  def _get_cfp2(self):
    """
    Getter method for cfp2, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/cfp2 (container)
    """
    return self.__cfp2
      
  def _set_cfp2(self, v, load=False):
    """
    Setter method for cfp2, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/cfp2 (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_cfp2 is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_cfp2() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=cfp2.cfp2, is_container='container', presence=False, yang_name="cfp2", rest_name="cfp2", parent=self, choice=(u'interface-identifier', u'cfp2'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """cfp2 must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=cfp2.cfp2, is_container='container', presence=False, yang_name="cfp2", rest_name="cfp2", parent=self, choice=(u'interface-identifier', u'cfp2'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)""",
        })

    self.__cfp2 = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_cfp2(self):
    self.__cfp2 = YANGDynClass(base=cfp2.cfp2, is_container='container', presence=False, yang_name="cfp2", rest_name="cfp2", parent=self, choice=(u'interface-identifier', u'cfp2'), path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-interface-ext', defining_module='brocade-interface-ext', yang_type='container', is_config=True)

  interface_type = __builtin__.property(_get_interface_type, _set_interface_type)
  interface_name = __builtin__.property(_get_interface_name, _set_interface_name)
  sfp = __builtin__.property(_get_sfp, _set_sfp)
  on_board = __builtin__.property(_get_on_board, _set_on_board)
  gbc = __builtin__.property(_get_gbc, _set_gbc)
  xfp = __builtin__.property(_get_xfp, _set_xfp)
  xff = __builtin__.property(_get_xff, _set_xff)
  xfpe = __builtin__.property(_get_xfpe, _set_xfpe)
  unknown = __builtin__.property(_get_unknown, _set_unknown)
  qsfp = __builtin__.property(_get_qsfp, _set_qsfp)
  qsfpp = __builtin__.property(_get_qsfpp, _set_qsfpp)
  cfp = __builtin__.property(_get_cfp, _set_cfp)
  qsfp28 = __builtin__.property(_get_qsfp28, _set_qsfp28)
  cfp2 = __builtin__.property(_get_cfp2, _set_cfp2)

  __choices__ = {u'interface-identifier': {u'cfp2': [u'cfp2'], u'qsfp28': [u'qsfp28'], u'gbic': [u'gbc'], u'on-board': [u'on_board'], u'qsfp': [u'qsfp'], u'unknown': [u'unknown'], u'sfp': [u'sfp'], u'xfpe': [u'xfpe'], u'qsfpp': [u'qsfpp'], u'xfp': [u'xfp'], u'xff': [u'xff'], u'cfp': [u'cfp']}}
  _pyangbind_elements = {'interface_type': interface_type, 'interface_name': interface_name, 'sfp': sfp, 'on_board': on_board, 'gbc': gbc, 'xfp': xfp, 'xff': xff, 'xfpe': xfpe, 'unknown': unknown, 'qsfp': qsfp, 'qsfpp': qsfpp, 'cfp': cfp, 'qsfp28': qsfp28, 'cfp2': cfp2, }


