cloudflare/endpoints/workers/
list_tails.rs

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