cloudflare/endpoints/workers/
delete_secret.rs

1use surf::http::Method;
2
3use crate::framework::endpoint::Endpoint;
4
5/// Delete Secret
6/// https://api.cloudflare.com/#worker-delete-secret
7#[derive(Debug)]
8pub struct DeleteSecret<'a> {
9    /// account id of owner of the script
10    pub account_identifier: &'a str,
11    /// the name of the script to remove the secret from
12    pub script_name: &'a str,
13    /// the variable name of the secret
14    pub secret_name: &'a str,
15}
16
17impl<'a> Endpoint<(), (), ()> for DeleteSecret<'a> {
18    fn method(&self) -> Method {
19        Method::Delete
20    }
21    fn path(&self) -> String {
22        format!(
23            "accounts/{}/workers/scripts/{}/secrets/{}",
24            self.account_identifier, self.script_name, self.secret_name
25        )
26    }
27}