Skip to main content

nominal_api_conjure/conjure/clients/ingest/api/
ingest_job_service.rs

1use conjure_http::endpoint;
2/// Public API for querying ingest jobs.
3#[conjure_http::conjure_client(name = "IngestJobService")]
4pub trait IngestJobService<
5    #[response_body]
6    I: Iterator<
7            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
8        >,
9> {
10    /// Returns a single ingest job by RID. Does not include the full ingest request details.
11    #[endpoint(
12        method = GET,
13        path = "/ingest/v1/ingest-job/{ingestJobRid}",
14        name = "getIngestJob",
15        accept = conjure_http::client::StdResponseDeserializer
16    )]
17    fn get_ingest_job(
18        &self,
19        #[auth]
20        auth_: &conjure_object::BearerToken,
21        #[path(
22            name = "ingestJobRid",
23            encoder = conjure_http::client::conjure::PlainEncoder
24        )]
25        ingest_job_rid: &super::super::super::super::objects::ingest::api::IngestJobRid,
26    ) -> Result<
27        super::super::super::super::objects::ingest::api::IngestJob,
28        conjure_http::private::Error,
29    >;
30    /// Returns a single ingest transform by RID. The caller must be authorized to read the dataset
31    /// produced by the transform's parent ingest job; a transform whose parent job is not visible to
32    /// the caller is reported as IngestTransformNotFound rather than leaking its existence.
33    #[endpoint(
34        method = GET,
35        path = "/ingest/v1/ingest-transform/{ingestTransformRid}",
36        name = "getIngestTransform",
37        accept = conjure_http::client::StdResponseDeserializer
38    )]
39    fn get_ingest_transform(
40        &self,
41        #[auth]
42        auth_: &conjure_object::BearerToken,
43        #[path(
44            name = "ingestTransformRid",
45            encoder = conjure_http::client::conjure::PlainEncoder
46        )]
47        ingest_transform_rid: &super::super::super::super::objects::ingest::api::IngestTransformRid,
48    ) -> Result<
49        super::super::super::super::objects::ingest::api::IngestTransform,
50        conjure_http::private::Error,
51    >;
52    /// Returns a paginated list of the transforms belonging to a single ingest job, oldest-first and
53    /// optionally filtered by status. The caller must be authorized to read the parent job's dataset;
54    /// a job that is not visible to the caller is reported as IngestJobNotFound.
55    #[endpoint(
56        method = POST,
57        path = "/ingest/v1/ingest-transforms/search",
58        name = "searchIngestTransforms",
59        accept = conjure_http::client::StdResponseDeserializer
60    )]
61    fn search_ingest_transforms(
62        &self,
63        #[auth]
64        auth_: &conjure_object::BearerToken,
65        #[body(serializer = conjure_http::client::StdRequestSerializer)]
66        request: &super::super::super::super::objects::ingest::api::SearchIngestTransformsRequest,
67    ) -> Result<
68        super::super::super::super::objects::ingest::api::SearchIngestTransformsResponse,
69        conjure_http::private::Error,
70    >;
71    /// Returns a paginated list of ingest jobs, optionally filtered by dataset.
72    #[endpoint(
73        method = POST,
74        path = "/ingest/v1/ingest-jobs/search",
75        name = "searchIngestJobs",
76        accept = conjure_http::client::StdResponseDeserializer
77    )]
78    fn search_ingest_jobs(
79        &self,
80        #[auth]
81        auth_: &conjure_object::BearerToken,
82        #[body(serializer = conjure_http::client::StdRequestSerializer)]
83        request: &super::super::super::super::objects::ingest::api::SearchIngestJobsRequest,
84    ) -> Result<
85        super::super::super::super::objects::ingest::api::SearchIngestJobsResponse,
86        conjure_http::private::Error,
87    >;
88    /// Returns the number of ingest jobs matching the filter, applying the same visibility rules as
89    /// searchIngestJobs: jobs without a persisted dataset are excluded, and only jobs whose dataset
90    /// the caller is authorized to read are counted. Intended for cheap polling (e.g. an active-job
91    /// indicator) instead of paginating searchIngestJobs just to count results. Throws
92    /// INVALID_ARGUMENT when the filter matches jobs across more distinct datasets than can be
93    /// authorized in one request; narrow the filter in that case.
94    #[endpoint(
95        method = POST,
96        path = "/ingest/v1/ingest-jobs/count",
97        name = "countIngestJobs",
98        accept = conjure_http::client::StdResponseDeserializer
99    )]
100    fn count_ingest_jobs(
101        &self,
102        #[auth]
103        auth_: &conjure_object::BearerToken,
104        #[body(serializer = conjure_http::client::StdRequestSerializer)]
105        request: &super::super::super::super::objects::ingest::api::CountIngestJobsRequest,
106    ) -> Result<
107        super::super::super::super::objects::ingest::api::CountIngestJobsResponse,
108        conjure_http::private::Error,
109    >;
110    /// Cancels an ingest job. Jobs that have not yet started running (SUBMITTED, QUEUED) are
111    /// transitioned directly to CANCELLED. Jobs that are IN_PROGRESS have their underlying
112    /// Temporal workflow cancelled; the workflow is responsible for transitioning the job to
113    /// CANCELLED and tearing down in-flight work. Cancelling a job that is already in a terminal
114    /// state (COMPLETED, FAILED, CANCELLED) throws IngestJobNotCancellable.
115    #[endpoint(
116        method = POST,
117        path = "/ingest/v1/ingest-job/{ingestJobRid}/cancel",
118        name = "cancelIngestJob",
119        accept = conjure_http::client::StdResponseDeserializer
120    )]
121    fn cancel_ingest_job(
122        &self,
123        #[auth]
124        auth_: &conjure_object::BearerToken,
125        #[path(
126            name = "ingestJobRid",
127            encoder = conjure_http::client::conjure::PlainEncoder
128        )]
129        ingest_job_rid: &super::super::super::super::objects::ingest::api::IngestJobRid,
130    ) -> Result<
131        super::super::super::super::objects::ingest::api::IngestJob,
132        conjure_http::private::Error,
133    >;
134    /// Cancels multiple ingest jobs in a single call. Each job is processed independently and
135    /// best-effort: a job that cannot be cancelled (already terminal, missing, or not authorized for
136    /// the caller) yields a `failed` result rather than aborting the batch. Per-job cancellation
137    /// semantics match cancelIngestJob. At most 100 jobs may be requested per call.
138    #[endpoint(
139        method = POST,
140        path = "/ingest/v1/ingest-jobs/cancel",
141        name = "batchCancelIngestJobs",
142        accept = conjure_http::client::StdResponseDeserializer
143    )]
144    fn batch_cancel_ingest_jobs(
145        &self,
146        #[auth]
147        auth_: &conjure_object::BearerToken,
148        #[body(serializer = conjure_http::client::StdRequestSerializer)]
149        request: &super::super::super::super::objects::ingest::api::BatchCancelIngestJobsRequest,
150    ) -> Result<
151        super::super::super::super::objects::ingest::api::BatchCancelIngestJobsResponse,
152        conjure_http::private::Error,
153    >;
154}
155/// Public API for querying ingest jobs.
156#[conjure_http::conjure_client(name = "IngestJobService")]
157pub trait AsyncIngestJobService<
158    #[response_body]
159    I: conjure_http::private::Stream<
160            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
161        >,
162> {
163    /// Returns a single ingest job by RID. Does not include the full ingest request details.
164    #[endpoint(
165        method = GET,
166        path = "/ingest/v1/ingest-job/{ingestJobRid}",
167        name = "getIngestJob",
168        accept = conjure_http::client::StdResponseDeserializer
169    )]
170    async fn get_ingest_job(
171        &self,
172        #[auth]
173        auth_: &conjure_object::BearerToken,
174        #[path(
175            name = "ingestJobRid",
176            encoder = conjure_http::client::conjure::PlainEncoder
177        )]
178        ingest_job_rid: &super::super::super::super::objects::ingest::api::IngestJobRid,
179    ) -> Result<
180        super::super::super::super::objects::ingest::api::IngestJob,
181        conjure_http::private::Error,
182    >;
183    /// Returns a single ingest transform by RID. The caller must be authorized to read the dataset
184    /// produced by the transform's parent ingest job; a transform whose parent job is not visible to
185    /// the caller is reported as IngestTransformNotFound rather than leaking its existence.
186    #[endpoint(
187        method = GET,
188        path = "/ingest/v1/ingest-transform/{ingestTransformRid}",
189        name = "getIngestTransform",
190        accept = conjure_http::client::StdResponseDeserializer
191    )]
192    async fn get_ingest_transform(
193        &self,
194        #[auth]
195        auth_: &conjure_object::BearerToken,
196        #[path(
197            name = "ingestTransformRid",
198            encoder = conjure_http::client::conjure::PlainEncoder
199        )]
200        ingest_transform_rid: &super::super::super::super::objects::ingest::api::IngestTransformRid,
201    ) -> Result<
202        super::super::super::super::objects::ingest::api::IngestTransform,
203        conjure_http::private::Error,
204    >;
205    /// Returns a paginated list of the transforms belonging to a single ingest job, oldest-first and
206    /// optionally filtered by status. The caller must be authorized to read the parent job's dataset;
207    /// a job that is not visible to the caller is reported as IngestJobNotFound.
208    #[endpoint(
209        method = POST,
210        path = "/ingest/v1/ingest-transforms/search",
211        name = "searchIngestTransforms",
212        accept = conjure_http::client::StdResponseDeserializer
213    )]
214    async fn search_ingest_transforms(
215        &self,
216        #[auth]
217        auth_: &conjure_object::BearerToken,
218        #[body(serializer = conjure_http::client::StdRequestSerializer)]
219        request: &super::super::super::super::objects::ingest::api::SearchIngestTransformsRequest,
220    ) -> Result<
221        super::super::super::super::objects::ingest::api::SearchIngestTransformsResponse,
222        conjure_http::private::Error,
223    >;
224    /// Returns a paginated list of ingest jobs, optionally filtered by dataset.
225    #[endpoint(
226        method = POST,
227        path = "/ingest/v1/ingest-jobs/search",
228        name = "searchIngestJobs",
229        accept = conjure_http::client::StdResponseDeserializer
230    )]
231    async fn search_ingest_jobs(
232        &self,
233        #[auth]
234        auth_: &conjure_object::BearerToken,
235        #[body(serializer = conjure_http::client::StdRequestSerializer)]
236        request: &super::super::super::super::objects::ingest::api::SearchIngestJobsRequest,
237    ) -> Result<
238        super::super::super::super::objects::ingest::api::SearchIngestJobsResponse,
239        conjure_http::private::Error,
240    >;
241    /// Returns the number of ingest jobs matching the filter, applying the same visibility rules as
242    /// searchIngestJobs: jobs without a persisted dataset are excluded, and only jobs whose dataset
243    /// the caller is authorized to read are counted. Intended for cheap polling (e.g. an active-job
244    /// indicator) instead of paginating searchIngestJobs just to count results. Throws
245    /// INVALID_ARGUMENT when the filter matches jobs across more distinct datasets than can be
246    /// authorized in one request; narrow the filter in that case.
247    #[endpoint(
248        method = POST,
249        path = "/ingest/v1/ingest-jobs/count",
250        name = "countIngestJobs",
251        accept = conjure_http::client::StdResponseDeserializer
252    )]
253    async fn count_ingest_jobs(
254        &self,
255        #[auth]
256        auth_: &conjure_object::BearerToken,
257        #[body(serializer = conjure_http::client::StdRequestSerializer)]
258        request: &super::super::super::super::objects::ingest::api::CountIngestJobsRequest,
259    ) -> Result<
260        super::super::super::super::objects::ingest::api::CountIngestJobsResponse,
261        conjure_http::private::Error,
262    >;
263    /// Cancels an ingest job. Jobs that have not yet started running (SUBMITTED, QUEUED) are
264    /// transitioned directly to CANCELLED. Jobs that are IN_PROGRESS have their underlying
265    /// Temporal workflow cancelled; the workflow is responsible for transitioning the job to
266    /// CANCELLED and tearing down in-flight work. Cancelling a job that is already in a terminal
267    /// state (COMPLETED, FAILED, CANCELLED) throws IngestJobNotCancellable.
268    #[endpoint(
269        method = POST,
270        path = "/ingest/v1/ingest-job/{ingestJobRid}/cancel",
271        name = "cancelIngestJob",
272        accept = conjure_http::client::StdResponseDeserializer
273    )]
274    async fn cancel_ingest_job(
275        &self,
276        #[auth]
277        auth_: &conjure_object::BearerToken,
278        #[path(
279            name = "ingestJobRid",
280            encoder = conjure_http::client::conjure::PlainEncoder
281        )]
282        ingest_job_rid: &super::super::super::super::objects::ingest::api::IngestJobRid,
283    ) -> Result<
284        super::super::super::super::objects::ingest::api::IngestJob,
285        conjure_http::private::Error,
286    >;
287    /// Cancels multiple ingest jobs in a single call. Each job is processed independently and
288    /// best-effort: a job that cannot be cancelled (already terminal, missing, or not authorized for
289    /// the caller) yields a `failed` result rather than aborting the batch. Per-job cancellation
290    /// semantics match cancelIngestJob. At most 100 jobs may be requested per call.
291    #[endpoint(
292        method = POST,
293        path = "/ingest/v1/ingest-jobs/cancel",
294        name = "batchCancelIngestJobs",
295        accept = conjure_http::client::StdResponseDeserializer
296    )]
297    async fn batch_cancel_ingest_jobs(
298        &self,
299        #[auth]
300        auth_: &conjure_object::BearerToken,
301        #[body(serializer = conjure_http::client::StdRequestSerializer)]
302        request: &super::super::super::super::objects::ingest::api::BatchCancelIngestJobsRequest,
303    ) -> Result<
304        super::super::super::super::objects::ingest::api::BatchCancelIngestJobsResponse,
305        conjure_http::private::Error,
306    >;
307}
308/// Public API for querying ingest jobs.
309#[conjure_http::conjure_client(name = "IngestJobService", local)]
310pub trait LocalAsyncIngestJobService<
311    #[response_body]
312    I: conjure_http::private::Stream<
313            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
314        >,
315> {
316    /// Returns a single ingest job by RID. Does not include the full ingest request details.
317    #[endpoint(
318        method = GET,
319        path = "/ingest/v1/ingest-job/{ingestJobRid}",
320        name = "getIngestJob",
321        accept = conjure_http::client::StdResponseDeserializer
322    )]
323    async fn get_ingest_job(
324        &self,
325        #[auth]
326        auth_: &conjure_object::BearerToken,
327        #[path(
328            name = "ingestJobRid",
329            encoder = conjure_http::client::conjure::PlainEncoder
330        )]
331        ingest_job_rid: &super::super::super::super::objects::ingest::api::IngestJobRid,
332    ) -> Result<
333        super::super::super::super::objects::ingest::api::IngestJob,
334        conjure_http::private::Error,
335    >;
336    /// Returns a single ingest transform by RID. The caller must be authorized to read the dataset
337    /// produced by the transform's parent ingest job; a transform whose parent job is not visible to
338    /// the caller is reported as IngestTransformNotFound rather than leaking its existence.
339    #[endpoint(
340        method = GET,
341        path = "/ingest/v1/ingest-transform/{ingestTransformRid}",
342        name = "getIngestTransform",
343        accept = conjure_http::client::StdResponseDeserializer
344    )]
345    async fn get_ingest_transform(
346        &self,
347        #[auth]
348        auth_: &conjure_object::BearerToken,
349        #[path(
350            name = "ingestTransformRid",
351            encoder = conjure_http::client::conjure::PlainEncoder
352        )]
353        ingest_transform_rid: &super::super::super::super::objects::ingest::api::IngestTransformRid,
354    ) -> Result<
355        super::super::super::super::objects::ingest::api::IngestTransform,
356        conjure_http::private::Error,
357    >;
358    /// Returns a paginated list of the transforms belonging to a single ingest job, oldest-first and
359    /// optionally filtered by status. The caller must be authorized to read the parent job's dataset;
360    /// a job that is not visible to the caller is reported as IngestJobNotFound.
361    #[endpoint(
362        method = POST,
363        path = "/ingest/v1/ingest-transforms/search",
364        name = "searchIngestTransforms",
365        accept = conjure_http::client::StdResponseDeserializer
366    )]
367    async fn search_ingest_transforms(
368        &self,
369        #[auth]
370        auth_: &conjure_object::BearerToken,
371        #[body(serializer = conjure_http::client::StdRequestSerializer)]
372        request: &super::super::super::super::objects::ingest::api::SearchIngestTransformsRequest,
373    ) -> Result<
374        super::super::super::super::objects::ingest::api::SearchIngestTransformsResponse,
375        conjure_http::private::Error,
376    >;
377    /// Returns a paginated list of ingest jobs, optionally filtered by dataset.
378    #[endpoint(
379        method = POST,
380        path = "/ingest/v1/ingest-jobs/search",
381        name = "searchIngestJobs",
382        accept = conjure_http::client::StdResponseDeserializer
383    )]
384    async fn search_ingest_jobs(
385        &self,
386        #[auth]
387        auth_: &conjure_object::BearerToken,
388        #[body(serializer = conjure_http::client::StdRequestSerializer)]
389        request: &super::super::super::super::objects::ingest::api::SearchIngestJobsRequest,
390    ) -> Result<
391        super::super::super::super::objects::ingest::api::SearchIngestJobsResponse,
392        conjure_http::private::Error,
393    >;
394    /// Returns the number of ingest jobs matching the filter, applying the same visibility rules as
395    /// searchIngestJobs: jobs without a persisted dataset are excluded, and only jobs whose dataset
396    /// the caller is authorized to read are counted. Intended for cheap polling (e.g. an active-job
397    /// indicator) instead of paginating searchIngestJobs just to count results. Throws
398    /// INVALID_ARGUMENT when the filter matches jobs across more distinct datasets than can be
399    /// authorized in one request; narrow the filter in that case.
400    #[endpoint(
401        method = POST,
402        path = "/ingest/v1/ingest-jobs/count",
403        name = "countIngestJobs",
404        accept = conjure_http::client::StdResponseDeserializer
405    )]
406    async fn count_ingest_jobs(
407        &self,
408        #[auth]
409        auth_: &conjure_object::BearerToken,
410        #[body(serializer = conjure_http::client::StdRequestSerializer)]
411        request: &super::super::super::super::objects::ingest::api::CountIngestJobsRequest,
412    ) -> Result<
413        super::super::super::super::objects::ingest::api::CountIngestJobsResponse,
414        conjure_http::private::Error,
415    >;
416    /// Cancels an ingest job. Jobs that have not yet started running (SUBMITTED, QUEUED) are
417    /// transitioned directly to CANCELLED. Jobs that are IN_PROGRESS have their underlying
418    /// Temporal workflow cancelled; the workflow is responsible for transitioning the job to
419    /// CANCELLED and tearing down in-flight work. Cancelling a job that is already in a terminal
420    /// state (COMPLETED, FAILED, CANCELLED) throws IngestJobNotCancellable.
421    #[endpoint(
422        method = POST,
423        path = "/ingest/v1/ingest-job/{ingestJobRid}/cancel",
424        name = "cancelIngestJob",
425        accept = conjure_http::client::StdResponseDeserializer
426    )]
427    async fn cancel_ingest_job(
428        &self,
429        #[auth]
430        auth_: &conjure_object::BearerToken,
431        #[path(
432            name = "ingestJobRid",
433            encoder = conjure_http::client::conjure::PlainEncoder
434        )]
435        ingest_job_rid: &super::super::super::super::objects::ingest::api::IngestJobRid,
436    ) -> Result<
437        super::super::super::super::objects::ingest::api::IngestJob,
438        conjure_http::private::Error,
439    >;
440    /// Cancels multiple ingest jobs in a single call. Each job is processed independently and
441    /// best-effort: a job that cannot be cancelled (already terminal, missing, or not authorized for
442    /// the caller) yields a `failed` result rather than aborting the batch. Per-job cancellation
443    /// semantics match cancelIngestJob. At most 100 jobs may be requested per call.
444    #[endpoint(
445        method = POST,
446        path = "/ingest/v1/ingest-jobs/cancel",
447        name = "batchCancelIngestJobs",
448        accept = conjure_http::client::StdResponseDeserializer
449    )]
450    async fn batch_cancel_ingest_jobs(
451        &self,
452        #[auth]
453        auth_: &conjure_object::BearerToken,
454        #[body(serializer = conjure_http::client::StdRequestSerializer)]
455        request: &super::super::super::super::objects::ingest::api::BatchCancelIngestJobsRequest,
456    ) -> Result<
457        super::super::super::super::objects::ingest::api::BatchCancelIngestJobsResponse,
458        conjure_http::private::Error,
459    >;
460}