Skip to content

Commit

Permalink
add overload definitions for fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
tdstein committed Nov 12, 2024
1 parent 3895d72 commit 2af9e39
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/posit/connect/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2af9e39

Please sign in to comment.