cloudflare/endpoints/workers/
list_secrets.rs

1use surf::http::Method;
2
3use super::WorkersSecret;
4
5use crate::framework::endpoint::Endpoint;
6
7/// List Secrets
8/// Lists all secrets mappings for a given script
9/// https://api.cloudflare.com/#worker-secrets-list-secrets
10#[derive(Debug)]
11pub struct ListSecrets<'a> {
12    pub account_identifier: &'a str,
13    pub script_name: &'a str,
14}
15
16impl<'a> Endpoint<Vec<WorkersSecret>> for ListSecrets<'a> {
17    fn method(&self) -> Method {
18        Method::Get
19    }
20    fn path(&self) -> String {
21        format!(
22            "accounts/{}/workers/scripts/{}/secrets",
23            self.account_identifier, self.script_name
24        )
25    }
26}