benchling/request/
list_stage_run_output_samples.rs1use serde_json::json;
2use crate::model::*;
3use crate::BenchlingClient;
4pub struct ListStageRunOutputSamplesRequest<'a> {
8 pub(crate) client: &'a BenchlingClient,
9 pub stage_run_id: String,
10}
11impl<'a> ListStageRunOutputSamplesRequest<'a> {
12 pub async fn send(self) -> anyhow::Result<WorkflowSampleList> {
13 let mut r = self
14 .client
15 .client
16 .get(
17 &format!(
18 "/workflow-stage-runs/{stage_run_id}/output-samples", stage_run_id =
19 self.stage_run_id
20 ),
21 );
22 r = self.client.authenticate(r);
23 let res = r.send().await.unwrap().error_for_status();
24 match res {
25 Ok(res) => res.json().await.map_err(|e| anyhow::anyhow!("{:?}", e)),
26 Err(res) => {
27 let text = res.text().await.map_err(|e| anyhow::anyhow!("{:?}", e))?;
28 Err(anyhow::anyhow!("{:?}", text))
29 }
30 }
31 }
32}