Skip to content

Commit 332c18a

Browse files
committed
Fix default type objects
1 parent 9d0053d commit 332c18a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

dataikuapi/dssclient.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -674,14 +674,14 @@ def create_global_api_key(self, label=None, description=None, admin=False):
674674
# Personal API Keys
675675
########################################################
676676

677-
def list_personal_api_keys(self, as_type='object'):
677+
def list_personal_api_keys(self, as_type='objects'):
678678
"""
679679
List all your personal API keys
680680
681681
:param str as_type: How to return the personal API keys. Possible values are "dict" and "object"
682682
683683
:return: if as_type=dict, each personal API keys is returned as a dict.
684-
if as_type=object, each key is returned as a :class:`dataikuapi.dss.admin.DSSPersonalApiKey`.
684+
if as_type=objects, each key is returned as a :class:`dataikuapi.dss.admin.DSSPersonalApiKey`.
685685
"""
686686
resp = self._perform_json(
687687
"GET", "/personal-api-keys/")
@@ -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=object, the new personal API key is returned as a :class:`dataikuapi.dss.admin.DSSPersonalApiKey`.
712+
if as_type=objects, 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,20 +720,20 @@ 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 == 'object':
723+
if as_type == 'objects':
724724
return DSSPersonalApiKey(self, resp["id"])
725725
else:
726726
return resp
727727

728-
def list_all_personal_api_keys(self, as_type='object'):
728+
def list_all_personal_api_keys(self, as_type='objects'):
729729
"""
730730
List all personal API keys
731731
Only admin can list all the keys
732732
733733
:param str as_type: How to return the personal API keys. Possible values are "dict" and "object"
734734
735735
:return: if as_type=dict, each personal API keys is returned as a dict.
736-
if as_type=object, each key is returned as a :class:`dataikuapi.dss.admin.DSSPersonalApiKey`.
736+
if as_type=objects, each key is returned as a :class:`dataikuapi.dss.admin.DSSPersonalApiKey`.
737737
"""
738738
resp = self._perform_json(
739739
"GET", "/admin/personal-api-keys/")
@@ -742,18 +742,18 @@ def list_all_personal_api_keys(self, as_type='object'):
742742
else:
743743
return resp
744744

745-
def create_personal_api_key_for_user(self, user, label="", description="", as_type='object'):
745+
def create_personal_api_key_for_user(self, user, label="", description="", as_type='objects'):
746746
"""
747747
Create a Personal API key associated on behalf of a user
748748
Only admin can create a key for another user
749749
750750
:param str label: the label of the new API key
751751
:param str description: the description of the new API key
752752
:param str user: the id of the user to impersonate
753-
:param str as_type: How to return the personal API keys. Possible values are "dict" and "object"
753+
: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=object, the new personal API key is returned as a :class:`dataikuapi.dss.admin.DSSPersonalApiKey`.
756+
if as_type=objects, 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 == 'object':
767+
if as_type == 'objects':
768768
return DSSPersonalApiKey(self, resp["id"])
769769
else:
770770
return resp

0 commit comments

Comments
 (0)