podman_client/manifests/
modify.rs

1use http_body_util::Full;
2use hyper::body::Bytes;
3
4use crate::{
5    client::Client,
6    models::{
7        connection::SendRequestOptions,
8        lib::Error,
9        podman::manifests::modify::{ManifestModify, ManifestModifyOptions},
10    },
11    utils::bool_to_str::bool_to_str,
12};
13
14impl Client {
15    pub async fn manifest_modify(
16        &self,
17        options: ManifestModifyOptions<'_>,
18    ) -> Result<ManifestModify, Error> {
19        let mut path = ["/libpod/manifests/", options.name].concat();
20
21        if let Some(tls_verify) = options.tls_verify {
22            path += &["?tlsVerify=", bool_to_str(tls_verify)].concat();
23        }
24
25        let (_, data) = self
26            .send_request::<_, (), _>(SendRequestOptions {
27                method: "PUT",
28                path: &path,
29                header: None,
30                body: Full::new(Bytes::from(serde_json::to_string(&options.request)?)),
31            })
32            .await?;
33
34        Ok(data)
35    }
36}