use crate::{
Error,
error::normal_error,
request::{Oss, OssRequest},
};
use http::Method;
pub struct DelBucketLogging {
req: OssRequest,
}
impl DelBucketLogging {
pub(super) fn new(oss: Oss) -> Self {
let mut req = OssRequest::new(oss, Method::DELETE);
req.insert_query("logging", "");
DelBucketLogging { req }
}
pub async fn send(self) -> Result<(), Error> {
let response = self.req.send_to_oss()?.await?;
let status_code = response.status();
match status_code {
code if code.is_success() => Ok(()),
_ => Err(normal_error(response).await),
}
}
}