podman_client/manifests/
delete.rs

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