Setter method for modes, mapped from YANG variable /rbridge_id/ag/pg/modes (pg-policy-types)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_modes is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_modes() directly.

def _set_modes(self, v, load=False):
    """
    Setter method for modes, mapped from YANG variable /rbridge_id/ag/pg/modes (pg-policy-types)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_modes is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_modes() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=TypedListType(allowed_type=RestrictedClassType(base_type=unicode, restriction_dict={'length': [u'1..10']})), is_leaf=False, yang_name="modes", rest_name="modes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Adds mode(s) to the PG', u'cli-flat-list-syntax': None}}, namespace='urn:brocade.com:mgmt:brocade-ag', defining_module='brocade-ag', yang_type='pg-policy-types', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """modes must be of a type compatible with pg-policy-types""",
          'defined-type': "brocade-ag:pg-policy-types",
          'generated-type': """YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=unicode, restriction_dict={'length': [u'1..10']})), is_leaf=False, yang_name="modes", rest_name="modes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Adds mode(s) to the PG', u'cli-flat-list-syntax': None}}, namespace='urn:brocade.com:mgmt:brocade-ag', defining_module='brocade-ag', yang_type='pg-policy-types', is_config=True)""",
        })

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