use crate::framework::endpoint::{EndpointSpec, Method};
#[derive(Debug)]
pub struct DeleteBulk<'a> {
pub account_identifier: &'a str,
pub namespace_identifier: &'a str,
pub bulk_keys: Vec<String>,
}
impl<'a> EndpointSpec<()> for DeleteBulk<'a> {
fn method(&self) -> Method {
Method::DELETE
}
fn path(&self) -> String {
format!(
"accounts/{}/storage/kv/namespaces/{}/bulk",
self.account_identifier, self.namespace_identifier
)
}
#[inline]
fn body(&self) -> Option<String> {
let body = serde_json::to_string(&self.bulk_keys).unwrap();
Some(body)
}
}