Skip to main content

nominal_api/conjure/endpoints/scout/jobs/api/
job_service.rs

1use conjure_http::endpoint;
2/// The Job Service is responsible for returning information about jobs for checklist executions.
3#[conjure_http::conjure_endpoints(name = "JobService", use_legacy_error_serialization)]
4pub trait JobService {
5    /// Fetches the job report for a job RID. Throws ResourcesNotFound if no job exists with this job RID.
6    #[endpoint(
7        method = GET,
8        path = "/jobs/v1/{jobRid}/job-report",
9        name = "getJobReport",
10        produces = conjure_http::server::StdResponseSerializer
11    )]
12    fn get_job_report(
13        &self,
14        #[auth]
15        auth_: conjure_object::BearerToken,
16        #[path(
17            name = "jobRid",
18            decoder = conjure_http::server::conjure::FromPlainDecoder,
19            log_as = "jobRid",
20            safe
21        )]
22        job_rid: super::super::super::super::super::objects::scout::checks::api::JobRid,
23    ) -> Result<
24        super::super::super::super::super::objects::scout::checks::api::JobReport,
25        conjure_http::private::Error,
26    >;
27    /// Fetches the job reports for a set of job RIDs. Omits any job reports the user is not permitted to see from
28    /// the response.
29    #[endpoint(
30        method = POST,
31        path = "/jobs/v1/batch-get-job-reports",
32        name = "batchGetJobReports",
33        produces = conjure_http::server::StdResponseSerializer
34    )]
35    fn batch_get_job_reports(
36        &self,
37        #[auth]
38        auth_: conjure_object::BearerToken,
39        #[body(deserializer = conjure_http::server::StdRequestDeserializer, safe)]
40        request: super::super::super::super::super::objects::scout::checks::api::BatchGetJobReportsRequest,
41    ) -> Result<
42        super::super::super::super::super::objects::scout::checks::api::BatchGetJobReportsResponse,
43        conjure_http::private::Error,
44    >;
45}
46/// The Job Service is responsible for returning information about jobs for checklist executions.
47#[conjure_http::conjure_endpoints(name = "JobService", use_legacy_error_serialization)]
48pub trait AsyncJobService {
49    /// Fetches the job report for a job RID. Throws ResourcesNotFound if no job exists with this job RID.
50    #[endpoint(
51        method = GET,
52        path = "/jobs/v1/{jobRid}/job-report",
53        name = "getJobReport",
54        produces = conjure_http::server::StdResponseSerializer
55    )]
56    async fn get_job_report(
57        &self,
58        #[auth]
59        auth_: conjure_object::BearerToken,
60        #[path(
61            name = "jobRid",
62            decoder = conjure_http::server::conjure::FromPlainDecoder,
63            log_as = "jobRid",
64            safe
65        )]
66        job_rid: super::super::super::super::super::objects::scout::checks::api::JobRid,
67    ) -> Result<
68        super::super::super::super::super::objects::scout::checks::api::JobReport,
69        conjure_http::private::Error,
70    >;
71    /// Fetches the job reports for a set of job RIDs. Omits any job reports the user is not permitted to see from
72    /// the response.
73    #[endpoint(
74        method = POST,
75        path = "/jobs/v1/batch-get-job-reports",
76        name = "batchGetJobReports",
77        produces = conjure_http::server::StdResponseSerializer
78    )]
79    async fn batch_get_job_reports(
80        &self,
81        #[auth]
82        auth_: conjure_object::BearerToken,
83        #[body(deserializer = conjure_http::server::StdRequestDeserializer, safe)]
84        request: super::super::super::super::super::objects::scout::checks::api::BatchGetJobReportsRequest,
85    ) -> Result<
86        super::super::super::super::super::objects::scout::checks::api::BatchGetJobReportsResponse,
87        conjure_http::private::Error,
88    >;
89}
90/// The Job Service is responsible for returning information about jobs for checklist executions.
91#[conjure_http::conjure_endpoints(
92    name = "JobService",
93    use_legacy_error_serialization,
94    local
95)]
96pub trait LocalAsyncJobService {
97    /// Fetches the job report for a job RID. Throws ResourcesNotFound if no job exists with this job RID.
98    #[endpoint(
99        method = GET,
100        path = "/jobs/v1/{jobRid}/job-report",
101        name = "getJobReport",
102        produces = conjure_http::server::StdResponseSerializer
103    )]
104    async fn get_job_report(
105        &self,
106        #[auth]
107        auth_: conjure_object::BearerToken,
108        #[path(
109            name = "jobRid",
110            decoder = conjure_http::server::conjure::FromPlainDecoder,
111            log_as = "jobRid",
112            safe
113        )]
114        job_rid: super::super::super::super::super::objects::scout::checks::api::JobRid,
115    ) -> Result<
116        super::super::super::super::super::objects::scout::checks::api::JobReport,
117        conjure_http::private::Error,
118    >;
119    /// Fetches the job reports for a set of job RIDs. Omits any job reports the user is not permitted to see from
120    /// the response.
121    #[endpoint(
122        method = POST,
123        path = "/jobs/v1/batch-get-job-reports",
124        name = "batchGetJobReports",
125        produces = conjure_http::server::StdResponseSerializer
126    )]
127    async fn batch_get_job_reports(
128        &self,
129        #[auth]
130        auth_: conjure_object::BearerToken,
131        #[body(deserializer = conjure_http::server::StdRequestDeserializer, safe)]
132        request: super::super::super::super::super::objects::scout::checks::api::BatchGetJobReportsRequest,
133    ) -> Result<
134        super::super::super::super::super::objects::scout::checks::api::BatchGetJobReportsResponse,
135        conjure_http::private::Error,
136    >;
137}