cloudflare/endpoints/workers/
list_bindings.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use super::WorkersBinding;
use crate::framework::endpoint::{EndpointSpec, Method};

/// List Bindings
/// Lists all bindings for a given script
#[derive(Debug)]
pub struct ListBindings<'a> {
    /// account id of owner of the script
    pub account_id: &'a str,
    /// name of script to list bindings for
    pub script_name: &'a str,
}

impl<'a> EndpointSpec<Vec<WorkersBinding>> for ListBindings<'a> {
    fn method(&self) -> Method {
        Method::GET
    }

    fn path(&self) -> String {
        format!(
            "accounts/{}/workers/scripts/{}/bindings",
            self.account_id, self.script_name
        )
    }
}