11from __future__ import annotations
22
3- from collections .abc import Mapping , Sized
4- from typing import Any , Literal , Protocol , SupportsIndex , overload
5-
6-
7- class _ContentPackage (Mapping [str , Any ]):
3+ from typing_extensions import (
4+ Any ,
5+ Iterable ,
6+ Literal ,
7+ Mapping ,
8+ Protocol ,
9+ Sized ,
10+ SupportsIndex ,
11+ overload ,
12+ )
13+
14+
15+ class ContentPackage (Mapping [str , Any ]):
816 pass
917
1018
11- class _ContentPackages (Sized , Protocol ):
19+ class ContentPackages (Sized , Protocol ):
1220 @overload
13- def __getitem__ (self , index : SupportsIndex ) -> _ContentPackage : ...
21+ def __getitem__ (self , index : SupportsIndex ) -> ContentPackage : ...
1422
1523 @overload
16- def __getitem__ (self , index : slice ) -> _ContentPackage : ...
24+ def __getitem__ (self , index : slice ) -> ContentPackage : ...
25+
26+ def fetch (
27+ self ,
28+ * ,
29+ language : Literal ["python" , "r" ] = ...,
30+ name : str = ...,
31+ version : str = ...,
32+ hash : str | None = ..., # noqa: A002
33+ ) -> Iterable [ContentPackage ]:
34+ """
35+ Fetch all records matching the specified conditions.
36+
37+ Parameters
38+ ----------
39+ language : {"python", "r"}, not required
40+ Programming language ecosystem, options are 'python' and 'r'
41+ name : str, not required
42+ The package name
43+ version : str, not required
44+ The package version
45+ hash : str or None, optional, not required
46+ Package description hash for R packages.
47+
48+ Returns
49+ -------
50+ List[ContentPackage]
51+ The first record matching the specified conditions, or `None` if no such record exists.
52+ """
53+ ...
1754
1855 def find_by (
1956 self ,
@@ -22,7 +59,7 @@ def find_by(
2259 name : str = ...,
2360 version : str = ...,
2461 hash : str | None = ..., # noqa: A002
25- ) -> _ContentPackage | None :
62+ ) -> ContentPackage | None :
2663 """
2764 Find the first record matching the specified conditions.
2865
@@ -41,22 +78,60 @@ def find_by(
4178
4279 Returns
4380 -------
44- _ContentPackage | None
81+ ContentPackage | None
4582 The first record matching the specified conditions, or `None` if no such record exists.
4683 """
4784 ...
4885
4986
50- class _Package (Mapping [str , Any ]):
87+ class Package (Mapping [str , Any ]):
5188 pass
5289
5390
54- class _Packages (Sized , Protocol ):
91+ class Packages (Sized , Protocol ):
5592 @overload
56- def __getitem__ (self , index : SupportsIndex ) -> _ContentPackage : ...
93+ def __getitem__ (self , index : SupportsIndex ) -> ContentPackage : ...
5794
5895 @overload
59- def __getitem__ (self , index : slice ) -> _ContentPackage : ...
96+ def __getitem__ (self , index : slice ) -> ContentPackage : ...
97+
98+ def fetch (
99+ self ,
100+ * ,
101+ language : Literal ["python" , "r" ] = ...,
102+ name : str = ...,
103+ version : str = ...,
104+ hash : str | None = ..., # noqa: A002,
105+ bundle_id : str = ...,
106+ app_id : str = ...,
107+ app_guid : str = ...,
108+ ) -> Iterable [Package ]:
109+ """
110+ Fetch all records matching the specified conditions.
111+
112+ Parameters
113+ ----------
114+ language : {"python", "r"}, not required
115+ Programming language ecosystem, options are 'python' and 'r'
116+ name : str, not required
117+ The package name
118+ version : str, not required
119+ The package version
120+ hash : str or None, optional, not required
121+ Package description hash for R packages.
122+ bundle_id: str, not required
123+ The unique identifier of the bundle this package is associated with.
124+ app_id: str, not required
125+ The numerical identifier of the application this package is associated with.
126+ app_guid: str, not required
127+ The unique identifier of the application this package is associated with.
128+
129+ Returns
130+ -------
131+ List[Package]
132+ The first record matching the specified conditions, or `None` if no such record exists.
133+ """
134+ ...
60135
61136 def find_by (
62137 self ,
@@ -68,7 +143,7 @@ def find_by(
68143 bundle_id : str = ...,
69144 app_id : str = ...,
70145 app_guid : str = ...,
71- ) -> _ContentPackage | None :
146+ ) -> Package | None :
72147 """
73148 Find the first record matching the specified conditions.
74149
@@ -93,7 +168,7 @@ def find_by(
93168
94169 Returns
95170 -------
96- _Package | None
171+ Package | None
97172 The first record matching the specified conditions, or `None` if no such record exists.
98173 """
99174 ...
0 commit comments