cloudflare_but_works/endpoints/workers/
delete_do.rs

1use crate::framework::endpoint::{EndpointSpec, Method};
2use crate::framework::response::ApiSuccess;
3
4/// Delete a Durable Object namespace
5#[derive(Debug)]
6pub struct DeleteDurableObject<'a> {
7    /// account ID where the Durable Object is present
8    pub account_id: &'a str,
9    /// namespace ID of the Durable Object
10    pub namespace_id: &'a str,
11}
12
13impl EndpointSpec for DeleteDurableObject<'_> {
14    type JsonResponse = ();
15    type ResponseType = ApiSuccess<Self::JsonResponse>;
16
17    fn method(&self) -> Method {
18        Method::DELETE
19    }
20
21    fn path(&self) -> String {
22        format!(
23            "accounts/{}/workers/durable_objects/namespaces/{}",
24            self.account_id, self.namespace_id
25        )
26    }
27}