cloudflare/endpoints/workers/
list_routes.rs

1use surf::http::Method;
2
3use super::WorkersRoute;
4use crate::framework::endpoint::Endpoint;
5
6/// List Routes
7/// Lists all route mappings for a given zone
8/// https://api.cloudflare.com/#worker-routes-list-routes
9#[derive(Debug)]
10pub struct ListRoutes<'a> {
11    pub zone_identifier: &'a str,
12}
13
14impl<'a> Endpoint<Vec<WorkersRoute>> for ListRoutes<'a> {
15    fn method(&self) -> Method {
16        Method::Get
17    }
18    fn path(&self) -> String {
19        format!("zones/{}/workers/routes", self.zone_identifier)
20    }
21}