We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3b969df + d02c71d commit 1ba11f6Copy full SHA for 1ba11f6
1 file changed
mergin/client.py
@@ -306,6 +306,23 @@ def username(self):
306
return None # not authenticated
307
return self._user_info["username"]
308
309
+ def user_service(self):
310
+ """
311
+ Requests information about user from /user/service endpoint if such exists in self.url server.
312
+
313
+ Returns response from server as JSON dict or None if endpoint is not found
314
315
316
+ try:
317
+ response = self.get("/v1/user/service")
318
+ except ClientError as e:
319
+ self.log.debug("Unable to query for /user/service endpoint")
320
+ return
321
322
+ response = json.loads(response.read())
323
324
+ return response
325
326
def create_project(self, project_name, is_public=False, namespace=None):
327
"""
328
Create new project repository in user namespace on Mergin server.
0 commit comments