cloudflare/endpoints/workerskv/
remove_namespace.rs

1use surf::http::Method;
2
3use crate::framework::endpoint::Endpoint;
4
5/// Remove a Namespace
6/// Deletes the namespace corresponding to the given ID.
7/// https://api.cloudflare.com/#workers-kv-namespace-remove-a-namespace
8#[derive(Debug)]
9pub struct RemoveNamespace<'a> {
10    pub account_identifier: &'a str,
11    pub namespace_identifier: &'a str,
12}
13
14impl<'a> Endpoint for RemoveNamespace<'a> {
15    fn method(&self) -> Method {
16        Method::Delete
17    }
18
19    fn path(&self) -> String {
20        format!(
21            "accounts/{}/storage/kv/namespaces/{}",
22            self.account_identifier, self.namespace_identifier
23        )
24    }
25}