Module Expr Str ImportFrom alias alias Import alias Import alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If CompareIn NameLoad AttributeLoad NameLoad attr body TryExcept body Return Call NameLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Num handlers ExceptHandler body Assign NameStore BinOpMod Str TupleLoad NameLoad Raise Call NameLoad Num NameLoad orelse If NameLoad body Assign NameStore BinOpMod Str TupleLoad NameLoad Raise Call NameLoad Num NameLoad keyword AttributeLoad NameLoad attr orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If CompareIn NameLoad AttributeLoad NameLoad attr body TryExcept body Return SubscriptLoad Dict Str Str NameLoad NameLoad Index SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Num handlers ExceptHandler body Assign NameStore BinOpMod Str TupleLoad NameLoad Raise Call NameLoad Num NameLoad orelse If NameLoad body Assign NameStore BinOpMod Str TupleLoad NameLoad Raise Call NameLoad Num NameLoad keyword AttributeLoad NameLoad attr orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad Str body Expr Str If CompareIn NameLoad AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Num If BoolOpAnd CompareIsNot NameLoad NameLoad CompareNotIn NameLoad NameLoad body Assign NameStore BinOpMod Str TupleLoad NameLoad Call AttributeLoad Str attr GeneratorExp Call NameLoad NameLoad comprehension NameStore NameLoad Raise Call NameLoad Num NameLoad orelse Return NameLoad orelse If NameLoad body Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad Raise Call NameLoad Num NameLoad keyword AttributeLoad NameLoad attr orelse Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler body Raise Call NameLoad Num Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Raise Call NameLoad Num Str keyword AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad If CompareNotEq Call NameLoad NameLoad NameLoad body Assign NameStore Str Raise Call NameLoad Num NameLoad keyword AttributeLoad NameLoad attr Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad Str body Assign NameStore AttributeLoad NameLoad attr For NameStore TupleLoad Str Str Str Str Str body If Call NameLoad NameLoad BinOpMod Str TupleLoad NameLoad body Assign NameStore Call NameLoad NameLoad BinOpMod Str TupleLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad orelse Raise Call NameLoad Str decorator_list decorator_list
N/A N/A  This module contains base REST classes for constructing REST servlets.  synapse.api.errors SynapseError Codes N/A logging N/A simplejson N/A logger N/A N/A logging getLogger __name__ parse_integer N/A N/A request name default required N/A None False N/A N/A Parse an integer parameter from the request string

    :param request: the twisted HTTP request.
    :param name (str): the name of the query parameter.
    :param default: value to use if the parameter is absent, defaults to None.
    :param required (bool): whether to raise a 400 SynapseError if the
        parameter is absent, defaults to False.
    :return: An int value or the default.
    :raises
        SynapseError if the parameter is absent and required, or if the
            parameter is present and not an integer.
     N/A N/A name N/A request args N/A N/A N/A N/A N/A int N/A N/A N/A request args N/A name N/A 0 N/A N/A N/A N/A message N/A Query parameter %r must be an integer N/A name N/A N/A SynapseError 400 message N/A N/A required N/A N/A message N/A Missing integer query parameter %r N/A name N/A N/A SynapseError 400 message errcode N/A Codes MISSING_PARAM N/A N/A default N/A parse_boolean N/A N/A request name default required N/A None False N/A N/A Parse a boolean parameter from the request query string

    :param request: the twisted HTTP request.
    :param name (str): the name of the query parameter.
    :param default: value to use if the parameter is absent, defaults to None.
    :param required (bool): whether to raise a 400 SynapseError if the
        parameter is absent, defaults to False.
    :return: A bool value or the default.
    :raises
        SynapseError if the parameter is absent and required, or if the
            parameter is present and not one of "true" or "false".
     N/A N/A name N/A request args N/A N/A N/A N/A N/A N/A true false True False N/A N/A N/A N/A request args N/A name N/A 0 N/A N/A N/A N/A message N/A Boolean query parameter %r must be one of ['true', 'false'] N/A name N/A N/A SynapseError 400 message N/A N/A required N/A N/A message N/A Missing boolean query parameter %r N/A name N/A N/A SynapseError 400 message errcode N/A Codes MISSING_PARAM N/A N/A default N/A parse_string N/A N/A request name default required allowed_values param_type N/A None False None string N/A N/A Parse a string parameter from the request query string.

    :param request: the twisted HTTP request.
    :param name (str): the name of the query parameter.
    :param default: value to use if the parameter is absent, defaults to None.
    :param required (bool): whether to raise a 400 SynapseError if the
        parameter is absent, defaults to False.
    :param allowed_values (list): List of allowed values for the string,
        or None if any value is allowed, defaults to None
    :return: A string value or the default.
    :raises
        SynapseError if the parameter is absent and required, or if the
            parameter is present, must be one of a list of allowed values and
            is not one of those allowed values.
     N/A N/A name N/A request args N/A N/A value N/A N/A N/A request args N/A name N/A 0 N/A N/A N/A allowed_values None N/A value allowed_values N/A N/A message N/A Query parameter %r must be one of [%s] N/A name N/A N/A ,  join N/A N/A repr v N/A v allowed_values N/A N/A SynapseError 400 message N/A N/A value N/A N/A required N/A N/A message N/A Missing %s query parameter %r N/A param_type name N/A N/A SynapseError 400 message errcode N/A Codes MISSING_PARAM N/A N/A default N/A parse_json_value_from_request N/A N/A request N/A N/A N/A Parse a JSON value from the body of a twisted HTTP request.

    :param request: the twisted HTTP request.
    :returns: The JSON value.
    :raises
        SynapseError if the request body couldn't be decoded as JSON.
     N/A N/A N/A content_bytes N/A N/A N/A request content read N/A N/A N/A N/A N/A SynapseError 400 Error reading JSON content. N/A N/A N/A content N/A N/A simplejson loads content_bytes N/A N/A N/A N/A simplejson JSONDecodeError N/A N/A N/A SynapseError 400 Content not JSON. errcode N/A Codes NOT_JSON N/A content N/A parse_json_object_from_request N/A N/A request N/A N/A N/A Parse a JSON object from the body of a twisted HTTP request.

    :param request: the twisted HTTP request.
    :raises
        SynapseError if the request body couldn't be decoded as JSON or
            if it wasn't a JSON object.
     N/A content N/A parse_json_value_from_request request N/A N/A N/A type content dict N/A N/A message Content must be a JSON object. N/A N/A SynapseError 400 message errcode N/A Codes BAD_JSON N/A content N/A RestServlet N/A object N/A N/A  A Synapse REST Servlet.

    An implementing class can either provide its own custom 'register' method,
    or use the automatic pattern handling provided by the base class.

    To use this latter, the implementing class instead provides a `PATTERN`
    class attribute containing a pre-compiled regular expression. The automatic
    register method will then use this method to register any of the following
    instance methods associated with the corresponding HTTP method:

      on_GET
      on_PUT
      on_POST
      on_DELETE
      on_OPTIONS

    Automatically handles turning CodeMessageExceptions thrown by these methods
    into the appropriate HTTP response.
     register N/A N/A self http_server N/A N/A N/A  Register this servlet with the given HTTP server.  N/A N/A hasattr self PATTERNS N/A N/A patterns N/A self PATTERNS N/A method N/A GET PUT POST OPTIONS DELETE N/A N/A N/A hasattr self N/A on_%s N/A method N/A N/A method_handler N/A getattr self N/A on_%s N/A method N/A N/A N/A http_server register_paths method patterns method_handler N/A N/A N/A NotImplementedError RestServlet must register something. N/A N/A