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: &conjure_object::ResourceIdentifier,
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: &conjure_object::ResourceIdentifier,
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    /// Cancels an ingest job. Jobs that have not yet started running (SUBMITTED, QUEUED) are
89    /// transitioned directly to CANCELLED. Jobs that are IN_PROGRESS have their underlying
90    /// Temporal workflow cancelled; the workflow is responsible for transitioning the job to
91    /// CANCELLED and tearing down in-flight work. Cancelling a job that is already in a terminal
92    /// state (COMPLETED, FAILED, CANCELLED) throws IngestJobNotCancellable.
93    #[endpoint(
94        method = POST,
95        path = "/ingest/v1/ingest-job/{ingestJobRid}/cancel",
96        name = "cancelIngestJob",
97        accept = conjure_http::client::StdResponseDeserializer
98    )]
99    fn cancel_ingest_job(
100        &self,
101        #[auth]
102        auth_: &conjure_object::BearerToken,
103        #[path(
104            name = "ingestJobRid",
105            encoder = conjure_http::client::conjure::PlainEncoder
106        )]
107        ingest_job_rid: &conjure_object::ResourceIdentifier,
108    ) -> Result<
109        super::super::super::super::objects::ingest::api::IngestJob,
110        conjure_http::private::Error,
111    >;
112    /// Cancels multiple ingest jobs in a single call. Each job is processed independently and
113    /// best-effort: a job that cannot be cancelled (already terminal, missing, or not authorized for
114    /// the caller) yields a `failed` result rather than aborting the batch. Per-job cancellation
115    /// semantics match cancelIngestJob. At most 100 jobs may be requested per call.
116    #[endpoint(
117        method = POST,
118        path = "/ingest/v1/ingest-jobs/cancel",
119        name = "batchCancelIngestJobs",
120        accept = conjure_http::client::StdResponseDeserializer
121    )]
122    fn batch_cancel_ingest_jobs(
123        &self,
124        #[auth]
125        auth_: &conjure_object::BearerToken,
126        #[body(serializer = conjure_http::client::StdRequestSerializer)]
127        request: &super::super::super::super::objects::ingest::api::BatchCancelIngestJobsRequest,
128    ) -> Result<
129        super::super::super::super::objects::ingest::api::BatchCancelIngestJobsResponse,
130        conjure_http::private::Error,
131    >;
132}
133/// Public API for querying ingest jobs.
134#[conjure_http::conjure_client(name = "IngestJobService")]
135pub trait AsyncIngestJobService<
136    #[response_body]
137    I: conjure_http::private::Stream<
138            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
139        >,
140> {
141    /// Returns a single ingest job by RID. Does not include the full ingest request details.
142    #[endpoint(
143        method = GET,
144        path = "/ingest/v1/ingest-job/{ingestJobRid}",
145        name = "getIngestJob",
146        accept = conjure_http::client::StdResponseDeserializer
147    )]
148    async fn get_ingest_job(
149        &self,
150        #[auth]
151        auth_: &conjure_object::BearerToken,
152        #[path(
153            name = "ingestJobRid",
154            encoder = conjure_http::client::conjure::PlainEncoder
155        )]
156        ingest_job_rid: &conjure_object::ResourceIdentifier,
157    ) -> Result<
158        super::super::super::super::objects::ingest::api::IngestJob,
159        conjure_http::private::Error,
160    >;
161    /// Returns a single ingest transform by RID. The caller must be authorized to read the dataset
162    /// produced by the transform's parent ingest job; a transform whose parent job is not visible to
163    /// the caller is reported as IngestTransformNotFound rather than leaking its existence.
164    #[endpoint(
165        method = GET,
166        path = "/ingest/v1/ingest-transform/{ingestTransformRid}",
167        name = "getIngestTransform",
168        accept = conjure_http::client::StdResponseDeserializer
169    )]
170    async fn get_ingest_transform(
171        &self,
172        #[auth]
173        auth_: &conjure_object::BearerToken,
174        #[path(
175            name = "ingestTransformRid",
176            encoder = conjure_http::client::conjure::PlainEncoder
177        )]
178        ingest_transform_rid: &conjure_object::ResourceIdentifier,
179    ) -> Result<
180        super::super::super::super::objects::ingest::api::IngestTransform,
181        conjure_http::private::Error,
182    >;
183    /// Returns a paginated list of the transforms belonging to a single ingest job, oldest-first and
184    /// optionally filtered by status. The caller must be authorized to read the parent job's dataset;
185    /// a job that is not visible to the caller is reported as IngestJobNotFound.
186    #[endpoint(
187        method = POST,
188        path = "/ingest/v1/ingest-transforms/search",
189        name = "searchIngestTransforms",
190        accept = conjure_http::client::StdResponseDeserializer
191    )]
192    async fn search_ingest_transforms(
193        &self,
194        #[auth]
195        auth_: &conjure_object::BearerToken,
196        #[body(serializer = conjure_http::client::StdRequestSerializer)]
197        request: &super::super::super::super::objects::ingest::api::SearchIngestTransformsRequest,
198    ) -> Result<
199        super::super::super::super::objects::ingest::api::SearchIngestTransformsResponse,
200        conjure_http::private::Error,
201    >;
202    /// Returns a paginated list of ingest jobs, optionally filtered by dataset.
203    #[endpoint(
204        method = POST,
205        path = "/ingest/v1/ingest-jobs/search",
206        name = "searchIngestJobs",
207        accept = conjure_http::client::StdResponseDeserializer
208    )]
209    async fn search_ingest_jobs(
210        &self,
211        #[auth]
212        auth_: &conjure_object::BearerToken,
213        #[body(serializer = conjure_http::client::StdRequestSerializer)]
214        request: &super::super::super::super::objects::ingest::api::SearchIngestJobsRequest,
215    ) -> Result<
216        super::super::super::super::objects::ingest::api::SearchIngestJobsResponse,
217        conjure_http::private::Error,
218    >;
219    /// Cancels an ingest job. Jobs that have not yet started running (SUBMITTED, QUEUED) are
220    /// transitioned directly to CANCELLED. Jobs that are IN_PROGRESS have their underlying
221    /// Temporal workflow cancelled; the workflow is responsible for transitioning the job to
222    /// CANCELLED and tearing down in-flight work. Cancelling a job that is already in a terminal
223    /// state (COMPLETED, FAILED, CANCELLED) throws IngestJobNotCancellable.
224    #[endpoint(
225        method = POST,
226        path = "/ingest/v1/ingest-job/{ingestJobRid}/cancel",
227        name = "cancelIngestJob",
228        accept = conjure_http::client::StdResponseDeserializer
229    )]
230    async fn cancel_ingest_job(
231        &self,
232        #[auth]
233        auth_: &conjure_object::BearerToken,
234        #[path(
235            name = "ingestJobRid",
236            encoder = conjure_http::client::conjure::PlainEncoder
237        )]
238        ingest_job_rid: &conjure_object::ResourceIdentifier,
239    ) -> Result<
240        super::super::super::super::objects::ingest::api::IngestJob,
241        conjure_http::private::Error,
242    >;
243    /// Cancels multiple ingest jobs in a single call. Each job is processed independently and
244    /// best-effort: a job that cannot be cancelled (already terminal, missing, or not authorized for
245    /// the caller) yields a `failed` result rather than aborting the batch. Per-job cancellation
246    /// semantics match cancelIngestJob. At most 100 jobs may be requested per call.
247    #[endpoint(
248        method = POST,
249        path = "/ingest/v1/ingest-jobs/cancel",
250        name = "batchCancelIngestJobs",
251        accept = conjure_http::client::StdResponseDeserializer
252    )]
253    async fn batch_cancel_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::BatchCancelIngestJobsRequest,
259    ) -> Result<
260        super::super::super::super::objects::ingest::api::BatchCancelIngestJobsResponse,
261        conjure_http::private::Error,
262    >;
263}
264/// Public API for querying ingest jobs.
265#[conjure_http::conjure_client(name = "IngestJobService", local)]
266pub trait LocalAsyncIngestJobService<
267    #[response_body]
268    I: conjure_http::private::Stream<
269            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
270        >,
271> {
272    /// Returns a single ingest job by RID. Does not include the full ingest request details.
273    #[endpoint(
274        method = GET,
275        path = "/ingest/v1/ingest-job/{ingestJobRid}",
276        name = "getIngestJob",
277        accept = conjure_http::client::StdResponseDeserializer
278    )]
279    async fn get_ingest_job(
280        &self,
281        #[auth]
282        auth_: &conjure_object::BearerToken,
283        #[path(
284            name = "ingestJobRid",
285            encoder = conjure_http::client::conjure::PlainEncoder
286        )]
287        ingest_job_rid: &conjure_object::ResourceIdentifier,
288    ) -> Result<
289        super::super::super::super::objects::ingest::api::IngestJob,
290        conjure_http::private::Error,
291    >;
292    /// Returns a single ingest transform by RID. The caller must be authorized to read the dataset
293    /// produced by the transform's parent ingest job; a transform whose parent job is not visible to
294    /// the caller is reported as IngestTransformNotFound rather than leaking its existence.
295    #[endpoint(
296        method = GET,
297        path = "/ingest/v1/ingest-transform/{ingestTransformRid}",
298        name = "getIngestTransform",
299        accept = conjure_http::client::StdResponseDeserializer
300    )]
301    async fn get_ingest_transform(
302        &self,
303        #[auth]
304        auth_: &conjure_object::BearerToken,
305        #[path(
306            name = "ingestTransformRid",
307            encoder = conjure_http::client::conjure::PlainEncoder
308        )]
309        ingest_transform_rid: &conjure_object::ResourceIdentifier,
310    ) -> Result<
311        super::super::super::super::objects::ingest::api::IngestTransform,
312        conjure_http::private::Error,
313    >;
314    /// Returns a paginated list of the transforms belonging to a single ingest job, oldest-first and
315    /// optionally filtered by status. The caller must be authorized to read the parent job's dataset;
316    /// a job that is not visible to the caller is reported as IngestJobNotFound.
317    #[endpoint(
318        method = POST,
319        path = "/ingest/v1/ingest-transforms/search",
320        name = "searchIngestTransforms",
321        accept = conjure_http::client::StdResponseDeserializer
322    )]
323    async fn search_ingest_transforms(
324        &self,
325        #[auth]
326        auth_: &conjure_object::BearerToken,
327        #[body(serializer = conjure_http::client::StdRequestSerializer)]
328        request: &super::super::super::super::objects::ingest::api::SearchIngestTransformsRequest,
329    ) -> Result<
330        super::super::super::super::objects::ingest::api::SearchIngestTransformsResponse,
331        conjure_http::private::Error,
332    >;
333    /// Returns a paginated list of ingest jobs, optionally filtered by dataset.
334    #[endpoint(
335        method = POST,
336        path = "/ingest/v1/ingest-jobs/search",
337        name = "searchIngestJobs",
338        accept = conjure_http::client::StdResponseDeserializer
339    )]
340    async fn search_ingest_jobs(
341        &self,
342        #[auth]
343        auth_: &conjure_object::BearerToken,
344        #[body(serializer = conjure_http::client::StdRequestSerializer)]
345        request: &super::super::super::super::objects::ingest::api::SearchIngestJobsRequest,
346    ) -> Result<
347        super::super::super::super::objects::ingest::api::SearchIngestJobsResponse,
348        conjure_http::private::Error,
349    >;
350    /// Cancels an ingest job. Jobs that have not yet started running (SUBMITTED, QUEUED) are
351    /// transitioned directly to CANCELLED. Jobs that are IN_PROGRESS have their underlying
352    /// Temporal workflow cancelled; the workflow is responsible for transitioning the job to
353    /// CANCELLED and tearing down in-flight work. Cancelling a job that is already in a terminal
354    /// state (COMPLETED, FAILED, CANCELLED) throws IngestJobNotCancellable.
355    #[endpoint(
356        method = POST,
357        path = "/ingest/v1/ingest-job/{ingestJobRid}/cancel",
358        name = "cancelIngestJob",
359        accept = conjure_http::client::StdResponseDeserializer
360    )]
361    async fn cancel_ingest_job(
362        &self,
363        #[auth]
364        auth_: &conjure_object::BearerToken,
365        #[path(
366            name = "ingestJobRid",
367            encoder = conjure_http::client::conjure::PlainEncoder
368        )]
369        ingest_job_rid: &conjure_object::ResourceIdentifier,
370    ) -> Result<
371        super::super::super::super::objects::ingest::api::IngestJob,
372        conjure_http::private::Error,
373    >;
374    /// Cancels multiple ingest jobs in a single call. Each job is processed independently and
375    /// best-effort: a job that cannot be cancelled (already terminal, missing, or not authorized for
376    /// the caller) yields a `failed` result rather than aborting the batch. Per-job cancellation
377    /// semantics match cancelIngestJob. At most 100 jobs may be requested per call.
378    #[endpoint(
379        method = POST,
380        path = "/ingest/v1/ingest-jobs/cancel",
381        name = "batchCancelIngestJobs",
382        accept = conjure_http::client::StdResponseDeserializer
383    )]
384    async fn batch_cancel_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::BatchCancelIngestJobsRequest,
390    ) -> Result<
391        super::super::super::super::objects::ingest::api::BatchCancelIngestJobsResponse,
392        conjure_http::private::Error,
393    >;
394}