Restore and deprecate client.tasks.get() without task_id

This commit is contained in:
Seth Michael Larson
2020-03-13 16:20:54 -05:00
committed by GitHub
parent 883287551a
commit 9b20a30b0f
4 changed files with 51 additions and 2 deletions
+7
View File
@@ -146,6 +146,13 @@ class API:
p in url.get("parts", {}) for url in self._def["url"]["paths"]
)
# This piece of logic corresponds to calling
# client.tasks.get() w/o a task_id which was erroneously
# allowed in the 7.1 client library. This functionality
# is deprecated and will be removed in 8.x.
if self.namespace == "tasks" and self.name == "get":
parts["task_id"]["required"] = False
for k, sub in SUBSTITUTIONS.items():
if k in parts:
parts[sub] = parts.pop(k)