File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 1919 overload ,
2020)
2121
22+ from posit .connect .jobs import _Jobs , Job
23+
2224from . import tasks
2325from ._api import ApiDictEndpoint , JsonifiableDict
2426from .bundles import Bundles
@@ -514,7 +516,7 @@ def tags(self) -> ContentItemTags:
514516 @property
515517 def jobs (self ) -> Jobs :
516518 path = posixpath .join (self ._path , "jobs" )
517- return _ResourceSequence (self ._ctx , path , uid = "key" )
519+ return _Jobs (self ._ctx , path , uid = "key" )
518520
519521 @property
520522 @requires (version = "2024.11.0" )
Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ from typing import Any , List
4+
35from typing_extensions import (
46 Iterable ,
57 Literal ,
68 Protocol ,
79 runtime_checkable ,
810)
911
10- from .resources import Resource , ResourceSequence
12+ from .resources import Resource , ResourceSequence , _Resource , _ResourceSequence
1113
1214JobTag = Literal [
1315 "unknown" ,
3941StatusCode = Literal [0 , 1 , 2 ]
4042
4143
44+ @runtime_checkable
4245class Job (Resource , Protocol ):
4346 def destroy (self ) -> None :
4447 """Destroy the job.
@@ -53,6 +56,11 @@ def destroy(self) -> None:
5356 """
5457
5558
59+ class _Job (_Resource ):
60+ def wait_for (self ) -> None :
61+ pass
62+
63+
5664@runtime_checkable
5765class Jobs (ResourceSequence [Job ], Protocol ):
5866 def fetch (self ) -> Iterable [Job ]:
@@ -165,3 +173,9 @@ def find_by(
165173 This action requires administrator, owner, or collaborator privileges.
166174 """
167175 ...
176+
177+
178+ class _Jobs (_ResourceSequence [Job ]):
179+ def fetch (self , ** conditions ) -> Iterable [Any ]:
180+ resources = super ().fetch (** conditions )
181+ return [_Job (** resource ) for resource in resources ]
You can’t perform that action at this time.
0 commit comments