agentmail/types/pods.rs
1use serde::{Deserialize, Serialize};
2
3/// A pod, a container that owns inboxes and other resources.
4#[derive(Clone, Debug, Deserialize)]
5pub struct Pod {
6 /// Unique pod id.
7 pub pod_id: String,
8 /// Human-readable pod name.
9 #[serde(default)]
10 pub name: Option<String>,
11 /// Your reference id from creation, when set.
12 #[serde(default)]
13 pub client_id: Option<String>,
14 /// Timestamp the pod was last updated (RFC 3339).
15 #[serde(default)]
16 pub updated_at: Option<String>,
17 /// Timestamp the pod was created (RFC 3339).
18 #[serde(default)]
19 pub created_at: Option<String>,
20}
21
22/// Request body for [`Client::create_pod`](crate::Client::create_pod). All fields optional.
23#[derive(Clone, Debug, Default, Serialize)]
24pub struct CreatePod {
25 /// Human-readable pod name.
26 #[serde(skip_serializing_if = "Option::is_none")]
27 pub name: Option<String>,
28 /// Your own idempotency/reference id for this pod.
29 #[serde(skip_serializing_if = "Option::is_none")]
30 pub client_id: Option<String>,
31}
32
33/// One page of pods from [`Client::list_pods_page`](crate::Client::list_pods_page).
34#[derive(Clone, Debug, Deserialize)]
35pub struct PodList {
36 /// Total pods in the account (not just this page).
37 pub count: u64,
38 /// This page of pods.
39 #[serde(default)]
40 pub pods: Vec<Pod>,
41 /// Cursor for the next page; `None` on the last page.
42 #[serde(default)]
43 pub next_page_token: Option<String>,
44}