Skip to main content

nominal_api/conjure/endpoints/ingest/api/
internal_ingest_job_service.rs

1use conjure_http::endpoint;
2/// Internal API for managing ingest jobs. This service is filtered out from public documentation.
3#[conjure_http::conjure_endpoints(
4    name = "InternalIngestJobService",
5    use_legacy_error_serialization
6)]
7pub trait InternalIngestJobService {
8    /// Creates an ingest job, returning a RID for the job.
9    #[endpoint(
10        method = POST,
11        path = "/internal/ingest/v1/ingest-job",
12        name = "createIngestJob",
13        produces = conjure_http::server::StdResponseSerializer
14    )]
15    fn create_ingest_job(
16        &self,
17        #[auth]
18        auth_: conjure_object::BearerToken,
19        #[body(
20            deserializer = conjure_http::server::StdRequestDeserializer,
21            log_as = "createIngestJobRequest"
22        )]
23        create_ingest_job_request: super::super::super::super::objects::ingest::api::CreateIngestJobRequest,
24    ) -> Result<conjure_object::ResourceIdentifier, conjure_http::private::Error>;
25    /// Returns a single ingest job by RID with full details including the ingest request.
26    #[endpoint(
27        method = GET,
28        path = "/internal/ingest/v1/ingest-job/{ingestJobRid}",
29        name = "getIngestJobInternal",
30        produces = conjure_http::server::StdResponseSerializer
31    )]
32    fn get_ingest_job_internal(
33        &self,
34        #[auth]
35        auth_: conjure_object::BearerToken,
36        #[path(
37            name = "ingestJobRid",
38            decoder = conjure_http::server::conjure::FromPlainDecoder,
39            log_as = "ingestJobRid"
40        )]
41        ingest_job_rid: conjure_object::ResourceIdentifier,
42    ) -> Result<
43        super::super::super::super::objects::ingest::api::InternalIngestJob,
44        conjure_http::private::Error,
45    >;
46    /// Updates the status of an ingest job.
47    #[endpoint(
48        method = PUT,
49        path = "/internal/ingest/v1/ingest-job/{ingestJobRid}/status",
50        name = "updateIngestJobStatus",
51        produces = conjure_http::server::StdResponseSerializer
52    )]
53    fn update_ingest_job_status(
54        &self,
55        #[auth]
56        auth_: conjure_object::BearerToken,
57        #[path(
58            name = "ingestJobRid",
59            decoder = conjure_http::server::conjure::FromPlainDecoder,
60            log_as = "ingestJobRid"
61        )]
62        ingest_job_rid: conjure_object::ResourceIdentifier,
63        #[body(deserializer = conjure_http::server::StdRequestDeserializer, safe)]
64        status: super::super::super::super::objects::ingest::api::IngestJobStatus,
65    ) -> Result<
66        super::super::super::super::objects::ingest::api::IngestJobStatus,
67        conjure_http::private::Error,
68    >;
69}
70/// Internal API for managing ingest jobs. This service is filtered out from public documentation.
71#[conjure_http::conjure_endpoints(
72    name = "InternalIngestJobService",
73    use_legacy_error_serialization
74)]
75pub trait AsyncInternalIngestJobService {
76    /// Creates an ingest job, returning a RID for the job.
77    #[endpoint(
78        method = POST,
79        path = "/internal/ingest/v1/ingest-job",
80        name = "createIngestJob",
81        produces = conjure_http::server::StdResponseSerializer
82    )]
83    async fn create_ingest_job(
84        &self,
85        #[auth]
86        auth_: conjure_object::BearerToken,
87        #[body(
88            deserializer = conjure_http::server::StdRequestDeserializer,
89            log_as = "createIngestJobRequest"
90        )]
91        create_ingest_job_request: super::super::super::super::objects::ingest::api::CreateIngestJobRequest,
92    ) -> Result<conjure_object::ResourceIdentifier, conjure_http::private::Error>;
93    /// Returns a single ingest job by RID with full details including the ingest request.
94    #[endpoint(
95        method = GET,
96        path = "/internal/ingest/v1/ingest-job/{ingestJobRid}",
97        name = "getIngestJobInternal",
98        produces = conjure_http::server::StdResponseSerializer
99    )]
100    async fn get_ingest_job_internal(
101        &self,
102        #[auth]
103        auth_: conjure_object::BearerToken,
104        #[path(
105            name = "ingestJobRid",
106            decoder = conjure_http::server::conjure::FromPlainDecoder,
107            log_as = "ingestJobRid"
108        )]
109        ingest_job_rid: conjure_object::ResourceIdentifier,
110    ) -> Result<
111        super::super::super::super::objects::ingest::api::InternalIngestJob,
112        conjure_http::private::Error,
113    >;
114    /// Updates the status of an ingest job.
115    #[endpoint(
116        method = PUT,
117        path = "/internal/ingest/v1/ingest-job/{ingestJobRid}/status",
118        name = "updateIngestJobStatus",
119        produces = conjure_http::server::StdResponseSerializer
120    )]
121    async fn update_ingest_job_status(
122        &self,
123        #[auth]
124        auth_: conjure_object::BearerToken,
125        #[path(
126            name = "ingestJobRid",
127            decoder = conjure_http::server::conjure::FromPlainDecoder,
128            log_as = "ingestJobRid"
129        )]
130        ingest_job_rid: conjure_object::ResourceIdentifier,
131        #[body(deserializer = conjure_http::server::StdRequestDeserializer, safe)]
132        status: super::super::super::super::objects::ingest::api::IngestJobStatus,
133    ) -> Result<
134        super::super::super::super::objects::ingest::api::IngestJobStatus,
135        conjure_http::private::Error,
136    >;
137}
138/// Internal API for managing ingest jobs. This service is filtered out from public documentation.
139#[conjure_http::conjure_endpoints(
140    name = "InternalIngestJobService",
141    use_legacy_error_serialization,
142    local
143)]
144pub trait LocalAsyncInternalIngestJobService {
145    /// Creates an ingest job, returning a RID for the job.
146    #[endpoint(
147        method = POST,
148        path = "/internal/ingest/v1/ingest-job",
149        name = "createIngestJob",
150        produces = conjure_http::server::StdResponseSerializer
151    )]
152    async fn create_ingest_job(
153        &self,
154        #[auth]
155        auth_: conjure_object::BearerToken,
156        #[body(
157            deserializer = conjure_http::server::StdRequestDeserializer,
158            log_as = "createIngestJobRequest"
159        )]
160        create_ingest_job_request: super::super::super::super::objects::ingest::api::CreateIngestJobRequest,
161    ) -> Result<conjure_object::ResourceIdentifier, conjure_http::private::Error>;
162    /// Returns a single ingest job by RID with full details including the ingest request.
163    #[endpoint(
164        method = GET,
165        path = "/internal/ingest/v1/ingest-job/{ingestJobRid}",
166        name = "getIngestJobInternal",
167        produces = conjure_http::server::StdResponseSerializer
168    )]
169    async fn get_ingest_job_internal(
170        &self,
171        #[auth]
172        auth_: conjure_object::BearerToken,
173        #[path(
174            name = "ingestJobRid",
175            decoder = conjure_http::server::conjure::FromPlainDecoder,
176            log_as = "ingestJobRid"
177        )]
178        ingest_job_rid: conjure_object::ResourceIdentifier,
179    ) -> Result<
180        super::super::super::super::objects::ingest::api::InternalIngestJob,
181        conjure_http::private::Error,
182    >;
183    /// Updates the status of an ingest job.
184    #[endpoint(
185        method = PUT,
186        path = "/internal/ingest/v1/ingest-job/{ingestJobRid}/status",
187        name = "updateIngestJobStatus",
188        produces = conjure_http::server::StdResponseSerializer
189    )]
190    async fn update_ingest_job_status(
191        &self,
192        #[auth]
193        auth_: conjure_object::BearerToken,
194        #[path(
195            name = "ingestJobRid",
196            decoder = conjure_http::server::conjure::FromPlainDecoder,
197            log_as = "ingestJobRid"
198        )]
199        ingest_job_rid: conjure_object::ResourceIdentifier,
200        #[body(deserializer = conjure_http::server::StdRequestDeserializer, safe)]
201        status: super::super::super::super::objects::ingest::api::IngestJobStatus,
202    ) -> Result<
203        super::super::super::super::objects::ingest::api::IngestJobStatus,
204        conjure_http::private::Error,
205    >;
206}