Skip to content

Commit caa9dbe

Browse files
committed
Use plurial type only for list objects
1 parent 332c18a commit caa9dbe

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

dataikuapi/dssclient.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ def create_personal_api_key(self, label="", description="", as_type='dict'):
709709
:param str as_type: How to return the personal API keys. Possible values are "dict" and "object"
710710
711711
:return: if as_type=dict, the new personal API key is returned as a dict.
712-
if as_type=objects, the new personal API key is returned as a :class:`dataikuapi.dss.admin.DSSPersonalApiKey`.
712+
if as_type=object, the new personal API key is returned as a :class:`dataikuapi.dss.admin.DSSPersonalApiKey`.
713713
"""
714714
resp = self._perform_json(
715715
"POST", "/personal-api-keys/", body={"label": label, "description": description})
@@ -720,7 +720,7 @@ def create_personal_api_key(self, label="", description="", as_type='dict'):
720720
if not resp.get('id', False):
721721
raise Exception('API key creation returned no key')
722722

723-
if as_type == 'objects':
723+
if as_type == 'object':
724724
return DSSPersonalApiKey(self, resp["id"])
725725
else:
726726
return resp
@@ -742,7 +742,7 @@ def list_all_personal_api_keys(self, as_type='objects'):
742742
else:
743743
return resp
744744

745-
def create_personal_api_key_for_user(self, user, label="", description="", as_type='objects'):
745+
def create_personal_api_key_for_user(self, user, label="", description="", as_type='object'):
746746
"""
747747
Create a Personal API key associated on behalf of a user
748748
Only admin can create a key for another user
@@ -753,7 +753,7 @@ def create_personal_api_key_for_user(self, user, label="", description="", as_ty
753753
:param str as_type: How to return the personal API keys. Possible values are "dict" and "objects"
754754
755755
:return: if as_type=dict, the new personal API key is returned as a dict.
756-
if as_type=objects, the new personal API key is returned as a :class:`dataikuapi.dss.admin.DSSPersonalApiKey`.
756+
if as_type=object, the new personal API key is returned as a :class:`dataikuapi.dss.admin.DSSPersonalApiKey`.
757757
"""
758758
resp = self._perform_json(
759759
"POST", "/admin/personal-api-keys/", body={"user": user, "label": label, "description": description})
@@ -764,7 +764,7 @@ def create_personal_api_key_for_user(self, user, label="", description="", as_ty
764764
if not resp.get('id', False):
765765
raise Exception('API key creation returned no key')
766766

767-
if as_type == 'objects':
767+
if as_type == 'object':
768768
return DSSPersonalApiKey(self, resp["id"])
769769
else:
770770
return resp

0 commit comments

Comments
 (0)