cloudflare/endpoints/workerskv/
list_namespaces.rs1use surf::http::Method;
2
3use super::WorkersKvNamespace;
4use crate::framework::endpoint::Endpoint;
5
6#[derive(Debug)]
10pub struct ListNamespaces<'a> {
11 pub account_identifier: &'a str,
12 pub params: ListNamespacesParams,
13}
14
15impl<'a> Endpoint<Vec<WorkersKvNamespace>, ListNamespacesParams> for ListNamespaces<'a> {
16 fn method(&self) -> Method {
17 Method::Get
18 }
19 fn path(&self) -> String {
20 format!("accounts/{}/storage/kv/namespaces", self.account_identifier)
21 }
22 fn query(&self) -> Option<ListNamespacesParams> {
23 Some(self.params.clone())
24 }
25}
26
27#[serde_with::skip_serializing_none]
28#[derive(Serialize, Clone, Debug, Default)]
29pub struct ListNamespacesParams {
30 pub page: Option<u32>,
31 pub per_page: Option<u32>,
32}