aboutsummaryrefslogtreecommitdiff
path: root/pyfunkwhale/funkwhale.py
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2020-04-11 21:31:34 +0200
committerneodarz <neodarz@neodarz.net>2020-04-11 21:31:34 +0200
commitd3d9a9b940f8727aea5fe22a0e983dff5c83ec9d (patch)
tree83d7f3cfbff6a0cdc0d3ada7781ba546c653a62f /pyfunkwhale/funkwhale.py
parent989fc3a07c80f36e81206642b19a10d50a577c55 (diff)
downloadpyfunkwhale-d3d9a9b940f8727aea5fe22a0e983dff5c83ec9d.tar.xz
pyfunkwhale-d3d9a9b940f8727aea5fe22a0e983dff5c83ec9d.zip
Add licenses endpoint
Diffstat (limited to 'pyfunkwhale/funkwhale.py')
-rw-r--r--pyfunkwhale/funkwhale.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/pyfunkwhale/funkwhale.py b/pyfunkwhale/funkwhale.py
index ec55875..23d6412 100644
--- a/pyfunkwhale/funkwhale.py
+++ b/pyfunkwhale/funkwhale.py
@@ -317,3 +317,37 @@ class Funkwhale(object):
params = self._build_params(arguments)
return self.client.call(f'/listen/{_uuid}', 'get', params)
+
+ def licenses(self, page: str = None, page_size: str = None) -> dict:
+ """
+ List license
+
+ Parameters
+ ----------
+ page : int, optional
+ Default value: 1
+ page_size : int, optional
+ Default value: 25
+ """
+
+ arguments = locals()
+
+ params = self._build_params(arguments)
+
+ return self.client.call(f'/licenses/', 'get', params).json()
+
+ def license(self, _code) -> dict:
+ """
+ Retrieve a single license
+
+ Parameters
+ ----------
+ _code : str
+ License code
+ """
+
+ arguments = locals()
+
+ params = self._build_params(arguments)
+
+ return self.client.call(f'/licenses/{_code}', 'get', params).json()