aliyun_oss_rs/bucket/
del_bucket_encryption.rs

1use crate::{
2    Error,
3    error::normal_error,
4    request::{Oss, OssRequest},
5};
6use http::Method;
7
8/// Delete the bucket encryption configuration.
9///
10/// See the [Alibaba Cloud documentation](https://help.aliyun.com/zh/oss/developer-reference/deletebucketencryption) for details.
11pub struct DelBucketEncryption {
12    req: OssRequest,
13}
14
15impl DelBucketEncryption {
16    pub(super) fn new(oss: Oss) -> Self {
17        let mut req = OssRequest::new(oss, Method::DELETE);
18        req.insert_query("encryption", "");
19        DelBucketEncryption { req }
20    }
21
22    /// Send the request.
23    pub async fn send(self) -> Result<(), Error> {
24        let response = self.req.send_to_oss()?.await?;
25        match response.status() {
26            code if code.is_success() => Ok(()),
27            _ => Err(normal_error(response).await),
28        }
29    }
30}