|
2 | 2 |
|
3 | 3 | from typing_extensions import NotRequired, Required, Unpack |
4 | 4 |
|
5 | | -from posit.connect.context import Context |
6 | | - |
| 5 | +from .context import Context |
7 | 6 | from .resources import Active, ActiveFinderMethods, ActiveSequence, Resource |
8 | 7 |
|
9 | 8 | JobTag = Literal[ |
@@ -102,29 +101,33 @@ class _Job(TypedDict): |
102 | 101 | """A tag categorizing the job type. Options are build_jupyter, build_report, build_site, configure_report, git, packrat_restore, python_restore, render_shiny, run_api, run_app, run_bokeh_app, run_dash_app, run_fastapi_app, run_pyshiny_app, run_python_api, run_streamlit, run_tensorflow, run_voila_app, testing, unknown, val_py_ext_pkg, val_r_ext_pkg, and val_r_install.""" |
103 | 102 |
|
104 | 103 | @overload |
105 | | - def __init__(self, ctx: Context, base: str, uid: str, /, **kwargs: Unpack[_Job]): |
| 104 | + def __init__(self, ctx: Context, base: str, uid: str, /, **attributes: Unpack[_Job]): |
| 105 | + ... |
| 106 | + |
| 107 | + @overload |
| 108 | + def __init__(self, ctx: Context, base: str, uid: str, /, **attributes: Any): ... |
| 109 | + |
| 110 | + def __init__(self, ctx: Context, base: str, uid: str, /, **attributes: Any): |
106 | 111 | """A Job. |
107 | 112 |
|
108 | 113 | A Job represents single execution instance of Content on Connect. Whenever Content runs, whether it's a scheduled report, a script execution, or server processes related to an application, a Job is created to manage and encapsulate that execution. |
109 | 114 |
|
110 | 115 | Parameters |
111 | 116 | ---------- |
112 | 117 | ctx : Context |
113 | | - The context object that holds the HTTP session used for sending the GET request. |
114 | | - parent : ContentItem |
115 | | - The Content related to this Job. |
| 118 | + The context object containing the session and URL for API interactions. |
| 119 | + base : str |
| 120 | + The base HTTP path for the Job endpoint (e.g., '/jobs') |
| 121 | + uid : str |
| 122 | + The unique identifier |
| 123 | + **attributes |
| 124 | + Object items passed to the base resource dictionary. |
116 | 125 |
|
117 | 126 | Notes |
118 | 127 | ----- |
119 | | - A Job is a reference to a server process on Connect, it is not the process itself. Jobs are executed asynchronously |
| 128 | + A Job is a reference to a server process on Connect, it is not the process itself. Jobs are executed asynchronously. |
120 | 129 | """ |
121 | | - ... |
122 | | - |
123 | | - @overload |
124 | | - def __init__(self, ctx: Context, base: str, uid: str, /, **kwargs: Any): ... |
125 | | - |
126 | | - def __init__(self, ctx: Context, base: str, uid: str, /, **kwargs: Any): |
127 | | - super().__init__(ctx, **kwargs) |
| 130 | + super().__init__(ctx, **attributes) |
128 | 131 | self._endpoint = ctx.url + base + uid |
129 | 132 |
|
130 | 133 | def destroy(self) -> None: |
|
0 commit comments