diff options
| author | Barry Warsaw | 2016-01-13 11:16:38 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2016-01-13 11:16:38 -0500 |
| commit | 98c074f19492d81ebf5b5c3f4d4f2210aa56230d (patch) | |
| tree | 8a04bc455fe21065c38ccd05e3141d3f24d0d816 /src/mailman/interfaces/api.py | |
| parent | d75a7ebb46279f341b498bf517d07e9ae4c27f0a (diff) | |
| download | mailman-98c074f19492d81ebf5b5c3f4d4f2210aa56230d.tar.gz mailman-98c074f19492d81ebf5b5c3f4d4f2210aa56230d.tar.zst mailman-98c074f19492d81ebf5b5c3f4d4f2210aa56230d.zip | |
Diffstat (limited to 'src/mailman/interfaces/api.py')
| -rw-r--r-- | src/mailman/interfaces/api.py | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/src/mailman/interfaces/api.py b/src/mailman/interfaces/api.py index f2b33ea09..c64f37346 100644 --- a/src/mailman/interfaces/api.py +++ b/src/mailman/interfaces/api.py @@ -30,8 +30,36 @@ class IAPI(Interface): version = Attribute("""The REST API version.""") + def path_to(resource): + """Return the full REST URL to the given resource. + + :param resource: Resource path string without the leading scheme, + host, port, or API version information. + :type resource: str + :return: Full URL path to the resource, with the scheme, host, port + and API version prepended. + :rtype: str + """ + def from_uuid(uuid): - """Return the string representation of a UUID.""" + """Return the string representation of a UUID. + + :param uuid: The UUID to convert. + :type uuid: UUID + :return: The string representation of the UUID, as appropriate for the + API version. In 3.0 this is the representation of an integer, + while in 3.1 it is the hex representation. + :rtype: str + """ + + def to_uuid(uuid): + """Return the UUID from the string representation. - def to_uuid(uuid_repr): - """Return the UUID from the string representation.""" + :param uuid: The string representation of the UUID. + :type uuid: str + :return: The UUID converted from the string representation, as + appropriate for the API version. In 3.0, uuid is interpreted as + the integer representation of a UUID, while in 3.1 it is the hex + representation of the UUID. + :rtype: UUID + """ |
