Setter method for session_role, mapped from YANG variable /mpls_state/rsvp/sessions/session_role (session-role)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_session_role is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_session_role() directly.

    YANG Description: If this session role is ingress, egress or transit

def _set_session_role(self, v, load=False):
    """
    Setter method for session_role, mapped from YANG variable /mpls_state/rsvp/sessions/session_role (session-role)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_session_role is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_session_role() directly.

    YANG Description: If this session role is ingress, egress or transit
    """
    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'session-role-ingress': {'value': 1}, u'session-role-transit': {'value': 3}, u'session-role-unspecified': {'value': 0}, u'session-role-egress': {'value': 2}},), is_leaf=True, yang_name="session-role", rest_name="session-role", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='session-role', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """session_role must be of a type compatible with session-role""",
          'defined-type': "brocade-mpls-operational:session-role",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'session-role-ingress': {'value': 1}, u'session-role-transit': {'value': 3}, u'session-role-unspecified': {'value': 0}, u'session-role-egress': {'value': 2}},), is_leaf=True, yang_name="session-role", rest_name="session-role", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='session-role', is_config=False)""",
        })

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