class documentation

A connection to the REST client.

Method __init__ Initialize a connection to the REST API.
Method add_hooks Add a list of hooks to an existing connection object.
Method call Make a call to the Mailman REST API.
Method rewrite_url rewrite url component with self.baseurl prefix "scheme://netloc"
Instance Variable auth Undocumented
Instance Variable baseurl Undocumented
Instance Variable name Undocumented
Instance Variable password Undocumented
Instance Variable request_hooks Undocumented
Method _prepare_request Undocumented
Method _process_request_hooks Given the request parameters, pass them through the list of hooks.
def __init__(self, baseurl, name=None, password=None, request_hooks=None): (source)

Initialize a connection to the REST API.

Parameters
baseurlThe base url to access the Mailman 3 REST API.
nameThe Basic Auth user name. If given, the password must also be given.
passwordThe Basic Auth password. If given the name must also be given.
request_hooksA list of callables that can receive the request parameters and return them with some changes or unchanged.
def add_hooks(self, request_hooks): (source)

Add a list of hooks to an existing connection object.

Parameters
request_hooks:List[callables]A list of Request hook which receive the request parameters.
def call(self, path, data=None, method=None): (source)

Make a call to the Mailman REST API.

Parameters
path:strThe url path to the resource.
data:dictData to send, implies POST (default) or PUT.
method:strThe HTTP method to call. Defaults to GET when data is None or POST if data is given.
Returns
None, list, dictThe response content, which will be None, a dictionary, or a list depending on the actual JSON type returned.
Raises
HTTPErrorwhen a non-2xx status code is returned.
def rewrite_url(self, url): (source)

rewrite url component with self.baseurl prefix "scheme://netloc"

Parameters
url:strthe URL to rewrite
Returns
strmodified URL

Undocumented

Undocumented

Undocumented

password = (source)

Undocumented

request_hooks = (source)

Undocumented

def _prepare_request(self, path, data, method): (source)

Undocumented

def _process_request_hooks(self, params): (source)

Given the request parameters, pass them through the list of hooks.

Hooks are simple callables that are provided with request parameters and return the same parameters, possibly with some modification or not.

Parameters
paramsThe HTTP request parameters.
Returns
The HTTP request parameters.