Skip to content

Commit f0458a9

Browse files
committed
Add keys parameter in missing routes v0.28.x
1 parent cd973eb commit f0458a9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

meilisearch/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def create_key(
309309

310310
def update_key(
311311
self,
312-
key: str,
312+
key_or_uid: str,
313313
options: Dict[str, Any]
314314
) -> Dict[str, Any]:
315315
"""Update an API key.
@@ -318,7 +318,7 @@ def update_key(
318318
319319
----------
320320
key:
321-
The key for which to update the information.
321+
The key or the uid of the key for which to update the information.
322322
options:
323323
The information to use in creating the key (ex: { 'description': 'Search Key', 'expiresAt': '22-01-01' }). Note that if an
324324
expires_at value is included it should be in UTC time.
@@ -334,16 +334,16 @@ def update_key(
334334
MeiliSearchApiError
335335
An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://docs.meilisearch.com/errors/#meilisearch-errors
336336
"""
337-
url = f'{self.config.paths.keys}/{key}'
337+
url = f'{self.config.paths.keys}/{key_or_uid}'
338338
return self.http.patch(url, options)
339339

340-
def delete_key(self, key: str) -> Dict[str, int]:
340+
def delete_key(self, key_or_uid: str) -> Dict[str, int]:
341341
"""Deletes an API key.
342342
343343
Parameters
344344
----------
345345
key:
346-
The key to delete.
346+
The key or the uid of the key to delete.
347347
348348
Returns
349349
-------
@@ -356,7 +356,7 @@ def delete_key(self, key: str) -> Dict[str, int]:
356356
MeiliSearchApiError
357357
An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://docs.meilisearch.com/errors/#meilisearch-errors
358358
"""
359-
return self.http.delete(f'{self.config.paths.keys}/{key}')
359+
return self.http.delete(f'{self.config.paths.keys}/{key_or_uid}')
360360

361361
def get_version(self) -> Dict[str, str]:
362362
"""Get version Meilisearch

0 commit comments

Comments
 (0)