cloudflare_but_works/endpoints/workers/
delete_script.rs1use crate::framework::endpoint::{EndpointSpec, Method};
2use crate::framework::response::{ApiResult, ApiSuccess};
3
4use serde::{Deserialize, Serialize};
5
6#[derive(Debug)]
9pub struct DeleteScript<'a> {
10 pub account_id: &'a str,
12 pub script_name: &'a str,
14}
15
16impl EndpointSpec for DeleteScript<'_> {
17 type JsonResponse = ScriptDeleteID;
18 type ResponseType = ApiSuccess<Self::JsonResponse>;
19
20 fn method(&self) -> Method {
21 Method::DELETE
22 }
23 fn path(&self) -> String {
24 format!(
25 "accounts/{}/workers/scripts/{}",
26 self.account_id, self.script_name
27 )
28 }
29}
30
31#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
32pub struct ScriptDeleteID {
33 pub id: String,
34}
35impl ApiResult for ScriptDeleteID {}