1use super::types::*;
2use crate::client::{AuthType, Client};
3use crate::error::ApiResult;
4
5pub trait FinishedApi {
6 fn batch_query_finished(
9 &self,
10 request: BatchQueryFinishedRequest,
11 auth: AuthType,
12 ) -> impl std::future::Future<Output = ApiResult<BatchQueryFinishedResponse>> + Send;
13
14 fn update_finished(
17 &self,
18 request: UpdateFinishedRequest,
19 auth: AuthType,
20 ) -> impl std::future::Future<Output = ApiResult<UpdateFinishedResponse>> + Send;
21
22 fn query_conclusion_option(
25 &self,
26 request: QueryConclusionOptionRequest,
27 auth: AuthType,
28 ) -> impl std::future::Future<Output = ApiResult<QueryConclusionOptionResponse>> + Send;
29}
30
31impl FinishedApi for Client {
32 async fn batch_query_finished(
33 &self,
34 request: BatchQueryFinishedRequest,
35 auth: AuthType,
36 ) -> ApiResult<BatchQueryFinishedResponse> {
37 Ok(self
38 .post("work_item/finished/batch_query", &request, auth)
39 .await?)
40 }
41
42 async fn update_finished(
43 &self,
44 request: UpdateFinishedRequest,
45 auth: AuthType,
46 ) -> ApiResult<UpdateFinishedResponse> {
47 Ok(self
48 .post("work_item/finished/update", &request, auth)
49 .await?)
50 }
51
52 async fn query_conclusion_option(
53 &self,
54 request: QueryConclusionOptionRequest,
55 auth: AuthType,
56 ) -> ApiResult<QueryConclusionOptionResponse> {
57 Ok(self
58 .post("work_item/finished/query_conclusion_option", &request, auth)
59 .await?)
60 }
61}