From 2af9e39c0cdf2e193aaf3640a6c8a3c12997794a Mon Sep 17 00:00:00 2001 From: tdstein Date: Tue, 12 Nov 2024 10:47:25 -0500 Subject: [PATCH] add overload definitions for fetch --- src/posit/connect/packages.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/posit/connect/packages.py b/src/posit/connect/packages.py index 178ca4c5..3cdf92dc 100644 --- a/src/posit/connect/packages.py +++ b/src/posit/connect/packages.py @@ -142,6 +142,22 @@ def __init__(self, ctx, path): def _create_instance(self, path, /, **attributes): return Package(self._ctx, **attributes) + class _Fetch(TypedDict, total=False): + language: Required[Literal["python", "r"]] + """Programming language ecosystem, options are 'python' and 'r'""" + + name: Required[str] + """The package name""" + + version: Required[str] + """The package version""" + + @overload + def fetch(self, **conditions: Unpack[_Fetch]): ... + + @overload + def fetch(self, **conditions): ... + def fetch(self, **conditions) -> Generator["Package"]: # todo - add pagination support to ActiveSequence url = self._ctx.url + self._path