cloudflare/endpoints/workers/
send_tail_heartbeat.rs

1use surf::http::Method;
2
3use super::WorkersTail;
4
5use crate::framework::endpoint::Endpoint;
6
7/// Send Tail Heartbeat
8/// https://api.cloudflare.com/#worker-tail-heartbeat
9#[derive(Debug)]
10pub struct SendTailHeartbeat<'a> {
11    /// Account ID of owner of the script
12    pub account_identifier: &'a str,
13    /// The name of the script to tail
14    pub script_name: &'a str,
15    /// The unique identifier of the tail session
16    pub tail_id: &'a str,
17}
18
19impl<'a> Endpoint<WorkersTail> for SendTailHeartbeat<'a> {
20    fn method(&self) -> Method {
21        Method::Post
22    }
23    fn path(&self) -> String {
24        format!(
25            "accounts/{}/workers/scripts/{}/tails/{}/heartbeat",
26            self.account_identifier, self.script_name, self.tail_id
27        )
28    }
29}